Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] WIP: New package: llvm17
@ 2023-10-28  1:03 Calandracas606
  2023-10-28  1:20 ` [PR PATCH] [Updated] " Calandracas606
                   ` (118 more replies)
  0 siblings, 119 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-28  1:03 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

WIP: New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

This is still very WIP

**TODO**

- ompt-multiplex.h
- libunwind docs
- libcxx docs
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies


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

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

From d7e12128bef10acd577fc3d62ce0e3d44b100b3c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@airmail.cc>
Date: Fri, 27 Oct 2023 20:57:05 -0400
Subject: [PATCH] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 ++
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 458 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 946 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..81571270b03c3 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=1
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..41460e3167e60
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,458 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind
+ -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"
+depends="libllvm17>=${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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+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;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 libllvm17"
+
+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
+}
+
+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
+	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
+
+	# TODO: Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+		# TODO: Fix/find the docs
+#		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"
+		# TODO: Fix/find the docs
+#		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() {
+		# TODO Should this exist?
+#		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/17/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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/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] 120+ messages in thread

* Re: [PR PATCH] [Updated] WIP: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
@ 2023-10-28  1:20 ` Calandracas606
  2023-10-28  1:29 ` [PR REVIEW] " Calandracas606
                   ` (117 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-28  1:20 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

WIP: New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

This is still very WIP

**TODO**

- ompt-multiplex.h
- libunwind docs
- libcxx docs
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies


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

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

From c6f267386617d687d152fb73142eab62ed7711b0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@airmail.cc>
Date: Fri, 27 Oct 2023 20:57:05 -0400
Subject: [PATCH] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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/libllvm17                             |   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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 ++
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 458 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 38 files changed, 947 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/libllvm17
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..81571270b03c3 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=1
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..41460e3167e60
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,458 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind
+ -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"
+depends="libllvm17>=${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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+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;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 libllvm17"
+
+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
+}
+
+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
+	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
+
+	# TODO: Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+		# TODO: Fix/find the docs
+#		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"
+		# TODO: Fix/find the docs
+#		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() {
+		# TODO Should this exist?
+#		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/17/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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/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] 120+ messages in thread

* Re: [PR REVIEW] WIP: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (5 preceding siblings ...)
  2023-10-28  1:29 ` Calandracas606
@ 2023-10-28  1:29 ` Calandracas606
  2023-10-28 17:34 ` [WIP] " Calandracas606
                   ` (111 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-28  1:29 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375141806

Comment:
Properly install libunwind documentation

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

* Re: [PR REVIEW] WIP: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (2 preceding siblings ...)
  2023-10-28  1:29 ` Calandracas606
@ 2023-10-28  1:29 ` Calandracas606
  2023-10-28  1:29 ` Calandracas606
                   ` (114 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-28  1:29 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375141699

Comment:
Need to properly install documentation for libcxx

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

* Re: [PR REVIEW] WIP: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (4 preceding siblings ...)
  2023-10-28  1:29 ` Calandracas606
@ 2023-10-28  1:29 ` Calandracas606
  2023-10-28  1:29 ` Calandracas606
                   ` (112 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-28  1:29 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375141549

Comment:
Reconsider having special logic for ppc?
 It complicates the template, is unmaintained, and untested

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

* Re: [PR REVIEW] WIP: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
  2023-10-28  1:20 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-10-28  1:29 ` Calandracas606
  2023-10-28  1:29 ` Calandracas606
                   ` (116 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-28  1:29 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375142076

Comment:
in llvm15, this line used ${version} so the path included the minor versions, however I've hard-coded it to be 17

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

* Re: [PR REVIEW] WIP: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (3 preceding siblings ...)
  2023-10-28  1:29 ` Calandracas606
@ 2023-10-28  1:29 ` Calandracas606
  2023-10-28  1:29 ` Calandracas606
                   ` (113 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-28  1:29 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375141956

Comment:
This refers to ompt-multiplex.h, however its also found in sr/lib/clang/17/include/

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

* Re: [PR REVIEW] WIP: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
  2023-10-28  1:20 ` [PR PATCH] [Updated] " Calandracas606
  2023-10-28  1:29 ` [PR REVIEW] " Calandracas606
@ 2023-10-28  1:29 ` Calandracas606
  2023-10-28  1:29 ` Calandracas606
                   ` (115 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-28  1:29 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375141720

Comment:
This didn't need to be done for llvm15

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

* Re: [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (6 preceding siblings ...)
  2023-10-28  1:29 ` Calandracas606
@ 2023-10-28 17:34 ` Calandracas606
  2023-10-28 22:20 ` [PR REVIEW] " mhmdanas
                   ` (110 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-28 17:34 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1783879520

Comment:
Cross compiling failing. Might be related to these:
https://discourse.llvm.org/t/when-i-cross-compile-the-mlir-llvm-min-tblgen-exec-format-error/70762
https://github.com/llvm/llvm-project/commit/95d4506dda79d

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (7 preceding siblings ...)
  2023-10-28 17:34 ` [WIP] " Calandracas606
@ 2023-10-28 22:20 ` mhmdanas
  2023-10-29 14:50 ` sh1r4s3
                   ` (109 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: mhmdanas @ 2023-10-28 22:20 UTC (permalink / raw)
  To: ml

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

New review comment by mhmdanas on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375328569

Comment:
You could just do `${version%%.*}` to get the major version number dynamically.

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (8 preceding siblings ...)
  2023-10-28 22:20 ` [PR REVIEW] " mhmdanas
@ 2023-10-29 14:50 ` sh1r4s3
  2023-10-29 14:53 ` sh1r4s3
                   ` (108 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: sh1r4s3 @ 2023-10-29 14:50 UTC (permalink / raw)
  To: ml

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

New review comment by sh1r4s3 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375451968

Comment:
I'm relatively new in void linux so don't beat me with keyboards pls :) Why do we want to drop `revision` here? I think it should be only incremental otherwise it could mess up with indices. If someone has llvm-15.0.7-1 and update the indices it would see the same name-version-revision package but with a different hash as well as the folks with 15.0.7-2 will get into trouble.

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (9 preceding siblings ...)
  2023-10-29 14:50 ` sh1r4s3
@ 2023-10-29 14:53 ` sh1r4s3
  2023-10-29 14:56 ` [PR PATCH] [Updated] " Calandracas606
                   ` (107 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: sh1r4s3 @ 2023-10-29 14:53 UTC (permalink / raw)
  To: ml

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

New review comment by sh1r4s3 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375452376

Comment:
It's seems that this patch, besides of adding musl triplets, actually remove one for ppcle arch though I think it doesn't matter since void doesn't have support of this arch anyway.

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (10 preceding siblings ...)
  2023-10-29 14:53 ` sh1r4s3
@ 2023-10-29 14:56 ` Calandracas606
  2023-10-29 14:57 ` [PR REVIEW] " Calandracas606
                   ` (106 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-29 14:56 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

This is still very WIP

**TODO**

- ompt-multiplex.h
- libunwind docs
- libcxx docs
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From 9526c6226a00ed0abea0fd2dfedc0490275aeebe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@airmail.cc>
Date: Fri, 27 Oct 2023 20:57:05 -0400
Subject: [PATCH] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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/libllvm17                             |   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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 ++
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 458 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 38 files changed, 947 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/libllvm17
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..41460e3167e60
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,458 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind
+ -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"
+depends="libllvm17>=${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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+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;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 libllvm17"
+
+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
+}
+
+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
+	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
+
+	# TODO: Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+		# TODO: Fix/find the docs
+#		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"
+		# TODO: Fix/find the docs
+#		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() {
+		# TODO Should this exist?
+#		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/17/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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/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] 120+ messages in thread

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (11 preceding siblings ...)
  2023-10-29 14:56 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-10-29 14:57 ` Calandracas606
  2023-10-29 15:00 ` Calandracas606
                   ` (105 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-29 14:57 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375453091

Comment:
Good catch, this is a mistake

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (12 preceding siblings ...)
  2023-10-29 14:57 ` [PR REVIEW] " Calandracas606
@ 2023-10-29 15:00 ` Calandracas606
  2023-10-29 15:05 ` Calandracas606
                   ` (104 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-29 15:00 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1375453524

Comment:
For the most part, the patches were copied from the llvm15 package. Upstream has done some work on ppc though, so some of void's ppc patches are no longer needed. 

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

* Re: [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (13 preceding siblings ...)
  2023-10-29 15:00 ` Calandracas606
@ 2023-10-29 15:05 ` Calandracas606
  2023-10-29 17:47 ` Calandracas606
                   ` (103 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-29 15:05 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1784138490

Comment:
Primary holdup currently is RISCV tablegen failing when crosscompiling. I think the problem is that the llvm-tblgen binary is properly compiled for the host arch, but the llvm-min-tblgen is being built for the target arch

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

* Re: [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (14 preceding siblings ...)
  2023-10-29 15:05 ` Calandracas606
@ 2023-10-29 17:47 ` Calandracas606
  2023-10-31  3:33 ` [PR PATCH] [Updated] " Calandracas606
                   ` (102 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-29 17:47 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1784180764

Comment:
> Primary holdup currently is RISCV tablegen failing when crosscompiling. I think the problem is that the llvm-tblgen binary is properly compiled for the host arch, but the llvm-min-tblgen is being built for the target arch

Actually, the llvm-min-tblgen found in NATIVE/bin/llvm-min-tblgen is being used, instead of the one HOST/bin/

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (15 preceding siblings ...)
  2023-10-29 17:47 ` Calandracas606
@ 2023-10-31  3:33 ` Calandracas606
  2023-10-31 14:48 ` Calandracas606
                   ` (101 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31  3:33 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

This is still very WIP

**TODO**

- ompt-multiplex.h
- libunwind docs
- libcxx docs
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From e69eb60e22ede0442e1aa0fc101cc15f4f027d13 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@airmail.cc>
Date: Fri, 27 Oct 2023 20:57:05 -0400
Subject: [PATCH] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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/libllvm17                             |   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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 ++
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 458 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 38 files changed, 947 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/libllvm17
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..41460e3167e60
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,458 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind
+ -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"
+depends="libllvm17>=${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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+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;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 libllvm17"
+
+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
+}
+
+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
+	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
+
+	# TODO: Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+		# TODO: Fix/find the docs
+#		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"
+		# TODO: Fix/find the docs
+#		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() {
+		# TODO Should this exist?
+#		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/17/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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/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] 120+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (16 preceding siblings ...)
  2023-10-31  3:33 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-10-31 14:48 ` Calandracas606
  2023-10-31 14:49 ` Calandracas606
                   ` (100 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31 14:48 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

This is still very WIP

**TODO**

- ompt-multiplex.h
- libunwind docs
- libcxx docs
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From 6f4791281819cf3e0b882a03235ff60be7d0cedf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@airmail.cc>
Date: Fri, 27 Oct 2023 20:57:05 -0400
Subject: [PATCH] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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/libllvm17                             |   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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 ++
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 458 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 38 files changed, 947 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/libllvm17
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..41460e3167e60
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,458 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind
+ -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"
+depends="libllvm17>=${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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+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;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 libllvm17"
+
+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
+}
+
+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
+	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
+
+	# TODO: Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+		# TODO: Fix/find the docs
+#		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"
+		# TODO: Fix/find the docs
+#		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() {
+		# TODO Should this exist?
+#		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/17/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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/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] 120+ messages in thread

* Re: [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (17 preceding siblings ...)
  2023-10-31 14:48 ` Calandracas606
@ 2023-10-31 14:49 ` Calandracas606
  2023-10-31 14:50 ` [PR PATCH] [Updated] " Calandracas606
                   ` (99 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31 14:49 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1787372376

Comment:
Cross compilation now working

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (18 preceding siblings ...)
  2023-10-31 14:49 ` Calandracas606
@ 2023-10-31 14:50 ` Calandracas606
  2023-10-31 14:52 ` [PR REVIEW] " Calandracas606
                   ` (98 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31 14:50 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

This is still very WIP

**TODO**

- ompt-multiplex.h
- libunwind docs
- libcxx docs
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From 64b4f96e33780d7eab48a057cc55f062ffe45a11 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@airmail.cc>
Date: Fri, 27 Oct 2023 20:57:05 -0400
Subject: [PATCH] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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/libllvm17                             |   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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 461 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 38 files changed, 950 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/libllvm17
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..b20fcda36086c
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,461 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind
+ -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 git"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel"
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+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;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 libllvm17"
+
+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
+}
+
+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
+		make ${makejobs} -C tools/llvm-config
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		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"
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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
+
+	# TODO: Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+		# TODO: Fix/find the docs
+#		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"
+		# TODO: Fix/find the docs
+#		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() {
+		# TODO Should this exist?
+#		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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/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] 120+ messages in thread

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (19 preceding siblings ...)
  2023-10-31 14:50 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-10-31 14:52 ` Calandracas606
  2023-10-31 14:52 ` Calandracas606
                   ` (97 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31 14:52 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1377719730

Comment:
LLDB_TABLEGEN_EXE needs to be set for cross. LLDB_TABLEGEN is probably not needed, but I will do further testing

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (20 preceding siblings ...)
  2023-10-31 14:52 ` [PR REVIEW] " Calandracas606
@ 2023-10-31 14:52 ` Calandracas606
  2023-10-31 19:17 ` [PR PATCH] [Updated] " Calandracas606
                   ` (96 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31 14:52 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1377718642

Comment:
llvm-config needed for cross

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (21 preceding siblings ...)
  2023-10-31 14:52 ` Calandracas606
@ 2023-10-31 19:17 ` Calandracas606
  2023-10-31 20:09 ` [PR REVIEW] " Calandracas606
                   ` (95 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31 19:17 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

This is still very WIP

**TODO**

- ompt-multiplex.h
- libunwind docs
- libcxx docs
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From 16f2dbe0bb0724ef1d5bb50ef8ec9223b6727704 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@airmail.cc>
Date: Fri, 27 Oct 2023 20:57:05 -0400
Subject: [PATCH] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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/libllvm17                             |   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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 461 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 38 files changed, 950 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/libllvm17
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..57142396642fa
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,461 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel ocaml ocaml-findlib lua53-devel"
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+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;lld;mlir;flang;polly;libclc;bolt"
+
+_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 libllvm17"
+
+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
+}
+
+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
+		make ${makejobs} -C tools/llvm-config
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		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"
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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
+
+	# TODO: Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+		# TODO: Fix/find the docs
+#		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"
+		# TODO: Fix/find the docs
+#		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() {
+		# TODO Should this exist?
+#		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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/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] 120+ messages in thread

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (24 preceding siblings ...)
  2023-10-31 20:09 ` Calandracas606
@ 2023-10-31 20:09 ` Calandracas606
  2023-11-02 15:37 ` [PR PATCH] [Updated] " Calandracas606
                   ` (92 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31 20:09 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1378067211

Comment:
Enabled flang, mlir (flang dependancy), polly, libclc, and bolt.

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (23 preceding siblings ...)
  2023-10-31 20:09 ` [PR REVIEW] " Calandracas606
@ 2023-10-31 20:09 ` Calandracas606
  2023-10-31 20:09 ` Calandracas606
                   ` (93 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31 20:09 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1378113509

Comment:
python3-sphinx-markdown-tables is a new package needed for flang documentation

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (22 preceding siblings ...)
  2023-10-31 19:17 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-10-31 20:09 ` Calandracas606
  2023-10-31 20:09 ` Calandracas606
                   ` (94 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-10-31 20:09 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1378112945

Comment:
added ocaml for ocaml bindings, and lua for lldb scripting.

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (25 preceding siblings ...)
  2023-10-31 20:09 ` Calandracas606
@ 2023-11-02 15:37 ` Calandracas606
  2023-11-03  2:53 ` Calandracas606
                   ` (91 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-02 15:37 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

This is still very WIP

**TODO**

- ompt-multiplex.h
- libunwind docs
- libcxx docs
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From 14f4ccd50735c7f30237089744eb14edfaa9a3ef Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@airmail.cc>
Date: Fri, 27 Oct 2023 20:57:05 -0400
Subject: [PATCH] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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/libllvm17                             |   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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 570 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 38 files changed, 1059 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/libllvm17
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..4709f06b4b266
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,570 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	hostmakedepends+=" ccache "
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;flang;polly;libclc;bolt"
+
+_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
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 flang-new flang-new-devel
+ mlir polly llvm-bolt "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+
+		configure_args+=" -DMLIR_PDLL_TABLEGEN_EXE=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# TODO: Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/mlir*"
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang-new_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-new-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang-new>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+polly_package() {
+	lib32disabled=yes
+	short_desc+=" - optimizations using a polyhedral model"
+	homepage="https://polly.llvm.org/"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libpolly*"
+		vmove usr/share/doc/LLVM/polly
+		vmove usr/include/polly
+		vmove "usr/lib/LLVMPolly*"
+		vmove usr/lib/cmake/polly
+		vmove "usr/lib/libPolly*"
+		vmove /usr/share/man/man1/polly.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+#TODO		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"
+#TODO		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() {
+		# TODO Should this exist?
+#		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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/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] 120+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (26 preceding siblings ...)
  2023-11-02 15:37 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-11-03  2:53 ` Calandracas606
  2023-11-03  2:59 ` [PR REVIEW] " Calandracas606
                   ` (90 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03  2:53 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc

This is still very WIP

**TODO**

- ompt-multiplex.h
- libunwind docs
- libcxx docs
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From a82593e6473ece99e70a98d587571a7ef45399d6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@airmail.cc>
Date: Fri, 27 Oct 2023 20:57:05 -0400
Subject: [PATCH] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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/libllvm17                             |   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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 577 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 38 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/libllvm17
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..c5ec49ba69a27
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,577 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;polly;libclc;bolt"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir polly llvm-bolt "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/mlir*"
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+polly_package() {
+	lib32disabled=yes
+	short_desc+=" - optimizations using a polyhedral model"
+	homepage="https://polly.llvm.org/"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/share/doc/LLVM/polly
+		vmove usr/include/polly
+		vmove "usr/lib/LLVMPolly*"
+		vmove usr/lib/cmake/polly
+		vmove "usr/lib/libPolly*"
+		vmove /usr/share/man/man1/polly.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/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] 120+ messages in thread

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (27 preceding siblings ...)
  2023-11-03  2:53 ` Calandracas606
@ 2023-11-03  2:59 ` Calandracas606
  2023-11-03  3:14 ` [PR PATCH] [Updated] " Calandracas606
                   ` (89 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03  2:59 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1381118853

Comment:
flang does not allow 32 bit, and explicitly supports only x86_64 and aarch64

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (28 preceding siblings ...)
  2023-11-03  2:59 ` [PR REVIEW] " Calandracas606
@ 2023-11-03  3:14 ` Calandracas606
  2023-11-03  3:18 ` Calandracas606
                   ` (88 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03  3:14 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

This is still very WIP

**TODO**

- ompt-multiplex.h
- ~libunwind docs~
- ~libcxx docs~
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From f9054cd12267b9cc5669fe0b761ee2624e06b7e5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 1/6] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 577 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1065 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..be6f12426a26a
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,577 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;polly;libclc;bolt"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir polly llvm-bolt "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/mlir*"
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+polly_package() {
+	lib32disabled=yes
+	short_desc+=" - optimizations using a polyhedral model"
+	homepage="https://polly.llvm.org/"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/share/doc/LLVM/polly
+		vmove usr/include/polly
+		vmove "usr/lib/LLVMPolly*"
+		vmove usr/lib/cmake/polly
+		vmove "usr/lib/libPolly*"
+		vmove /usr/share/man/man1/polly.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 7db55de81fbe279f61ce2830763f574dd26f749e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 2/6] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From d648ef5e0d309cb03d3fd7d8b62c278544c7c22f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 3/6] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 3dbf6654eb59395e7961ce850d6efd4491d5f668 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:12:04 -0400
Subject: [PATCH 4/6] New package: polly

---
 srcpkgs/polly | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/polly

diff --git a/srcpkgs/polly b/srcpkgs/polly
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/polly
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From bb3f594e33083feb5f5a39c3bc76768e0a1db51e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 5/6] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From a68e20d717b177dd1c65b1de6c11fe692d9bc97e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 6/6] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (29 preceding siblings ...)
  2023-11-03  3:14 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-11-03  3:18 ` Calandracas606
  2023-11-03 13:03 ` Calandracas606
                   ` (87 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03  3:18 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686 (cross)

This is still very WIP

**TODO**

- ompt-multiplex.h
- ~libunwind docs~
- ~libcxx docs~
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From f9054cd12267b9cc5669fe0b761ee2624e06b7e5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 1/7] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 577 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1065 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..be6f12426a26a
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,577 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;polly;libclc;bolt"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir polly llvm-bolt "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/mlir*"
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+polly_package() {
+	lib32disabled=yes
+	short_desc+=" - optimizations using a polyhedral model"
+	homepage="https://polly.llvm.org/"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/share/doc/LLVM/polly
+		vmove usr/include/polly
+		vmove "usr/lib/LLVMPolly*"
+		vmove usr/lib/cmake/polly
+		vmove "usr/lib/libPolly*"
+		vmove /usr/share/man/man1/polly.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 7db55de81fbe279f61ce2830763f574dd26f749e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 2/7] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From d648ef5e0d309cb03d3fd7d8b62c278544c7c22f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 3/7] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 3dbf6654eb59395e7961ce850d6efd4491d5f668 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:12:04 -0400
Subject: [PATCH 4/7] New package: polly

---
 srcpkgs/polly | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/polly

diff --git a/srcpkgs/polly b/srcpkgs/polly
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/polly
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From bb3f594e33083feb5f5a39c3bc76768e0a1db51e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 5/7] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From a68e20d717b177dd1c65b1de6c11fe692d9bc97e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 6/7] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From a8c1efc32d799202cbdb6bd420dddcda9a05ed5f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 7/7] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (30 preceding siblings ...)
  2023-11-03  3:18 ` Calandracas606
@ 2023-11-03 13:03 ` Calandracas606
  2023-11-03 15:11 ` Calandracas606
                   ` (86 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03 13:03 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686 (cross)
-- problems installing i686, only usr/lib32 is populated

This is still very WIP

**TODO**

- ompt-multiplex.h
- ~libunwind docs~
- ~libcxx docs~
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From f9054cd12267b9cc5669fe0b761ee2624e06b7e5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 1/8] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 577 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1065 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..be6f12426a26a
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,577 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;polly;libclc;bolt"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir polly llvm-bolt "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/mlir*"
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+polly_package() {
+	lib32disabled=yes
+	short_desc+=" - optimizations using a polyhedral model"
+	homepage="https://polly.llvm.org/"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/share/doc/LLVM/polly
+		vmove usr/include/polly
+		vmove "usr/lib/LLVMPolly*"
+		vmove usr/lib/cmake/polly
+		vmove "usr/lib/libPolly*"
+		vmove /usr/share/man/man1/polly.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 7db55de81fbe279f61ce2830763f574dd26f749e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 2/8] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From d648ef5e0d309cb03d3fd7d8b62c278544c7c22f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 3/8] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 3dbf6654eb59395e7961ce850d6efd4491d5f668 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:12:04 -0400
Subject: [PATCH 4/8] New package: polly

---
 srcpkgs/polly | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/polly

diff --git a/srcpkgs/polly b/srcpkgs/polly
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/polly
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From bb3f594e33083feb5f5a39c3bc76768e0a1db51e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 5/8] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From a68e20d717b177dd1c65b1de6c11fe692d9bc97e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 6/8] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From a8c1efc32d799202cbdb6bd420dddcda9a05ed5f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 7/8] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 7a48db08bbc58795e72d062350c6d566fdcfefba Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 8/8] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (31 preceding siblings ...)
  2023-11-03 13:03 ` Calandracas606
@ 2023-11-03 15:11 ` Calandracas606
  2023-11-03 19:18 ` [PR REVIEW] " Calandracas606
                   ` (85 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03 15:11 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686 (cross)
-- problems installing i686, only usr/lib32 is populated

This is still very WIP

**TODO**

- ompt-multiplex.h
- ~libunwind docs~
- ~libcxx docs~
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From 2312c5f5e2792b683fcc1715ca966ecbbf7ed6b9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 1/9] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 578 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 67e0812c68e19..b159cec4996af 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..5bc3086b347ec
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,578 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;bolt"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir llvm-bolt "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+#polly_package() {
+#	lib32disabled=yes
+#	short_desc+=" - optimizations using a polyhedral model"
+#	homepage="https://polly.llvm.org/"
+#	depends="clang>=${version}_${revision}"
+#	pkg_install() {
+#		vmove usr/share/doc/LLVM/polly
+#		vmove usr/include/polly
+#		vmove "usr/lib/LLVMPolly*"
+#		vmove usr/lib/cmake/polly
+#		vmove "usr/lib/libPolly*"
+#		vmove /usr/share/man/man1/polly.1
+#	}
+#}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 2e894f7c616aecec5658382eaca8bc5480272eb2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 2/9] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From f2586b2963f6dd63cedf57a8ecf7c5aaf94dbc66 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 3/9] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 1d9d148a183d69b35572eb9b670456344674a087 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 4/9] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 72e07436b3a122223f889d77de5e0acb3a7faccf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 5/9] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From acda7005f4e674d2c454f1c49e351847cdcc7282 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 6/9] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 6020996d557387c91d3f3a44a5a8916120e38e9b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 7/9] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 08888130cb4ee1a4d695aae44afe17c28e0ce767 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 8/9] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 41fda057eceed93db32ea349b5cae260444e5c8e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 9/9] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (33 preceding siblings ...)
  2023-11-03 19:18 ` [PR REVIEW] " Calandracas606
@ 2023-11-03 19:18 ` Calandracas606
  2023-11-03 20:48 ` [PR PATCH] [Updated] " Calandracas606
                   ` (83 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03 19:18 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1382114774

Comment:
Will need some testing of the mesa patch

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (32 preceding siblings ...)
  2023-11-03 15:11 ` Calandracas606
@ 2023-11-03 19:18 ` Calandracas606
  2023-11-03 19:18 ` Calandracas606
                   ` (84 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03 19:18 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1382115045

Comment:
Needed update for llvm17 support

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (34 preceding siblings ...)
  2023-11-03 19:18 ` Calandracas606
@ 2023-11-03 20:48 ` Calandracas606
  2023-11-03 21:49 ` Calandracas606
                   ` (82 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03 20:48 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686 (cross)
-- problems installing i686, only usr/lib32 is populated

This is still very WIP

**TODO**

- ompt-multiplex.h
- ~libunwind docs~
- ~libcxx docs~
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From a03d92088bfa0fa40e67d27161ca6f3faa3248ab Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/13] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 578 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 9036a675c1ae5..75c6c79d4e427 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..5bc3086b347ec
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,578 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;bolt"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir llvm-bolt "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+#polly_package() {
+#	lib32disabled=yes
+#	short_desc+=" - optimizations using a polyhedral model"
+#	homepage="https://polly.llvm.org/"
+#	depends="clang>=${version}_${revision}"
+#	pkg_install() {
+#		vmove usr/share/doc/LLVM/polly
+#		vmove usr/include/polly
+#		vmove "usr/lib/LLVMPolly*"
+#		vmove usr/lib/cmake/polly
+#		vmove "usr/lib/libPolly*"
+#		vmove /usr/share/man/man1/polly.1
+#	}
+#}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 5ef817640fe1eff552fb5cee1ca4d562590615a3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 02/13] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 832434be52551f5462974cdab53fe7b33fecd19e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 03/13] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From a8fcfcbf6d6b325b82cb4f969d2356a0c6ad6a81 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 04/13] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 2cf65bfc7b6be4880f75b5c93507b8551986083f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 05/13] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 0ae5ba31cce630e10e789a0c14fdc62d451fd9d9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 06/13] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 0ecf0270cc6c2f0ef8ed8fc0799257651c8c0c65 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 07/13] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 9f3251c87e5e8f891e4099c788c2327b64124aff Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 08/13] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 4c10e9759aa9a8fb08df036155d3a0cf4863423d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 09/13] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From dca89f42b1bd4812542b1b6fb54478147de9607a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 10/13] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 6a280baa0c284..427e6839a7e25 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,7 +1,7 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
 version=2022.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
  -DSPIRV-Headers_SOURCE_DIR=${XBPS_CROSS_BASE}/usr"

From d304390ef6ad3cbb7c175e7fc8075bfc96de8e38 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 11/13] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 75c6c79d4e427..4864dfe8684b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -988,7 +988,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 7d4c428ed4ab54d8cd62ad49375143f9bede0aaa Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 12/13] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 8bb7d5f8b1ae2..4d0881ceb374a 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 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
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From a14833834103a74949cfde0e4145ff459d0a46a1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 13/13] mesa: rebuild for llvm17

---
 srcpkgs/mesa/patches/gallium-llvm17.patch | 119 ++++++++++++++++++++++
 srcpkgs/mesa/template                     |   5 +-
 2 files changed, 121 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/mesa/patches/gallium-llvm17.patch

diff --git a/srcpkgs/mesa/patches/gallium-llvm17.patch b/srcpkgs/mesa/patches/gallium-llvm17.patch
new file mode 100644
index 0000000000000..4a982bbd822a9
--- /dev/null
+++ b/srcpkgs/mesa/patches/gallium-llvm17.patch
@@ -0,0 +1,119 @@
+commit 2d4fe5f229791fde52846b3f583c12508b5109d6
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Fri Aug 25 12:43:44 2023 +1000
+
+    clover/llvm: move to modern pass manager.
+    
+    This seems like it should work, but I haven't tested it yet.
+    
+    Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
+    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
+
+diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
+index 7a50fea3323..43d26fe1abb 100644
+--- a/src/gallium/frontends/clover/llvm/invocation.cpp
++++ b/src/gallium/frontends/clover/llvm/invocation.cpp
+@@ -27,13 +27,17 @@
+ #include <llvm/IR/DiagnosticPrinter.h>
+ #include <llvm/IR/DiagnosticInfo.h>
+ #include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
+ #include <llvm/Support/raw_ostream.h>
+-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
++#include <llvm/Transforms/IPO/Internalize.h>
+ #include <llvm-c/Target.h>
+ #ifdef HAVE_CLOVER_SPIRV
+ #include <LLVMSPIRVLib/LLVMSPIRVLib.h>
+ #endif
+ 
++#include <llvm-c/TargetMachine.h>
++#include <llvm-c/Transforms/PassBuilder.h>
++#include <llvm/Support/CBindingWrapping.h>
+ #include <clang/CodeGen/CodeGenAction.h>
+ #include <clang/Lex/PreprocessorOptions.h>
+ #include <clang/Frontend/TextDiagnosticBuffer.h>
+@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
+ 
+ namespace {
+    void
+-   optimize(Module &mod, unsigned optimization_level,
++   optimize(Module &mod,
++            const std::string& ir_target,
++            unsigned optimization_level,
+             bool internalize_symbols) {
+-      ::llvm::legacy::PassManager pm;
+-
+       // By default, the function internalizer pass will look for a function
+       // called "main" and then mark all other functions as internal.  Marking
+       // functions as internal enables the optimizer to perform optimizations
+@@ -458,19 +462,53 @@ namespace {
+       if (internalize_symbols) {
+          std::vector<std::string> names =
+             map(std::mem_fn(&Function::getName), get_kernels(mod));
+-         pm.add(::llvm::createInternalizePass(
++         internalizeModule(mod,
+                       [=](const ::llvm::GlobalValue &gv) {
+                          return std::find(names.begin(), names.end(),
+                                           gv.getName()) != names.end();
+-                      }));
++                      });
+       }
+ 
+-      ::llvm::PassManagerBuilder pmb;
+-      pmb.OptLevel = optimization_level;
+-      pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
+-         ::llvm::Triple(mod.getTargetTriple()));
+-      pmb.populateModulePassManager(pm);
+-      pm.run(mod);
++
++      const char *opt_str = NULL;
++      LLVMCodeGenOptLevel level;
++      switch (optimization_level) {
++      case 0:
++      default:
++         opt_str = "default<O0>";
++         level = LLVMCodeGenLevelNone;
++         break;
++      case 1:
++         opt_str = "default<O1>";
++         level = LLVMCodeGenLevelLess;
++         break;
++      case 2:
++         opt_str = "default<O2>";
++         level = LLVMCodeGenLevelDefault;
++         break;
++      case 3:
++         opt_str = "default<O3>";
++         level = LLVMCodeGenLevelAggressive;
++         break;
++      }
++
++      const target &target = ir_target;
++      LLVMTargetRef targ;
++      char *err_message;
++
++      if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
++         return;
++      LLVMTargetMachineRef tm =
++         LLVMCreateTargetMachine(targ, target.triple.c_str(),
++                                 target.cpu.c_str(), "", level,
++                                 LLVMRelocDefault, LLVMCodeModelDefault);
++
++      if (!tm)
++         return;
++      LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
++      LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
++
++      LLVMDisposeTargetMachine(tm);
+    }
+ 
+    std::unique_ptr<Module>
+@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
+    auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
+    auto mod = link(*ctx, *c, binaries, r_log);
+ 
+-   optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
++   optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
+ 
+    static std::atomic_uint seq(0);
+    const std::string id = "." + mod->getModuleIdentifier() + "-" +
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index f36ebe5938041..92c9f85c7971f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.2.1
-revision=2
+revision=3
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
@@ -25,8 +25,7 @@ changelog="https://docs.mesa3d.org/relnotes.html"
 distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
 checksum=64de0616fc2d801f929ab1ac2a4f16b3e2783c4309a724c8a259b20df8bbc1cc
 
-build_options="wayland"
-build_options_default="wayland"
+build_options="wayland" build_options_default="wayland"
 
 # only use llvmpipe on targets where it's supported and reliable
 # especially on big endian it's all kinds of broken, and e.g. on

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (35 preceding siblings ...)
  2023-11-03 20:48 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-11-03 21:49 ` Calandracas606
  2023-11-03 22:51 ` Calandracas606
                   ` (81 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03 21:49 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686 (cross)
-- problems installing i686, only usr/lib32 is populated

This is still very WIP

**TODO**

- ompt-multiplex.h
- ~libunwind docs~
- ~libcxx docs~
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From a03d92088bfa0fa40e67d27161ca6f3faa3248ab Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/16] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 578 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 9036a675c1ae5..75c6c79d4e427 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..5bc3086b347ec
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,578 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;bolt"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir llvm-bolt "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+#polly_package() {
+#	lib32disabled=yes
+#	short_desc+=" - optimizations using a polyhedral model"
+#	homepage="https://polly.llvm.org/"
+#	depends="clang>=${version}_${revision}"
+#	pkg_install() {
+#		vmove usr/share/doc/LLVM/polly
+#		vmove usr/include/polly
+#		vmove "usr/lib/LLVMPolly*"
+#		vmove usr/lib/cmake/polly
+#		vmove "usr/lib/libPolly*"
+#		vmove /usr/share/man/man1/polly.1
+#	}
+#}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 5ef817640fe1eff552fb5cee1ca4d562590615a3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 02/16] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 832434be52551f5462974cdab53fe7b33fecd19e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 03/16] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From a8fcfcbf6d6b325b82cb4f969d2356a0c6ad6a81 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 04/16] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 2cf65bfc7b6be4880f75b5c93507b8551986083f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 05/16] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 0ae5ba31cce630e10e789a0c14fdc62d451fd9d9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 06/16] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 0ecf0270cc6c2f0ef8ed8fc0799257651c8c0c65 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 07/16] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 9f3251c87e5e8f891e4099c788c2327b64124aff Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 08/16] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 4c10e9759aa9a8fb08df036155d3a0cf4863423d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 09/16] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From dca89f42b1bd4812542b1b6fb54478147de9607a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 10/16] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 6a280baa0c284..427e6839a7e25 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,7 +1,7 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
 version=2022.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
  -DSPIRV-Headers_SOURCE_DIR=${XBPS_CROSS_BASE}/usr"

From d304390ef6ad3cbb7c175e7fc8075bfc96de8e38 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 11/16] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 75c6c79d4e427..4864dfe8684b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -988,7 +988,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 7d4c428ed4ab54d8cd62ad49375143f9bede0aaa Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 12/16] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 8bb7d5f8b1ae2..4d0881ceb374a 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 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
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From a14833834103a74949cfde0e4145ff459d0a46a1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 13/16] mesa: rebuild for llvm17

---
 srcpkgs/mesa/patches/gallium-llvm17.patch | 119 ++++++++++++++++++++++
 srcpkgs/mesa/template                     |   5 +-
 2 files changed, 121 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/mesa/patches/gallium-llvm17.patch

diff --git a/srcpkgs/mesa/patches/gallium-llvm17.patch b/srcpkgs/mesa/patches/gallium-llvm17.patch
new file mode 100644
index 0000000000000..4a982bbd822a9
--- /dev/null
+++ b/srcpkgs/mesa/patches/gallium-llvm17.patch
@@ -0,0 +1,119 @@
+commit 2d4fe5f229791fde52846b3f583c12508b5109d6
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Fri Aug 25 12:43:44 2023 +1000
+
+    clover/llvm: move to modern pass manager.
+    
+    This seems like it should work, but I haven't tested it yet.
+    
+    Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
+    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
+
+diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
+index 7a50fea3323..43d26fe1abb 100644
+--- a/src/gallium/frontends/clover/llvm/invocation.cpp
++++ b/src/gallium/frontends/clover/llvm/invocation.cpp
+@@ -27,13 +27,17 @@
+ #include <llvm/IR/DiagnosticPrinter.h>
+ #include <llvm/IR/DiagnosticInfo.h>
+ #include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
+ #include <llvm/Support/raw_ostream.h>
+-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
++#include <llvm/Transforms/IPO/Internalize.h>
+ #include <llvm-c/Target.h>
+ #ifdef HAVE_CLOVER_SPIRV
+ #include <LLVMSPIRVLib/LLVMSPIRVLib.h>
+ #endif
+ 
++#include <llvm-c/TargetMachine.h>
++#include <llvm-c/Transforms/PassBuilder.h>
++#include <llvm/Support/CBindingWrapping.h>
+ #include <clang/CodeGen/CodeGenAction.h>
+ #include <clang/Lex/PreprocessorOptions.h>
+ #include <clang/Frontend/TextDiagnosticBuffer.h>
+@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
+ 
+ namespace {
+    void
+-   optimize(Module &mod, unsigned optimization_level,
++   optimize(Module &mod,
++            const std::string& ir_target,
++            unsigned optimization_level,
+             bool internalize_symbols) {
+-      ::llvm::legacy::PassManager pm;
+-
+       // By default, the function internalizer pass will look for a function
+       // called "main" and then mark all other functions as internal.  Marking
+       // functions as internal enables the optimizer to perform optimizations
+@@ -458,19 +462,53 @@ namespace {
+       if (internalize_symbols) {
+          std::vector<std::string> names =
+             map(std::mem_fn(&Function::getName), get_kernels(mod));
+-         pm.add(::llvm::createInternalizePass(
++         internalizeModule(mod,
+                       [=](const ::llvm::GlobalValue &gv) {
+                          return std::find(names.begin(), names.end(),
+                                           gv.getName()) != names.end();
+-                      }));
++                      });
+       }
+ 
+-      ::llvm::PassManagerBuilder pmb;
+-      pmb.OptLevel = optimization_level;
+-      pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
+-         ::llvm::Triple(mod.getTargetTriple()));
+-      pmb.populateModulePassManager(pm);
+-      pm.run(mod);
++
++      const char *opt_str = NULL;
++      LLVMCodeGenOptLevel level;
++      switch (optimization_level) {
++      case 0:
++      default:
++         opt_str = "default<O0>";
++         level = LLVMCodeGenLevelNone;
++         break;
++      case 1:
++         opt_str = "default<O1>";
++         level = LLVMCodeGenLevelLess;
++         break;
++      case 2:
++         opt_str = "default<O2>";
++         level = LLVMCodeGenLevelDefault;
++         break;
++      case 3:
++         opt_str = "default<O3>";
++         level = LLVMCodeGenLevelAggressive;
++         break;
++      }
++
++      const target &target = ir_target;
++      LLVMTargetRef targ;
++      char *err_message;
++
++      if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
++         return;
++      LLVMTargetMachineRef tm =
++         LLVMCreateTargetMachine(targ, target.triple.c_str(),
++                                 target.cpu.c_str(), "", level,
++                                 LLVMRelocDefault, LLVMCodeModelDefault);
++
++      if (!tm)
++         return;
++      LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
++      LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
++
++      LLVMDisposeTargetMachine(tm);
+    }
+ 
+    std::unique_ptr<Module>
+@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
+    auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
+    auto mod = link(*ctx, *c, binaries, r_log);
+ 
+-   optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
++   optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
+ 
+    static std::atomic_uint seq(0);
+    const std::string id = "." + mod->getModuleIdentifier() + "-" +
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index f36ebe5938041..92c9f85c7971f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.2.1
-revision=2
+revision=3
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
@@ -25,8 +25,7 @@ changelog="https://docs.mesa3d.org/relnotes.html"
 distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
 checksum=64de0616fc2d801f929ab1ac2a4f16b3e2783c4309a724c8a259b20df8bbc1cc
 
-build_options="wayland"
-build_options_default="wayland"
+build_options="wayland" build_options_default="wayland"
 
 # only use llvmpipe on targets where it's supported and reliable
 # especially on big endian it's all kinds of broken, and e.g. on

From 750961b2db801fcae3bc0988847219efa2394ba0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:49:47 -0400
Subject: [PATCH 14/16] qt5: rebuild for llvm17

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index b6612dffeb1b9..f879df3a3e706 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=7
+revision=8
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python3 re2c ruby which"

From e4b623daa777e4881a13470d3ae9d1ce350d878d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 15/16] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 1b1cc595b6f147871cc5470a6f6ee910dfe0a108 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 16/16] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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"

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (36 preceding siblings ...)
  2023-11-03 21:49 ` Calandracas606
@ 2023-11-03 22:51 ` Calandracas606
  2023-11-04  2:04 ` Calandracas606
                   ` (80 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-03 22:51 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686 (cross)
-- problems installing i686, only usr/lib32 is populated

This is still very WIP

**TODO**

- ompt-multiplex.h
- ~libunwind docs~
- ~libcxx docs~
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From feaea2b639faede63ace034ae037c9a47812c4ca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/17] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 563 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1051 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 9036a675c1ae5..75c6c79d4e427 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..2516daaf6a5ac
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,563 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;bolt;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir llvm-bolt"
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 730560bbb8ddfc65c783b95c8003a4b5c110ef18 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 02/17] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From c5d14b718f560dacfbf8b41c36468fb1e4c253ee Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 03/17] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 7ee832a6a24370cd6d856275d2a269766a405bbb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 04/17] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From e60f2a3b76df74bb642b72a0f31c6520770da934 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 05/17] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 313559fbbae91ea595bc49b53455f758473b189c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 06/17] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From bd2378d78b1310011de29d7d282d961266edccbb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 07/17] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From d1fa859d4041cc9c943ab08db67de39ce43b0c8f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 08/17] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 512a63cc13dae29a86c909b84da0d6dc886e1f67 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 09/17] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 4e6ed4c1098407907e608839d49a55089c7c8bc8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 10/17] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 6a280baa0c284..427e6839a7e25 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,7 +1,7 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
 version=2022.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
  -DSPIRV-Headers_SOURCE_DIR=${XBPS_CROSS_BASE}/usr"

From 9837f0c327f6b0db0e55f16137883f339fd0b70b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 11/17] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 75c6c79d4e427..4864dfe8684b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -988,7 +988,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 9099c1f86d1911931f5c6fd84adc8832cc9bfe5e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 12/17] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 8bb7d5f8b1ae2..4d0881ceb374a 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 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
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 229ea926b4d7d94f1c130bd58fea1a5dd8fd3981 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 13/17] mesa: rebuild for llvm17

---
 srcpkgs/mesa/patches/gallium-llvm17.patch | 119 ++++++++++++++++++++++
 srcpkgs/mesa/template                     |   2 +-
 2 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mesa/patches/gallium-llvm17.patch

diff --git a/srcpkgs/mesa/patches/gallium-llvm17.patch b/srcpkgs/mesa/patches/gallium-llvm17.patch
new file mode 100644
index 0000000000000..4a982bbd822a9
--- /dev/null
+++ b/srcpkgs/mesa/patches/gallium-llvm17.patch
@@ -0,0 +1,119 @@
+commit 2d4fe5f229791fde52846b3f583c12508b5109d6
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Fri Aug 25 12:43:44 2023 +1000
+
+    clover/llvm: move to modern pass manager.
+    
+    This seems like it should work, but I haven't tested it yet.
+    
+    Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
+    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
+
+diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
+index 7a50fea3323..43d26fe1abb 100644
+--- a/src/gallium/frontends/clover/llvm/invocation.cpp
++++ b/src/gallium/frontends/clover/llvm/invocation.cpp
+@@ -27,13 +27,17 @@
+ #include <llvm/IR/DiagnosticPrinter.h>
+ #include <llvm/IR/DiagnosticInfo.h>
+ #include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
+ #include <llvm/Support/raw_ostream.h>
+-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
++#include <llvm/Transforms/IPO/Internalize.h>
+ #include <llvm-c/Target.h>
+ #ifdef HAVE_CLOVER_SPIRV
+ #include <LLVMSPIRVLib/LLVMSPIRVLib.h>
+ #endif
+ 
++#include <llvm-c/TargetMachine.h>
++#include <llvm-c/Transforms/PassBuilder.h>
++#include <llvm/Support/CBindingWrapping.h>
+ #include <clang/CodeGen/CodeGenAction.h>
+ #include <clang/Lex/PreprocessorOptions.h>
+ #include <clang/Frontend/TextDiagnosticBuffer.h>
+@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
+ 
+ namespace {
+    void
+-   optimize(Module &mod, unsigned optimization_level,
++   optimize(Module &mod,
++            const std::string& ir_target,
++            unsigned optimization_level,
+             bool internalize_symbols) {
+-      ::llvm::legacy::PassManager pm;
+-
+       // By default, the function internalizer pass will look for a function
+       // called "main" and then mark all other functions as internal.  Marking
+       // functions as internal enables the optimizer to perform optimizations
+@@ -458,19 +462,53 @@ namespace {
+       if (internalize_symbols) {
+          std::vector<std::string> names =
+             map(std::mem_fn(&Function::getName), get_kernels(mod));
+-         pm.add(::llvm::createInternalizePass(
++         internalizeModule(mod,
+                       [=](const ::llvm::GlobalValue &gv) {
+                          return std::find(names.begin(), names.end(),
+                                           gv.getName()) != names.end();
+-                      }));
++                      });
+       }
+ 
+-      ::llvm::PassManagerBuilder pmb;
+-      pmb.OptLevel = optimization_level;
+-      pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
+-         ::llvm::Triple(mod.getTargetTriple()));
+-      pmb.populateModulePassManager(pm);
+-      pm.run(mod);
++
++      const char *opt_str = NULL;
++      LLVMCodeGenOptLevel level;
++      switch (optimization_level) {
++      case 0:
++      default:
++         opt_str = "default<O0>";
++         level = LLVMCodeGenLevelNone;
++         break;
++      case 1:
++         opt_str = "default<O1>";
++         level = LLVMCodeGenLevelLess;
++         break;
++      case 2:
++         opt_str = "default<O2>";
++         level = LLVMCodeGenLevelDefault;
++         break;
++      case 3:
++         opt_str = "default<O3>";
++         level = LLVMCodeGenLevelAggressive;
++         break;
++      }
++
++      const target &target = ir_target;
++      LLVMTargetRef targ;
++      char *err_message;
++
++      if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
++         return;
++      LLVMTargetMachineRef tm =
++         LLVMCreateTargetMachine(targ, target.triple.c_str(),
++                                 target.cpu.c_str(), "", level,
++                                 LLVMRelocDefault, LLVMCodeModelDefault);
++
++      if (!tm)
++         return;
++      LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
++      LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
++
++      LLVMDisposeTargetMachine(tm);
+    }
+ 
+    std::unique_ptr<Module>
+@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
+    auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
+    auto mod = link(*ctx, *c, binaries, r_log);
+ 
+-   optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
++   optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
+ 
+    static std::atomic_uint seq(0);
+    const std::string id = "." + mod->getModuleIdentifier() + "-" +
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index f36ebe5938041..534e140ee6052 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.2.1
-revision=2
+revision=3
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From f7ebc1c73efd8b4347fe433a901b8a682b201403 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:49:47 -0400
Subject: [PATCH 14/17] qt5: rebuild for llvm17

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index b6612dffeb1b9..f879df3a3e706 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=7
+revision=8
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python3 re2c ruby which"

From 25be585d4793d02fed2f41e583f0c256ed0829de Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 15/17] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 87c6a52ed823cc61e278eacd43693a74fc4290e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 16/17] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 b5012e95f8021336c3b3d79330e6b4b76dff437a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 17/17] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (37 preceding siblings ...)
  2023-11-03 22:51 ` Calandracas606
@ 2023-11-04  2:04 ` Calandracas606
  2023-11-04  2:20 ` [PR REVIEW] " Calandracas606
                   ` (79 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-04  2:04 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686 (cross)
-- problems installing i686, only usr/lib32 is populated

This is still very WIP

**TODO**

- ompt-multiplex.h
- ~libunwind docs~
- ~libcxx docs~
- remove sub-packages from llvm15
- rev bump packages with llvm dependencies

[ci skip]

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

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

From feaea2b639faede63ace034ae037c9a47812c4ca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/29] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 563 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1051 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 9036a675c1ae5..75c6c79d4e427 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..2516daaf6a5ac
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,563 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;bolt;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir llvm-bolt"
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 730560bbb8ddfc65c783b95c8003a4b5c110ef18 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 02/29] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From c5d14b718f560dacfbf8b41c36468fb1e4c253ee Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 03/29] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 7ee832a6a24370cd6d856275d2a269766a405bbb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 04/29] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From e60f2a3b76df74bb642b72a0f31c6520770da934 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 05/29] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 313559fbbae91ea595bc49b53455f758473b189c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 06/29] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From bd2378d78b1310011de29d7d282d961266edccbb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 07/29] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From d1fa859d4041cc9c943ab08db67de39ce43b0c8f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 08/29] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 512a63cc13dae29a86c909b84da0d6dc886e1f67 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 09/29] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 4e6ed4c1098407907e608839d49a55089c7c8bc8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 10/29] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 6a280baa0c284..427e6839a7e25 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,7 +1,7 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
 version=2022.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
  -DSPIRV-Headers_SOURCE_DIR=${XBPS_CROSS_BASE}/usr"

From 9837f0c327f6b0db0e55f16137883f339fd0b70b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 11/29] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 75c6c79d4e427..4864dfe8684b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -988,7 +988,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 9099c1f86d1911931f5c6fd84adc8832cc9bfe5e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 12/29] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 8bb7d5f8b1ae2..4d0881ceb374a 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 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
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 229ea926b4d7d94f1c130bd58fea1a5dd8fd3981 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 13/29] mesa: rebuild for llvm17

---
 srcpkgs/mesa/patches/gallium-llvm17.patch | 119 ++++++++++++++++++++++
 srcpkgs/mesa/template                     |   2 +-
 2 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mesa/patches/gallium-llvm17.patch

diff --git a/srcpkgs/mesa/patches/gallium-llvm17.patch b/srcpkgs/mesa/patches/gallium-llvm17.patch
new file mode 100644
index 0000000000000..4a982bbd822a9
--- /dev/null
+++ b/srcpkgs/mesa/patches/gallium-llvm17.patch
@@ -0,0 +1,119 @@
+commit 2d4fe5f229791fde52846b3f583c12508b5109d6
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Fri Aug 25 12:43:44 2023 +1000
+
+    clover/llvm: move to modern pass manager.
+    
+    This seems like it should work, but I haven't tested it yet.
+    
+    Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
+    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
+
+diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
+index 7a50fea3323..43d26fe1abb 100644
+--- a/src/gallium/frontends/clover/llvm/invocation.cpp
++++ b/src/gallium/frontends/clover/llvm/invocation.cpp
+@@ -27,13 +27,17 @@
+ #include <llvm/IR/DiagnosticPrinter.h>
+ #include <llvm/IR/DiagnosticInfo.h>
+ #include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
+ #include <llvm/Support/raw_ostream.h>
+-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
++#include <llvm/Transforms/IPO/Internalize.h>
+ #include <llvm-c/Target.h>
+ #ifdef HAVE_CLOVER_SPIRV
+ #include <LLVMSPIRVLib/LLVMSPIRVLib.h>
+ #endif
+ 
++#include <llvm-c/TargetMachine.h>
++#include <llvm-c/Transforms/PassBuilder.h>
++#include <llvm/Support/CBindingWrapping.h>
+ #include <clang/CodeGen/CodeGenAction.h>
+ #include <clang/Lex/PreprocessorOptions.h>
+ #include <clang/Frontend/TextDiagnosticBuffer.h>
+@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
+ 
+ namespace {
+    void
+-   optimize(Module &mod, unsigned optimization_level,
++   optimize(Module &mod,
++            const std::string& ir_target,
++            unsigned optimization_level,
+             bool internalize_symbols) {
+-      ::llvm::legacy::PassManager pm;
+-
+       // By default, the function internalizer pass will look for a function
+       // called "main" and then mark all other functions as internal.  Marking
+       // functions as internal enables the optimizer to perform optimizations
+@@ -458,19 +462,53 @@ namespace {
+       if (internalize_symbols) {
+          std::vector<std::string> names =
+             map(std::mem_fn(&Function::getName), get_kernels(mod));
+-         pm.add(::llvm::createInternalizePass(
++         internalizeModule(mod,
+                       [=](const ::llvm::GlobalValue &gv) {
+                          return std::find(names.begin(), names.end(),
+                                           gv.getName()) != names.end();
+-                      }));
++                      });
+       }
+ 
+-      ::llvm::PassManagerBuilder pmb;
+-      pmb.OptLevel = optimization_level;
+-      pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
+-         ::llvm::Triple(mod.getTargetTriple()));
+-      pmb.populateModulePassManager(pm);
+-      pm.run(mod);
++
++      const char *opt_str = NULL;
++      LLVMCodeGenOptLevel level;
++      switch (optimization_level) {
++      case 0:
++      default:
++         opt_str = "default<O0>";
++         level = LLVMCodeGenLevelNone;
++         break;
++      case 1:
++         opt_str = "default<O1>";
++         level = LLVMCodeGenLevelLess;
++         break;
++      case 2:
++         opt_str = "default<O2>";
++         level = LLVMCodeGenLevelDefault;
++         break;
++      case 3:
++         opt_str = "default<O3>";
++         level = LLVMCodeGenLevelAggressive;
++         break;
++      }
++
++      const target &target = ir_target;
++      LLVMTargetRef targ;
++      char *err_message;
++
++      if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
++         return;
++      LLVMTargetMachineRef tm =
++         LLVMCreateTargetMachine(targ, target.triple.c_str(),
++                                 target.cpu.c_str(), "", level,
++                                 LLVMRelocDefault, LLVMCodeModelDefault);
++
++      if (!tm)
++         return;
++      LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
++      LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
++
++      LLVMDisposeTargetMachine(tm);
+    }
+ 
+    std::unique_ptr<Module>
+@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
+    auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
+    auto mod = link(*ctx, *c, binaries, r_log);
+ 
+-   optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
++   optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
+ 
+    static std::atomic_uint seq(0);
+    const std::string id = "." + mod->getModuleIdentifier() + "-" +
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index f36ebe5938041..534e140ee6052 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.2.1
-revision=2
+revision=3
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From f7ebc1c73efd8b4347fe433a901b8a682b201403 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:49:47 -0400
Subject: [PATCH 14/29] qt5: rebuild for llvm17

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index b6612dffeb1b9..f879df3a3e706 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=7
+revision=8
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python3 re2c ruby which"

From 25be585d4793d02fed2f41e583f0c256ed0829de Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 15/29] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 87c6a52ed823cc61e278eacd43693a74fc4290e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 16/29] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 b5012e95f8021336c3b3d79330e6b4b76dff437a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 17/29] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 1d171a2dff96d8ef1eccb558221e7e5fc9376357 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 18/29] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 5f6e4e11d84212ad11359bb016f0ed6347353f64 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 19/29] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 94ad7317ac8e7622a7f0440bc5ed60c3a95ee8bb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 20/29] juCi++: rebuild for llvm17

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

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

From ed7232ebd16299fdc3292693f6b606cc3f8790fa Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 21/29] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 4864dfe8684b9..df9288d637ef1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2619,22 +2619,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 23e0d8c3daa6ad11b636fa6a231ca3d6a2713d4c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 22/29] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From 389f1fd781ff3d9c5b3bc6c997b9bf5eb81b9317 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 23/29] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From b85da7566cbeb4116cae4a94a43b7f0c0cb87c68 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 24/29] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 308b2881c6ffcefe4690fe9331b040af5c36efdc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 25/29] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 061df5ccd716ad5156d36ac5ebc92c4d0946a0cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 26/29] rtags: rebuild for llvm17

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

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

From ec31c8c9443a1b1b2bce6b1dcdd1f98a65453dbb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 27/29] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 84671eef960a8da2993164486c9879ca1faf5e0e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 28/29] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 71864a1d48d10d5626ce168928d355687b5e31ec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 29/29] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (38 preceding siblings ...)
  2023-11-04  2:04 ` Calandracas606
@ 2023-11-04  2:20 ` Calandracas606
  2023-11-04  2:23 ` Calandracas606
                   ` (78 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-04  2:20 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1382115045

Comment:
Needed update for llvm17 support

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

* Re: [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (39 preceding siblings ...)
  2023-11-04  2:20 ` [PR REVIEW] " Calandracas606
@ 2023-11-04  2:23 ` Calandracas606
  2023-11-05  2:47 ` Calandracas606
                   ` (77 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-04  2:23 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1793307647

Comment:
This merge request is in a sate where I feel that a review would be beneficial

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

* Re: [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (40 preceding siblings ...)
  2023-11-04  2:23 ` Calandracas606
@ 2023-11-05  2:47 ` Calandracas606
  2023-11-05 15:49 ` Calandracas606
                   ` (76 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-05  2:47 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1793615806

Comment:
Successfully crossbuilt llvm17 and all reverse dependencies for aarch64-musl

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

* Re: [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (41 preceding siblings ...)
  2023-11-05  2:47 ` Calandracas606
@ 2023-11-05 15:49 ` Calandracas606
  2023-11-07 18:33 ` [PR PATCH] [Updated] " Calandracas606
                   ` (75 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-05 15:49 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1793773657

Comment:
SPIRV-Tools failing on musl

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (42 preceding siblings ...)
  2023-11-05 15:49 ` Calandracas606
@ 2023-11-07 18:33 ` Calandracas606
  2023-11-07 18:37 ` [PR REVIEW] " Calandracas606
                   ` (74 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-07 18:33 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686 (cross)
-- problems installing i686, only usr/lib32 is populated

This is still very WIP

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From feaea2b639faede63ace034ae037c9a47812c4ca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/29] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 563 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1051 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 9036a675c1ae5..75c6c79d4e427 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..2516daaf6a5ac
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,563 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;bolt;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir llvm-bolt"
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 730560bbb8ddfc65c783b95c8003a4b5c110ef18 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 02/29] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From c5d14b718f560dacfbf8b41c36468fb1e4c253ee Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 03/29] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 7ee832a6a24370cd6d856275d2a269766a405bbb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 04/29] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From e60f2a3b76df74bb642b72a0f31c6520770da934 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 05/29] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 313559fbbae91ea595bc49b53455f758473b189c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 06/29] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From bd2378d78b1310011de29d7d282d961266edccbb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 07/29] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From d1fa859d4041cc9c943ab08db67de39ce43b0c8f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 08/29] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 512a63cc13dae29a86c909b84da0d6dc886e1f67 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 09/29] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 7dfb22328946698ca63aa8a7b5049a6c6beaa695 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 10/29] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 6a280baa0c284..3f08c597b9585 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="tibequadorian <tibequadorian@posteo.de>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From aac3047438e1deea90471333f95b4209b0fc186d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 11/29] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 75c6c79d4e427..4864dfe8684b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -988,7 +988,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 23488033b01d57f2870ebf1b4c411b5ba644575e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 12/29] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 8bb7d5f8b1ae2..4d0881ceb374a 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 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
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 788a126c63a8abbd23d7972c670f18d69b35e211 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 13/29] mesa: rebuild for llvm17

---
 srcpkgs/mesa/patches/gallium-llvm17.patch | 119 ++++++++++++++++++++++
 srcpkgs/mesa/template                     |   2 +-
 2 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mesa/patches/gallium-llvm17.patch

diff --git a/srcpkgs/mesa/patches/gallium-llvm17.patch b/srcpkgs/mesa/patches/gallium-llvm17.patch
new file mode 100644
index 0000000000000..4a982bbd822a9
--- /dev/null
+++ b/srcpkgs/mesa/patches/gallium-llvm17.patch
@@ -0,0 +1,119 @@
+commit 2d4fe5f229791fde52846b3f583c12508b5109d6
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Fri Aug 25 12:43:44 2023 +1000
+
+    clover/llvm: move to modern pass manager.
+    
+    This seems like it should work, but I haven't tested it yet.
+    
+    Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
+    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
+
+diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
+index 7a50fea3323..43d26fe1abb 100644
+--- a/src/gallium/frontends/clover/llvm/invocation.cpp
++++ b/src/gallium/frontends/clover/llvm/invocation.cpp
+@@ -27,13 +27,17 @@
+ #include <llvm/IR/DiagnosticPrinter.h>
+ #include <llvm/IR/DiagnosticInfo.h>
+ #include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
+ #include <llvm/Support/raw_ostream.h>
+-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
++#include <llvm/Transforms/IPO/Internalize.h>
+ #include <llvm-c/Target.h>
+ #ifdef HAVE_CLOVER_SPIRV
+ #include <LLVMSPIRVLib/LLVMSPIRVLib.h>
+ #endif
+ 
++#include <llvm-c/TargetMachine.h>
++#include <llvm-c/Transforms/PassBuilder.h>
++#include <llvm/Support/CBindingWrapping.h>
+ #include <clang/CodeGen/CodeGenAction.h>
+ #include <clang/Lex/PreprocessorOptions.h>
+ #include <clang/Frontend/TextDiagnosticBuffer.h>
+@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
+ 
+ namespace {
+    void
+-   optimize(Module &mod, unsigned optimization_level,
++   optimize(Module &mod,
++            const std::string& ir_target,
++            unsigned optimization_level,
+             bool internalize_symbols) {
+-      ::llvm::legacy::PassManager pm;
+-
+       // By default, the function internalizer pass will look for a function
+       // called "main" and then mark all other functions as internal.  Marking
+       // functions as internal enables the optimizer to perform optimizations
+@@ -458,19 +462,53 @@ namespace {
+       if (internalize_symbols) {
+          std::vector<std::string> names =
+             map(std::mem_fn(&Function::getName), get_kernels(mod));
+-         pm.add(::llvm::createInternalizePass(
++         internalizeModule(mod,
+                       [=](const ::llvm::GlobalValue &gv) {
+                          return std::find(names.begin(), names.end(),
+                                           gv.getName()) != names.end();
+-                      }));
++                      });
+       }
+ 
+-      ::llvm::PassManagerBuilder pmb;
+-      pmb.OptLevel = optimization_level;
+-      pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
+-         ::llvm::Triple(mod.getTargetTriple()));
+-      pmb.populateModulePassManager(pm);
+-      pm.run(mod);
++
++      const char *opt_str = NULL;
++      LLVMCodeGenOptLevel level;
++      switch (optimization_level) {
++      case 0:
++      default:
++         opt_str = "default<O0>";
++         level = LLVMCodeGenLevelNone;
++         break;
++      case 1:
++         opt_str = "default<O1>";
++         level = LLVMCodeGenLevelLess;
++         break;
++      case 2:
++         opt_str = "default<O2>";
++         level = LLVMCodeGenLevelDefault;
++         break;
++      case 3:
++         opt_str = "default<O3>";
++         level = LLVMCodeGenLevelAggressive;
++         break;
++      }
++
++      const target &target = ir_target;
++      LLVMTargetRef targ;
++      char *err_message;
++
++      if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
++         return;
++      LLVMTargetMachineRef tm =
++         LLVMCreateTargetMachine(targ, target.triple.c_str(),
++                                 target.cpu.c_str(), "", level,
++                                 LLVMRelocDefault, LLVMCodeModelDefault);
++
++      if (!tm)
++         return;
++      LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
++      LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
++
++      LLVMDisposeTargetMachine(tm);
+    }
+ 
+    std::unique_ptr<Module>
+@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
+    auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
+    auto mod = link(*ctx, *c, binaries, r_log);
+ 
+-   optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
++   optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
+ 
+    static std::atomic_uint seq(0);
+    const std::string id = "." + mod->getModuleIdentifier() + "-" +
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index f36ebe5938041..534e140ee6052 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.2.1
-revision=2
+revision=3
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From f109ceed276dcc7cf437cebeb072abbcdb741a36 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:49:47 -0400
Subject: [PATCH 14/29] qt5: rebuild for llvm17

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index b6612dffeb1b9..f879df3a3e706 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=7
+revision=8
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python3 re2c ruby which"

From c173b26420c813e6456deea1ac39e97ba132e99c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 15/29] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From fd10418308d578379e08b2361c702e18198f043d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 16/29] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 ff9dd25b2cf36affc473fceb92f6e025f078d23d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 17/29] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 5009b831220862676b31650a0871cb08d179889b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 18/29] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From b167d525f183fe5dbdfa886902c11de1d8cabf92 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 19/29] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 8a485df5c70d8623215cf2223b5227c7480492ab Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 20/29] juCi++: rebuild for llvm17

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

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

From 3237857d04ae25307255d58c5390f34639d08ed0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 21/29] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 4864dfe8684b9..df9288d637ef1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2619,22 +2619,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 803b608892d2950ed32233db0b3889b705e91bc3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 22/29] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From 65969ec88a0772db9d5f2d090d37f058194fc220 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 23/29] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 7b1df6e4b7a045024ba37088ca04e0056b9930f1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 24/29] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 2bd299ebc56b1a5c6b7e93642a5c157206330555 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 25/29] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From b2430ef13a018093f6bf9c1c1bef3ad91bfe6961 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 26/29] rtags: rebuild for llvm17

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

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

From 6cb902d01d35ae8d2af05085190339bfb9302506 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 27/29] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From e9f6aa2d0ce8a0223e28c8d153453f1f522b9983 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 28/29] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 437679b7febee79ce0da194a4f28e73fe2e10c59 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 29/29] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

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

* Re: [PR REVIEW] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (43 preceding siblings ...)
  2023-11-07 18:33 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-11-07 18:37 ` Calandracas606
  2023-11-07 20:45 ` [PR PATCH] [Updated] " Calandracas606
                   ` (73 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-07 18:37 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1385389786

Comment:
2023.5 released as part of Vulkan SDK, and not a standalone realease on github

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

* Re: [PR PATCH] [Updated] [WIP] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (44 preceding siblings ...)
  2023-11-07 18:37 ` [PR REVIEW] " Calandracas606
@ 2023-11-07 20:45 ` Calandracas606
  2023-11-16 13:34 ` [PR REVIEW] " ahesford
                   ` (72 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-07 20:45 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

[WIP] New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686 (cross)
-- problems installing i686, only usr/lib32 is populated

This is still very WIP

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From 3ed7e4353e15d9bec314db5e0d71d5576d5d9032 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/29] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 573 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1061 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 9036a675c1ae5..75c6c79d4e427 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..199f82eacf868
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,573 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From d958a77722cb7ef0a2629fce13bdbd23d900852f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 02/29] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From e1323d3bc872ff936573a083a30bb3b7b5a6b29b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 03/29] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 83e0f2cc1627400ddab9e74346435c4c8c2bc2f8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 04/29] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From a90d9f425edf67548ac9afbaac2e114203bb329a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 05/29] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 3a59ff9779e9211253bd1e04b334fcc40bba446d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 06/29] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 5790e421f919fc442609e55a88ba2dcdf557572a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 07/29] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From d84437b88a4c670f450d7dbb0213e173a2302691 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 08/29] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 3e0d46960fbe20adf655c8a9d94ab82977f73e17 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 09/29] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 42f8fa1bb0ae3f9e9e30f3c82cdd00525cd17066 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 10/29] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 6a280baa0c284..3f08c597b9585 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="tibequadorian <tibequadorian@posteo.de>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 764ecd3734d03a59119ff22833c1726e1322779b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 11/29] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 75c6c79d4e427..4864dfe8684b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -988,7 +988,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 9eb92e867621f573ea24336df60f3812519488d6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 12/29] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 8bb7d5f8b1ae2..4d0881ceb374a 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 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
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From a77cef687963b946c2d19ca471e309b342ec7cac Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 13/29] mesa: rebuild for llvm17

---
 srcpkgs/mesa/patches/gallium-llvm17.patch | 119 ++++++++++++++++++++++
 srcpkgs/mesa/template                     |   2 +-
 2 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mesa/patches/gallium-llvm17.patch

diff --git a/srcpkgs/mesa/patches/gallium-llvm17.patch b/srcpkgs/mesa/patches/gallium-llvm17.patch
new file mode 100644
index 0000000000000..4a982bbd822a9
--- /dev/null
+++ b/srcpkgs/mesa/patches/gallium-llvm17.patch
@@ -0,0 +1,119 @@
+commit 2d4fe5f229791fde52846b3f583c12508b5109d6
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Fri Aug 25 12:43:44 2023 +1000
+
+    clover/llvm: move to modern pass manager.
+    
+    This seems like it should work, but I haven't tested it yet.
+    
+    Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
+    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
+
+diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
+index 7a50fea3323..43d26fe1abb 100644
+--- a/src/gallium/frontends/clover/llvm/invocation.cpp
++++ b/src/gallium/frontends/clover/llvm/invocation.cpp
+@@ -27,13 +27,17 @@
+ #include <llvm/IR/DiagnosticPrinter.h>
+ #include <llvm/IR/DiagnosticInfo.h>
+ #include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
+ #include <llvm/Support/raw_ostream.h>
+-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
++#include <llvm/Transforms/IPO/Internalize.h>
+ #include <llvm-c/Target.h>
+ #ifdef HAVE_CLOVER_SPIRV
+ #include <LLVMSPIRVLib/LLVMSPIRVLib.h>
+ #endif
+ 
++#include <llvm-c/TargetMachine.h>
++#include <llvm-c/Transforms/PassBuilder.h>
++#include <llvm/Support/CBindingWrapping.h>
+ #include <clang/CodeGen/CodeGenAction.h>
+ #include <clang/Lex/PreprocessorOptions.h>
+ #include <clang/Frontend/TextDiagnosticBuffer.h>
+@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
+ 
+ namespace {
+    void
+-   optimize(Module &mod, unsigned optimization_level,
++   optimize(Module &mod,
++            const std::string& ir_target,
++            unsigned optimization_level,
+             bool internalize_symbols) {
+-      ::llvm::legacy::PassManager pm;
+-
+       // By default, the function internalizer pass will look for a function
+       // called "main" and then mark all other functions as internal.  Marking
+       // functions as internal enables the optimizer to perform optimizations
+@@ -458,19 +462,53 @@ namespace {
+       if (internalize_symbols) {
+          std::vector<std::string> names =
+             map(std::mem_fn(&Function::getName), get_kernels(mod));
+-         pm.add(::llvm::createInternalizePass(
++         internalizeModule(mod,
+                       [=](const ::llvm::GlobalValue &gv) {
+                          return std::find(names.begin(), names.end(),
+                                           gv.getName()) != names.end();
+-                      }));
++                      });
+       }
+ 
+-      ::llvm::PassManagerBuilder pmb;
+-      pmb.OptLevel = optimization_level;
+-      pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
+-         ::llvm::Triple(mod.getTargetTriple()));
+-      pmb.populateModulePassManager(pm);
+-      pm.run(mod);
++
++      const char *opt_str = NULL;
++      LLVMCodeGenOptLevel level;
++      switch (optimization_level) {
++      case 0:
++      default:
++         opt_str = "default<O0>";
++         level = LLVMCodeGenLevelNone;
++         break;
++      case 1:
++         opt_str = "default<O1>";
++         level = LLVMCodeGenLevelLess;
++         break;
++      case 2:
++         opt_str = "default<O2>";
++         level = LLVMCodeGenLevelDefault;
++         break;
++      case 3:
++         opt_str = "default<O3>";
++         level = LLVMCodeGenLevelAggressive;
++         break;
++      }
++
++      const target &target = ir_target;
++      LLVMTargetRef targ;
++      char *err_message;
++
++      if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
++         return;
++      LLVMTargetMachineRef tm =
++         LLVMCreateTargetMachine(targ, target.triple.c_str(),
++                                 target.cpu.c_str(), "", level,
++                                 LLVMRelocDefault, LLVMCodeModelDefault);
++
++      if (!tm)
++         return;
++      LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
++      LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
++
++      LLVMDisposeTargetMachine(tm);
+    }
+ 
+    std::unique_ptr<Module>
+@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
+    auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
+    auto mod = link(*ctx, *c, binaries, r_log);
+ 
+-   optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
++   optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
+ 
+    static std::atomic_uint seq(0);
+    const std::string id = "." + mod->getModuleIdentifier() + "-" +
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index f36ebe5938041..534e140ee6052 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.2.1
-revision=2
+revision=3
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 2dca73e1b7b90ec8d0720fd2055d66911349a9e5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:49:47 -0400
Subject: [PATCH 14/29] qt5: rebuild for llvm17

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index b6612dffeb1b9..f879df3a3e706 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=7
+revision=8
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python3 re2c ruby which"

From 9889efe166a877c1caaaf372ad314cc4c2b19b38 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 15/29] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From f8f42aa6ac17429cc4b4bfc7d8e3406c83bd9ada Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 16/29] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 f4d4a067dabff06e8e0168564748a585d8f92802 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 17/29] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 7e8ccf6e743b2d7d008c92b3553585af6c585411 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 18/29] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 89752decab422bac47d836002626dfc251c20e6f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 19/29] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 366c19d50372030dcf86ab8806ecbecb60cc9dbc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 20/29] juCi++: rebuild for llvm17

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

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

From 790b142bb9b2b610e022c1897717f1c34975394a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 21/29] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 4864dfe8684b9..df9288d637ef1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2619,22 +2619,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From eeb5dea71f67adff1b5d9821469fec9f5ae2145c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 22/29] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From f7267ba4ca8a60d8c84a5bece63cbba7bea7d2ef Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 23/29] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 7d25c426a18b3da7d8b311a501d05b768d179568 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 24/29] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From ce485df6ee5c2712c184d667c2e3a15b4443332e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 25/29] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From af6092de9f49dd1a9e6694326df56464d4764cc4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 26/29] rtags: rebuild for llvm17

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

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

From 68ac4bc9aff891a6342a237f56fd0e88cd00550e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 27/29] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 27d7a895e66a4e23a7972810c892ce19d564f8b6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 28/29] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From da26bfe70ccf40b6f0131a2db890d916f4677918 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 29/29] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

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

* Re: [PR REVIEW] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (45 preceding siblings ...)
  2023-11-07 20:45 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-11-16 13:34 ` ahesford
  2023-11-16 16:33 ` Calandracas606
                   ` (71 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: ahesford @ 2023-11-16 13:34 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1395701793

Comment:
If the current PPC patches are difficult to rebase, it's OK to drop them. If they carry forward easily and the only other difference is some conditions in the template, we shouldn't wantonly discard support.

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

* Re: [PR REVIEW] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (46 preceding siblings ...)
  2023-11-16 13:34 ` [PR REVIEW] " ahesford
@ 2023-11-16 16:33 ` Calandracas606
  2023-11-16 20:52 ` tranzystorekk
                   ` (70 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-11-16 16:33 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1396009787

Comment:
The ppc patches that were removed was because the issues were fixed upstream. I guess it doesn't hurt to keep these conditions in the template, even though they aren't tested

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (47 preceding siblings ...)
  2023-11-16 16:33 ` Calandracas606
@ 2023-11-16 20:52 ` tranzystorekk
  2023-12-02 23:43 ` [PR PATCH] [Updated] " Calandracas606
                   ` (69 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: tranzystorekk @ 2023-11-16 20:52 UTC (permalink / raw)
  To: ml

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

New comment by tranzystorekk on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1815294620

Comment:
- Rust could preemptively use a rebuild against this as well, seeing as it's on the brink of getting llvm-bumped again
- I'd put the newpkg symlinks into the main `llvm17` commit for simplicity
- Haven't manually checked, but upstream likes to develop new clang-tools-extra utils without warning and they end up cluttering the main pkg a little

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (48 preceding siblings ...)
  2023-11-16 20:52 ` tranzystorekk
@ 2023-12-02 23:43 ` Calandracas606
  2023-12-03  1:49 ` sbromberger
                   ` (68 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-02 23:43 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From 8d6476fb3ef42f60ff3745b010e81d08c3e80959 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/28] New package: llvm17

---
 common/shlibs                                 |   9 +-
 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 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 573 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 37 files changed, 1061 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/common/shlibs b/common/shlibs
index 1b25a12956eeb..7c06b8662f662 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..199f82eacf868
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,573 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From f1d26996d3074ec3633954c325ea6c699705d61c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:17 -0400
Subject: [PATCH 02/28] New package: libllvm17

---
 srcpkgs/libllvm17 | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/libllvm17

diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 0f576beee7a124e84ccd570ab0b57e62a4c0e9cf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:11:43 -0400
Subject: [PATCH 03/28] New package: mlir

---
 srcpkgs/mlir | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/mlir

diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From c88e187276efaed9a773308e2dc41b6ca9d52413 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:13:24 -0400
Subject: [PATCH 04/28] New package: flang

---
 srcpkgs/flang       | 1 +
 srcpkgs/flang-devel | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel

diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 11b817a37bf39b511c9d8fe7bfedf95441e625fb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:14:19 -0400
Subject: [PATCH 05/28] New package: llvm-bolt

---
 srcpkgs/llvm-bolt | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 srcpkgs/llvm-bolt

diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From c612991c96a9af1cd8bce7055294552635db8f46 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 06/28] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 4effab42386ea4c94add1cc75b6b8c550d2f6cc4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 07/28] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 44b4923703deafba3bd6564dbe0430c371c28e98 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 08/28] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 9a82c871a0ac99b766f90b15c478ddf9a81c2763 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 09/28] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From e3b39705eb03588bea278c15cbddf8ace4d99b17 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 10/28] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 0bb11b1c63acc0663a85e4d649ee154707da6e50 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 11/28] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 7c06b8662f662..6aedff7e35099 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 2c8757ec729c3462b1553831641de5c1cfa3d591 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 12/28] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From c9a15dc6e158b4309db4bea549ea02320d166647 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 13/28] mesa: rebuild for llvm17

---
 srcpkgs/mesa/patches/gallium-llvm17.patch | 119 ++++++++++++++++++++++
 srcpkgs/mesa/template                     |   2 +-
 2 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mesa/patches/gallium-llvm17.patch

diff --git a/srcpkgs/mesa/patches/gallium-llvm17.patch b/srcpkgs/mesa/patches/gallium-llvm17.patch
new file mode 100644
index 0000000000000..4a982bbd822a9
--- /dev/null
+++ b/srcpkgs/mesa/patches/gallium-llvm17.patch
@@ -0,0 +1,119 @@
+commit 2d4fe5f229791fde52846b3f583c12508b5109d6
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Fri Aug 25 12:43:44 2023 +1000
+
+    clover/llvm: move to modern pass manager.
+    
+    This seems like it should work, but I haven't tested it yet.
+    
+    Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
+    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
+
+diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
+index 7a50fea3323..43d26fe1abb 100644
+--- a/src/gallium/frontends/clover/llvm/invocation.cpp
++++ b/src/gallium/frontends/clover/llvm/invocation.cpp
+@@ -27,13 +27,17 @@
+ #include <llvm/IR/DiagnosticPrinter.h>
+ #include <llvm/IR/DiagnosticInfo.h>
+ #include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
+ #include <llvm/Support/raw_ostream.h>
+-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
++#include <llvm/Transforms/IPO/Internalize.h>
+ #include <llvm-c/Target.h>
+ #ifdef HAVE_CLOVER_SPIRV
+ #include <LLVMSPIRVLib/LLVMSPIRVLib.h>
+ #endif
+ 
++#include <llvm-c/TargetMachine.h>
++#include <llvm-c/Transforms/PassBuilder.h>
++#include <llvm/Support/CBindingWrapping.h>
+ #include <clang/CodeGen/CodeGenAction.h>
+ #include <clang/Lex/PreprocessorOptions.h>
+ #include <clang/Frontend/TextDiagnosticBuffer.h>
+@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
+ 
+ namespace {
+    void
+-   optimize(Module &mod, unsigned optimization_level,
++   optimize(Module &mod,
++            const std::string& ir_target,
++            unsigned optimization_level,
+             bool internalize_symbols) {
+-      ::llvm::legacy::PassManager pm;
+-
+       // By default, the function internalizer pass will look for a function
+       // called "main" and then mark all other functions as internal.  Marking
+       // functions as internal enables the optimizer to perform optimizations
+@@ -458,19 +462,53 @@ namespace {
+       if (internalize_symbols) {
+          std::vector<std::string> names =
+             map(std::mem_fn(&Function::getName), get_kernels(mod));
+-         pm.add(::llvm::createInternalizePass(
++         internalizeModule(mod,
+                       [=](const ::llvm::GlobalValue &gv) {
+                          return std::find(names.begin(), names.end(),
+                                           gv.getName()) != names.end();
+-                      }));
++                      });
+       }
+ 
+-      ::llvm::PassManagerBuilder pmb;
+-      pmb.OptLevel = optimization_level;
+-      pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
+-         ::llvm::Triple(mod.getTargetTriple()));
+-      pmb.populateModulePassManager(pm);
+-      pm.run(mod);
++
++      const char *opt_str = NULL;
++      LLVMCodeGenOptLevel level;
++      switch (optimization_level) {
++      case 0:
++      default:
++         opt_str = "default<O0>";
++         level = LLVMCodeGenLevelNone;
++         break;
++      case 1:
++         opt_str = "default<O1>";
++         level = LLVMCodeGenLevelLess;
++         break;
++      case 2:
++         opt_str = "default<O2>";
++         level = LLVMCodeGenLevelDefault;
++         break;
++      case 3:
++         opt_str = "default<O3>";
++         level = LLVMCodeGenLevelAggressive;
++         break;
++      }
++
++      const target &target = ir_target;
++      LLVMTargetRef targ;
++      char *err_message;
++
++      if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
++         return;
++      LLVMTargetMachineRef tm =
++         LLVMCreateTargetMachine(targ, target.triple.c_str(),
++                                 target.cpu.c_str(), "", level,
++                                 LLVMRelocDefault, LLVMCodeModelDefault);
++
++      if (!tm)
++         return;
++      LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
++      LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
++
++      LLVMDisposeTargetMachine(tm);
+    }
+ 
+    std::unique_ptr<Module>
+@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
+    auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
+    auto mod = link(*ctx, *c, binaries, r_log);
+ 
+-   optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
++   optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
+ 
+    static std::atomic_uint seq(0);
+    const std::string id = "." + mod->getModuleIdentifier() + "-" +
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From fef46486036ce95a0a75b6af1151056befab53af Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 14/28] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 4a9eeddf6620f4786fe2f30ec212bfaafcb6d77e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 15/28] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 88c9be9da540d0a2501b529b69a7dc72ea22fd12 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 16/28] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 80b8dffbad34c26022710b5b3cfaf508db671c58 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 17/28] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 79dd9cb39ffba2cfedda3547e6649977ef4b3299 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 18/28] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 96eef44e0e6ccf5ca937b947338cc1615178cfdf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 19/28] juCi++: rebuild for llvm17

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

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

From 2f50e7a87bee7258f426cabbb4164f90e793655e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 20/28] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 6aedff7e35099..7bae7527ea762 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2616,22 +2616,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From d5f95462460650e2e0f39878bb1ef995d61990fb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 21/28] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From 6bf53f758c720d5e82dc93c0181d13950a8bc937 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 22/28] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 894ddb03d6bbecca21525abcbeeb190252188916 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 23/28] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From c7f2e079baffc77c1c262ebf9f82d2a70b739b98 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 24/28] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 55e2198badeb0388a260b54f4df7015e371436c1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 25/28] rtags: rebuild for llvm17

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

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

From 026b61eb726b2b5e0d5736b63bdcdaadc97f2078 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 26/28] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 4daaa7b2e64f55e8e4e26bbb71aaf2fb63dba33e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 27/28] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 69ffc0f176809a9e21ff3bc85dade3f5e724002c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 28/28] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (49 preceding siblings ...)
  2023-12-02 23:43 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-12-03  1:49 ` sbromberger
  2023-12-03 13:36 ` sbromberger
                   ` (67 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: sbromberger @ 2023-12-03  1:49 UTC (permalink / raw)
  To: ml

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

New comment by sbromberger on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1837306811

Comment:
I tried building this tonight on `Linux hydrogen 6.5.12_1 #1 SMP PREEMPT_DYNAMIC Mon Nov 20 18:31:50 UTC 2023 x86_64 GNU/Linux`

Results:
```console
...
Making all in debuginfod
  CXXLD    debuginfod
/usr/bin/ld: ../libelf/libelf.so: undefined reference to symbol 'inflateEnd'
/usr/bin/ld: /lib64/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:618: debuginfod] Error 1
make[1]: *** [Makefile:537: all-recursive] Error 1
make: *** [Makefile:453: all] Error 2
=> ERROR: elfutils-0.189_1: do_build: '${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}' exited with 2
=> ERROR:   in do_build() at common/build-style/gnu-configure.sh:15
```

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (50 preceding siblings ...)
  2023-12-03  1:49 ` sbromberger
@ 2023-12-03 13:36 ` sbromberger
  2023-12-03 13:37 ` sbromberger
                   ` (66 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: sbromberger @ 2023-12-03 13:36 UTC (permalink / raw)
  To: ml

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

New comment by sbromberger on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1837482975

Comment:
So far this is working really well. Here are my notes:
- built llvm17, installed via `xi`
- noticed that clang, clang-tools-extra, lldb, libcxx, and libcxx-devel are symlinked
- installed each of those via `xi`
- Enjoying `#include <format>` goodness with `clang++ -std=c++23 -stdlib=libc++`

This is on `Linux hydrogen 6.5.12_1 #1 SMP PREEMPT_DYNAMIC Mon Nov 20 18:31:50 UTC 2023 x86_64 GNU/Linux`

Thanks for making this PR.

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (51 preceding siblings ...)
  2023-12-03 13:36 ` sbromberger
@ 2023-12-03 13:37 ` sbromberger
  2023-12-03 18:45 ` [PR PATCH] [Updated] " Calandracas606
                   ` (65 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: sbromberger @ 2023-12-03 13:37 UTC (permalink / raw)
  To: ml

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

New comment by sbromberger on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1837306811

Comment:
I tried building this tonight on `Linux hydrogen 6.5.12_1 #1 SMP PREEMPT_DYNAMIC Mon Nov 20 18:31:50 UTC 2023 x86_64 GNU/Linux`

Results:
```console
...
Making all in debuginfod
  CXXLD    debuginfod
/usr/bin/ld: ../libelf/libelf.so: undefined reference to symbol 'inflateEnd'
/usr/bin/ld: /lib64/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:618: debuginfod] Error 1
make[1]: *** [Makefile:537: all-recursive] Error 1
make: *** [Makefile:453: all] Error 2
=> ERROR: elfutils-0.189_1: do_build: '${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}' exited with 2
=> ERROR:   in do_build() at common/build-style/gnu-configure.sh:15
```

Edited to add: Apparently my master branch was out of sync. Once I resolved that, elfutils and the rest of the PR built fine.

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (52 preceding siblings ...)
  2023-12-03 13:37 ` sbromberger
@ 2023-12-03 18:45 ` Calandracas606
  2023-12-06  3:38 ` Calandracas606
                   ` (64 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-03 18:45 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From 3803dfd7f28b1706085e1506e50420853e5271a3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/25] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 573 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 1b25a12956eeb..7c06b8662f662 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..199f82eacf868
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,573 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From f6cf6ac6face8010fec8180afaf96efb40369056 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/25] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 490fca683b326762aa8614dab35c9c2b9fa29daf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/25] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 10c7bcb14c9b388574e4f3a919ecd500832a9917 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/25] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 83b23be2320a24b64ac2bbc8f371aec13c50ceb8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/25] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From b4fe196f09b0faf26063cbbc458cbcb7b4c199bb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/25] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From cb250ae4314d0bf52843f8ed2f6a3b149efc7637 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/25] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 7c06b8662f662..6aedff7e35099 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 1f983c7b176c3f2b220cae91387f47dd0571fc02 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/25] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 268faeae65f91985aaaaedec47083fb7b0ca3684 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/25] mesa: rebuild for llvm17

---
 srcpkgs/mesa/patches/gallium-llvm17.patch | 119 ++++++++++++++++++++++
 srcpkgs/mesa/template                     |   2 +-
 2 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mesa/patches/gallium-llvm17.patch

diff --git a/srcpkgs/mesa/patches/gallium-llvm17.patch b/srcpkgs/mesa/patches/gallium-llvm17.patch
new file mode 100644
index 0000000000000..4a982bbd822a9
--- /dev/null
+++ b/srcpkgs/mesa/patches/gallium-llvm17.patch
@@ -0,0 +1,119 @@
+commit 2d4fe5f229791fde52846b3f583c12508b5109d6
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Fri Aug 25 12:43:44 2023 +1000
+
+    clover/llvm: move to modern pass manager.
+    
+    This seems like it should work, but I haven't tested it yet.
+    
+    Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
+    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
+
+diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
+index 7a50fea3323..43d26fe1abb 100644
+--- a/src/gallium/frontends/clover/llvm/invocation.cpp
++++ b/src/gallium/frontends/clover/llvm/invocation.cpp
+@@ -27,13 +27,17 @@
+ #include <llvm/IR/DiagnosticPrinter.h>
+ #include <llvm/IR/DiagnosticInfo.h>
+ #include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
+ #include <llvm/Support/raw_ostream.h>
+-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
++#include <llvm/Transforms/IPO/Internalize.h>
+ #include <llvm-c/Target.h>
+ #ifdef HAVE_CLOVER_SPIRV
+ #include <LLVMSPIRVLib/LLVMSPIRVLib.h>
+ #endif
+ 
++#include <llvm-c/TargetMachine.h>
++#include <llvm-c/Transforms/PassBuilder.h>
++#include <llvm/Support/CBindingWrapping.h>
+ #include <clang/CodeGen/CodeGenAction.h>
+ #include <clang/Lex/PreprocessorOptions.h>
+ #include <clang/Frontend/TextDiagnosticBuffer.h>
+@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
+ 
+ namespace {
+    void
+-   optimize(Module &mod, unsigned optimization_level,
++   optimize(Module &mod,
++            const std::string& ir_target,
++            unsigned optimization_level,
+             bool internalize_symbols) {
+-      ::llvm::legacy::PassManager pm;
+-
+       // By default, the function internalizer pass will look for a function
+       // called "main" and then mark all other functions as internal.  Marking
+       // functions as internal enables the optimizer to perform optimizations
+@@ -458,19 +462,53 @@ namespace {
+       if (internalize_symbols) {
+          std::vector<std::string> names =
+             map(std::mem_fn(&Function::getName), get_kernels(mod));
+-         pm.add(::llvm::createInternalizePass(
++         internalizeModule(mod,
+                       [=](const ::llvm::GlobalValue &gv) {
+                          return std::find(names.begin(), names.end(),
+                                           gv.getName()) != names.end();
+-                      }));
++                      });
+       }
+ 
+-      ::llvm::PassManagerBuilder pmb;
+-      pmb.OptLevel = optimization_level;
+-      pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
+-         ::llvm::Triple(mod.getTargetTriple()));
+-      pmb.populateModulePassManager(pm);
+-      pm.run(mod);
++
++      const char *opt_str = NULL;
++      LLVMCodeGenOptLevel level;
++      switch (optimization_level) {
++      case 0:
++      default:
++         opt_str = "default<O0>";
++         level = LLVMCodeGenLevelNone;
++         break;
++      case 1:
++         opt_str = "default<O1>";
++         level = LLVMCodeGenLevelLess;
++         break;
++      case 2:
++         opt_str = "default<O2>";
++         level = LLVMCodeGenLevelDefault;
++         break;
++      case 3:
++         opt_str = "default<O3>";
++         level = LLVMCodeGenLevelAggressive;
++         break;
++      }
++
++      const target &target = ir_target;
++      LLVMTargetRef targ;
++      char *err_message;
++
++      if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
++         return;
++      LLVMTargetMachineRef tm =
++         LLVMCreateTargetMachine(targ, target.triple.c_str(),
++                                 target.cpu.c_str(), "", level,
++                                 LLVMRelocDefault, LLVMCodeModelDefault);
++
++      if (!tm)
++         return;
++      LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
++      LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
++
++      LLVMDisposeTargetMachine(tm);
+    }
+ 
+    std::unique_ptr<Module>
+@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
+    auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
+    auto mod = link(*ctx, *c, binaries, r_log);
+ 
+-   optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
++   optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
+ 
+    static std::atomic_uint seq(0);
+    const std::string id = "." + mod->getModuleIdentifier() + "-" +
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 62cd2e1481ecf0f9b579fe9321b9574e68c3345e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/25] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 2fcde797aeb268e895ad4f18b429850934b9de36 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/25] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 b35f5a27a824ccc78e0d0cd688a097698ffb2f13 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/25] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 781035bcd95e3f945660db70d87d2bcc1ebaf3bb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/25] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 7c2cc0757e554a49181e279db54d6fadd8de56a1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/25] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 4a9ea2682367094ca4dea1218e58329b53bf73e4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/25] juCi++: rebuild for llvm17

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

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

From b6f1fc20ed18355b3188b485d1d388a730ff1e2c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/25] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 6aedff7e35099..7bae7527ea762 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2616,22 +2616,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 006beaa799c7ada8d849e54b9700da6c2d7c285b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/25] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From bf5aac24c9d60e37d44558f8054b46590e601b19 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/25] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 337861e3179d79d5d60e434fe372de8a12d0e03d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/25] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 6988264182e55acd7521fa5a4b4f5c2422ba313d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/25] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From b4f6b718c644061457dfe616896b6e561cc72ecc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/25] rtags: rebuild for llvm17

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

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

From 4113fe7d81fa9093077e92d02ba9d0bb2b0166ef Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/25] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From b85474230c790fe63dab51ba636e6973e0dbdaa9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/25] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From f6f97fdac40cf0d044d2cbfe92eab610d2fa9f4d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/25] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From e6ba5055b732a1fa9db511a8bf821bbe023c05c2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/25] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 2c893b20cf35a..8f97dac3c863c 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (53 preceding siblings ...)
  2023-12-03 18:45 ` [PR PATCH] [Updated] " Calandracas606
@ 2023-12-06  3:38 ` Calandracas606
  2023-12-06 18:38 ` Calandracas606
                   ` (63 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-06  3:38 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From ddf72abf5620907ac92c6f71d6078b2714ddd87d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/25] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 573 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index f7046cbb6c206..88c397477adf6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..199f82eacf868
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,573 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=be5a1e44d64f306bb44fce7d36e3b3993694e8e6122b2348608906283c176db8
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 4219a61f113e3571555064ef02d7bc570be216b5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/25] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 80696ecd1b0beca9d04def701778740134c1ff38 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/25] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From fd0904ce3bfeeedf1ab40742cad257ee5cf9adf7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/25] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 7d56192dc34b6206bc80b90c0b4fc39b6cf21526 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/25] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From e0afd3f3115dc0f54c1943fc9fd154511029f3ff Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/25] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 7e3af84e62f99315dda1fea78eb9088265335a75 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/25] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 88c397477adf6..ab014c5bf9c1b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From cf1198cb0c00579ce736fc592954402ef61eb645 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/25] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 4508f26c63b1925871d6f768ec7ef0f2ac25935b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/25] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 8da345e303e845b47c5bacb43757854f74a5a8ce Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/25] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 57992f6c9f2fe431d3f91c18f8fc42ff97e1e39c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/25] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 6bd1324045e2a3484b22c0d4b7eb462677bf919a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/25] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 37a70ba71125c9d6a7780d11b587ddcfea1a8898 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/25] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From f0c2150ab49b76fe7d826942a79cfbf88b84434b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/25] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 8c3536c1219184cc6262e0a3b22867868ecf73f2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/25] juCi++: rebuild for llvm17

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

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

From fba26b5cd73a3fcb681165cd504b62aec3837ea9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/25] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index ab014c5bf9c1b..01e3b7aa57572 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2617,22 +2617,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 2848a32fdaa8aeffd4c4680a3a269258f3a1c6a9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/25] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From b7808d19deb70d17e6430a0c06774ece94b3f4e2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/25] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 603a8c9b6f54896ceb038ff6d1cc767a0d6b1616 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/25] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From ad61a7a0e263b180a1855009a6717337d7e7c5ef Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/25] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 9b55c6946137b810e6899ec68f76eda63e541b89 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/25] rtags: rebuild for llvm17

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

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

From f513056702c8f6011ca7f53d69514d484e33b16e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/25] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 5a687f0044556eb22be2b7cbc80c82894bbf655f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/25] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 4362719a01325a2f97b748e06632efed7acc9c84 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/25] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 2ebc76d99836903db5c39fdc9f1754de340f7755 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/25] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 2c893b20cf35a..8f97dac3c863c 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (54 preceding siblings ...)
  2023-12-06  3:38 ` Calandracas606
@ 2023-12-06 18:38 ` Calandracas606
  2023-12-07  0:48 ` Calandracas606
                   ` (62 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-06 18:38 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From c2d054308ce9ae5d773a51a051fc8f2423eedace Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/25] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 573 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index f7046cbb6c206..88c397477adf6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..88b3ab44e6efa
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,573 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/libbolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From f9de9e8d80d95cfa872a479dea8f29aba7cd39db Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/25] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 4a038982245ac49f815b8172da40b3d459a4f173 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/25] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From b95059b8fe406b654d61c987e78b3cd3f2fcf552 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/25] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From a447a43f5f0c9279cf443f430e866980d6e9ea01 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/25] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 3cc192c73ab6d58cf0d086d07f19c1d0e50e4b32 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/25] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From d987d9541f3c2c80d2ebf970e044e5fbcf7605ba Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/25] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 88c397477adf6..ab014c5bf9c1b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 295ef3b05379cdad91b038b3b9f75e3e1d5ae1f4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/25] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 6e3022ae3a1a0be8bc4bee26989b567b6ac08d12 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/25] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 3f91a2326135bcf5fc667f3b3b31ef1a619fd124 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/25] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From e68a4433dbe339f7fd2f10799b9f9f46890a8ce8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/25] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 ca8a659fcbf9ad38f8ca56a313078d61103a4955 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/25] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 36f541d1ebd975849b29565506083f8c17202036 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/25] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From d6950517066b96ae4607c903eb57f7c754741dbc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/25] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From ba9fcc77b39bcc47ab864620e25c02782e16260b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/25] juCi++: rebuild for llvm17

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

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

From ecd39cc80b74c273580010f9cc996f46a8ee4fd9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/25] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index ab014c5bf9c1b..01e3b7aa57572 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2617,22 +2617,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 2446a6304246e52f997d98deae6ec605e72f5db6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/25] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From c3367e6f474ed7003f7f26e5a98afa0c1019c973 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/25] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From a8f2c8f24ff94c7928346c6c5dd80f34e6e36a26 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/25] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From fb9dd96734511d2ffa91de932431c7cd51b524f6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/25] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 0e6e3083f6c1b7cd6c47b995a602832451904ba9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/25] rtags: rebuild for llvm17

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

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

From 884b0fd07fe09a6a537c0ad7026e92d695a6709a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/25] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 6cdd6e6d5bd4357d75749a19f6a04217c5c3e57c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/25] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From e5021175f11f10a93948c9338a866aaac51cd2db Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/25] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 54a3a4aa3202982b6aeb660c43893e5df473efae Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/25] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 2c893b20cf35a..8f97dac3c863c 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (55 preceding siblings ...)
  2023-12-06 18:38 ` Calandracas606
@ 2023-12-07  0:48 ` Calandracas606
  2023-12-08  4:12 ` Calandracas606
                   ` (61 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-07  0:48 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From d97f2c972825e2deae6567da7f2f09cf9a39f20a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/25] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 573 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index f7046cbb6c206..88c397477adf6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..fd84cd1749ab1
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,573 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/*LLVMBOLT*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 6151511e65d7c9a4c3a0f70e109fc0c3e9663d59 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/25] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 48082564b93b7ac6432c91ddc5d21123e2a5ab61 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/25] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 63211a3b38e3de7094dd00bca5f754ff5a0b61ba Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/25] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 6a7be40c10360280ada208a89c54f88c714deb85 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/25] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 8eeca1656a4c512f0dddb7511bd535c48ca0128b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/25] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 2fee0856fd4435845e334fd693cc3c50db96cf6e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/25] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 88c397477adf6..ab014c5bf9c1b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 10c55cc0258e38cadd6b897959f492759c690bfb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/25] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 00d055e9dd61290946af61866da7e20daf8f7872 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/25] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From cc1a674e9d629917422363998eb5c7a97e689183 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/25] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 487c8ff9108f7bb73b14352b511b662fcd686866 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/25] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 c385c3b5dce019b04fc11f314baad216ce5fa83e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/25] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From ff46e4057e81c3ab4f01353f1bf00f5d716dc5c2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/25] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 1b452aedd174567e090c6d7fc4e6ff0d1857bb6f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/25] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 5eb4724562eda7d9f7d74762901a61e89117a084 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/25] juCi++: rebuild for llvm17

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

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

From 44a22b0110bcbea346b5a68fe8a7c9178eacc5eb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/25] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index ab014c5bf9c1b..01e3b7aa57572 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2617,22 +2617,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From c9998977fc66ec367af864820dd62c00119f251b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/25] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From c7d8e31329631c9e7b9ff75d795b3d5b3afb0f06 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/25] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From e42545bb28f1850c88c72390a2868053777e4c01 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/25] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 83e1fb547b49cb025194bb98ed5d63030bd8ba84 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/25] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 6c4e0544e2995eaf67a7bd316082aa2fe1b50b48 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/25] rtags: rebuild for llvm17

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

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

From bbdffe22d837544ba1ea6691c853984d87ac3c06 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/25] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 6a4299c5bdb7b2829be3208555cd6ba29223f5a0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/25] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 8a514df333e11d758698c2ed2d22ddaa8d9851ea Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/25] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 3cdc19a6122abc74e27b1e0901fd834fb3dcef96 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/25] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 2c893b20cf35a..8f97dac3c863c 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (56 preceding siblings ...)
  2023-12-07  0:48 ` Calandracas606
@ 2023-12-08  4:12 ` Calandracas606
  2023-12-12 17:29 ` Calandracas606
                   ` (60 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-08  4:12 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From 02c243450cd26a77e605f9912da01ba74ed17482 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/25] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 573 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index f7046cbb6c206..88c397477adf6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..fd84cd1749ab1
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,573 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/*LLVMBOLT*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 106ae01d92b92b2621ed4bccce4f08c02473922d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/25] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 93f20bbb7dde261ddc1b34258862507b7c4493c5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/25] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 86491e2b5dc0e57bfb87c4f5cb8c137bb0abef67 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/25] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 5df7b10abf6c2c0dfd7621b553b192f326c839fa Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/25] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 1e90f085c263725f62f20470bd193a719efdc796 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/25] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 258239606c7f377a9a559e71aa5b0ad2dc4d83c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/25] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 88c397477adf6..ab014c5bf9c1b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From e5f511983f5b6ebcb1725052e188e0734d2ea2df Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/25] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 59b72b248a57ab3717e49371a8665ef870920320 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/25] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From fbbb10bb8d4a7b978dd0df0a0f0253d8b3ecfcea Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/25] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 63e83af8e0bd09e9f193120ddc9a69d5508eaa5b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/25] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 1822914109f56ccb12237ad876c8307de555e558 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/25] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 7a3f602afb0c63609a1ddce7a8ec90c6ad15761b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/25] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 50a3dd5b8a35230e98d29600eb1a0ad9bbc1e326 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/25] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 350470fb31b9cc64d688771e75cf87cb2465fb20 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/25] juCi++: rebuild for llvm17

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

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

From b72c5c2b0509d6b5c5144617f62e994363c8319b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/25] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index ab014c5bf9c1b..01e3b7aa57572 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2617,22 +2617,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From f4f36b045e7bf8cb9189317ff58425fb40623c39 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/25] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From 22b033c1cd9450b1f9b2fa287cc33c36ce65f450 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/25] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 150e497e0f4f11650c367f81f69efe598d177c7d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/25] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 2e0c4c46c885e45227f9122a371a2521e2398798 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/25] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From fda35b64c0e219b46e9a5f1498bdc249894560bd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/25] rtags: rebuild for llvm17

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

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

From 1d9c4608fe3ded4cf32e65942cdd0f83ee6d881f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/25] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 8c06495a739cb25f6899fc5719b85489c199a455 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/25] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From a9272b9b45ad3a9a32f9baef2c656694a20e0877 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/25] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 724ee473efa82e06bacad3d9b94ed49aa4513c76 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/25] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 2c893b20cf35a..8f97dac3c863c 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (57 preceding siblings ...)
  2023-12-08  4:12 ` Calandracas606
@ 2023-12-12 17:29 ` Calandracas606
  2023-12-16 19:01 ` Calandracas606
                   ` (59 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-12 17:29 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From 55d801b7049d78bee4df365c556366d92d246ad6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 573 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1066 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 5757ec96c6601..282f7ca841459 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..fd84cd1749ab1
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,573 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove "usr/lib/*LLVMBOLT*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 96bef6dd10597774ed7e0a911454e6d2c9404f56 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/26] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From d3d178e528af581938c6519c260d8d0daf39f6fe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From c13a57c131583f6e35451793b70039e24d93bf33 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/26] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From b72fbc0763dcb20a5d2d54b25255aef762a6b794 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/26] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 920f16b449c3886839bad8de3dc25e5b9529703a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/26] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 052891a5b36e5e5744edc88d76c1c1663adaa55e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 282f7ca841459..b030526198ea9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 17d0c927e29acd32ec2577ff63afb3d366eafdd3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/26] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 08a31735b90eab81d95b1e638bc7fd4c2b5baf83 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/26] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 76fb987c33c82b0cc440f44ad3de36564c3f2527 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/26] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 5cda5bf7d5367f4b56ba50491a0cef30c87042ce Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 a62bf9cfa82058204c4e4c12a54712446ec64385 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/26] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 694390255ddf96b1804d0863202c08c8b2dc1c1b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/26] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 54dd01fc0c078b15d85d89529305bab6feb58d30 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From ee09a11a7fe0ad81a032137cc951376df8f0e77c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/26] juCi++: rebuild for llvm17

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

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

From b22d90845790fb99da06b259508e44848a4715ca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/26] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index b030526198ea9..003acc72c758f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2617,22 +2617,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 3b1f14927a670241c4037f3da526bd0e57b56c27 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/26] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From 729997f246c8a33ed871483a49f0132c5dd8991d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/26] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 447e0d95d6907df3f40baaef0092259c99c687fe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/26] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From d884355d7b4012c88bd26870fc2ca0d325f72e4a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/26] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From e2b701bf8d3e783d143a09438e9965a2841a368d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/26] rtags: rebuild for llvm17

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

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

From 07c9840965cef2b0f0cea5a96d0bf34123bb644a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/26] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 2eb145ad6309815dc9ea8d79e18d2e582ab48244 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/26] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 5c0dcf8d966b92bf1874ebac27d29dd675bfbb0b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 571962e7b3e8d15ffeba530de85c03bd24d8bbf1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/26] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index b0fc2d3cbd734..87258514d685f 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -8,10 +8,10 @@
 # uploaded to https://repo-default.voidlinux.org/distfiles/
 #
 pkgname=rust
-version=1.74.1
-revision=1
+version=1.74.0
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From d2543096ab39c1e8169f621c837357d0e424cbac Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 8 Dec 2023 10:36:06 -0500
Subject: [PATCH 26/26] fixup llvm17

---
 srcpkgs/llvm17/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index fd84cd1749ab1..12eeeb86efb93 100644
--- a/srcpkgs/llvm17/template
+++ b/srcpkgs/llvm17/template
@@ -453,7 +453,6 @@ llvm-bolt_package() {
 	depends="clang>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/bin/*bolt*"
-		vmove "usr/lib/*LLVMBOLT*"
 		vmove usr/share/doc/LLVM/bolt
 	}
 }

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (58 preceding siblings ...)
  2023-12-12 17:29 ` Calandracas606
@ 2023-12-16 19:01 ` Calandracas606
  2023-12-16 19:39 ` Calandracas606
                   ` (58 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-16 19:01 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From f0db4876aa2bcb1fb1e722671bafb6c60d94d7e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/25] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1065 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 393b7436cefa2..e186ab37277bf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From ccfacaf548c47160925d52e1b452c4bb91b38e2a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/25] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 6db47d0624d697d0d465a362d1cf3a55c55544fe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/25] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 6320b322eae339a0979b8bf9fef49a362b84e0b7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/25] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From a7a96dab7b657be392e87f199a0e5e97af9341e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/25] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 338f091c403547f726c0de5844c670b9b05af098 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/25] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 12c62a78560d6ffb9545a8cf68c2f4de9d92b900 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/25] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e186ab37277bf..4675417de38a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 6d90bef3bf4f442d7fb60c86cfb730ecb3829d6b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/25] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From aa052df54bac65f85fdceedb4921ce5ec716b256 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/25] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 264f27b8d4681ae30bb3b193911828aaf79568fb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/25] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 644bb470b785a5401ef127999be92308cb19fbc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/25] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 0cd032ae98993707c55bbd8a0e09e7eeaa706f76 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/25] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 36f33222cd9c0a863bd3037f5573213b88311800 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/25] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From a6bbdf8e15fc254a7ae729accf6d36976cdce044 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/25] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 7d36ec5a2b1599c62350e86a9f01900c20cecb05 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/25] juCi++: rebuild for llvm17

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

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

From 89fd6c6c69b6805f0d20819dd9e90a43306ac731 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/25] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 4675417de38a6..3828d26dd9a88 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2618,22 +2618,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 9aa37e3798e8b68a44f62f376e32fb197854edd1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/25] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From 988110ac93930125d867f54d39147df42e6e4bef Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/25] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 0e95d1696bb13f5956639c02208dbfd393efb099 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/25] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From fcf2333124339c1ce66049f6f61cc59c297f5733 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/25] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 20c16827f84daadc76c269d315f555a72340fa7f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/25] rtags: rebuild for llvm17

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

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

From 5b29e6ba447dfe8c5ae2911366a961cfba2778dd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/25] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 8868569106799fe0bb6ab94e0e8ae421f615bcf1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/25] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From be3cd6f64f40ae3ec5d43b2d612e065159da4fe2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/25] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 738a1e7e3277717fd1b716e9a43ccc83a5bee215 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/25] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index b0fc2d3cbd734..87258514d685f 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -8,10 +8,10 @@
 # uploaded to https://repo-default.voidlinux.org/distfiles/
 #
 pkgname=rust
-version=1.74.1
-revision=1
+version=1.74.0
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (59 preceding siblings ...)
  2023-12-16 19:01 ` Calandracas606
@ 2023-12-16 19:39 ` Calandracas606
  2023-12-17  0:29 ` Calandracas606
                   ` (57 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-16 19:39 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From f0db4876aa2bcb1fb1e722671bafb6c60d94d7e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/25] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1065 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 393b7436cefa2..e186ab37277bf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From ccfacaf548c47160925d52e1b452c4bb91b38e2a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/25] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 6db47d0624d697d0d465a362d1cf3a55c55544fe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/25] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 6320b322eae339a0979b8bf9fef49a362b84e0b7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/25] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From a7a96dab7b657be392e87f199a0e5e97af9341e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/25] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 338f091c403547f726c0de5844c670b9b05af098 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/25] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 12c62a78560d6ffb9545a8cf68c2f4de9d92b900 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/25] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e186ab37277bf..4675417de38a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 6d90bef3bf4f442d7fb60c86cfb730ecb3829d6b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/25] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From aa052df54bac65f85fdceedb4921ce5ec716b256 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/25] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 264f27b8d4681ae30bb3b193911828aaf79568fb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/25] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 644bb470b785a5401ef127999be92308cb19fbc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/25] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 0cd032ae98993707c55bbd8a0e09e7eeaa706f76 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/25] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 36f33222cd9c0a863bd3037f5573213b88311800 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/25] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From a6bbdf8e15fc254a7ae729accf6d36976cdce044 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/25] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 7d36ec5a2b1599c62350e86a9f01900c20cecb05 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/25] juCi++: rebuild for llvm17

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

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

From 89fd6c6c69b6805f0d20819dd9e90a43306ac731 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/25] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 4675417de38a6..3828d26dd9a88 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2618,22 +2618,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 9aa37e3798e8b68a44f62f376e32fb197854edd1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/25] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From 988110ac93930125d867f54d39147df42e6e4bef Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/25] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 0e95d1696bb13f5956639c02208dbfd393efb099 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/25] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From fcf2333124339c1ce66049f6f61cc59c297f5733 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/25] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 20c16827f84daadc76c269d315f555a72340fa7f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/25] rtags: rebuild for llvm17

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

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

From 5b29e6ba447dfe8c5ae2911366a961cfba2778dd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/25] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 8868569106799fe0bb6ab94e0e8ae421f615bcf1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/25] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From be3cd6f64f40ae3ec5d43b2d612e065159da4fe2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/25] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From dc086d755cd236e71d1e7974aa96108b6f744c11 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/25] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index b0fc2d3cbd734..5bcbf7d43a139 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.1
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (60 preceding siblings ...)
  2023-12-16 19:39 ` Calandracas606
@ 2023-12-17  0:29 ` Calandracas606
  2023-12-26 16:34 ` Calandracas606
                   ` (56 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-17  0:29 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From f0db4876aa2bcb1fb1e722671bafb6c60d94d7e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1065 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 393b7436cefa2..e186ab37277bf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From ccfacaf548c47160925d52e1b452c4bb91b38e2a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/26] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 6db47d0624d697d0d465a362d1cf3a55c55544fe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 6320b322eae339a0979b8bf9fef49a362b84e0b7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/26] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From a7a96dab7b657be392e87f199a0e5e97af9341e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/26] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 338f091c403547f726c0de5844c670b9b05af098 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/26] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 12c62a78560d6ffb9545a8cf68c2f4de9d92b900 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e186ab37277bf..4675417de38a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 6d90bef3bf4f442d7fb60c86cfb730ecb3829d6b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/26] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From aa052df54bac65f85fdceedb4921ce5ec716b256 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/26] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index aa7286201de9d..d5d869dcb965c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.0
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 264f27b8d4681ae30bb3b193911828aaf79568fb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/26] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 644bb470b785a5401ef127999be92308cb19fbc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 0cd032ae98993707c55bbd8a0e09e7eeaa706f76 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/26] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 36f33222cd9c0a863bd3037f5573213b88311800 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/26] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From a6bbdf8e15fc254a7ae729accf6d36976cdce044 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 7d36ec5a2b1599c62350e86a9f01900c20cecb05 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/26] juCi++: rebuild for llvm17

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

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

From 89fd6c6c69b6805f0d20819dd9e90a43306ac731 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/26] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 4675417de38a6..3828d26dd9a88 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2618,22 +2618,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 9aa37e3798e8b68a44f62f376e32fb197854edd1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/26] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From 988110ac93930125d867f54d39147df42e6e4bef Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/26] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 0e95d1696bb13f5956639c02208dbfd393efb099 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/26] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From fcf2333124339c1ce66049f6f61cc59c297f5733 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/26] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 20c16827f84daadc76c269d315f555a72340fa7f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/26] rtags: rebuild for llvm17

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

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

From 5b29e6ba447dfe8c5ae2911366a961cfba2778dd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/26] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 8868569106799fe0bb6ab94e0e8ae421f615bcf1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/26] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From be3cd6f64f40ae3ec5d43b2d612e065159da4fe2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From dc086d755cd236e71d1e7974aa96108b6f744c11 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/26] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index b0fc2d3cbd734..5bcbf7d43a139 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.1
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 2a606aa32941bae1384a80dfbee2deee674548d1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 16 Dec 2023 19:26:02 -0500
Subject: [PATCH 26/26] cups-filters: Rebuild against llvm17

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

diff --git a/srcpkgs/cups-filters/template b/srcpkgs/cups-filters/template
index 3f592bdda585a..373eac8dbeaad 100644
--- a/srcpkgs/cups-filters/template
+++ b/srcpkgs/cups-filters/template
@@ -1,7 +1,7 @@
 # Template file for 'cups-filters'
 pkgname=cups-filters
 version=1.28.17
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-static --with-rcdir=no --enable-avahi
  --with-browseremoteprotocols=DNSSD,CUPS

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (61 preceding siblings ...)
  2023-12-17  0:29 ` Calandracas606
@ 2023-12-26 16:34 ` Calandracas606
  2023-12-31  3:58 ` Calandracas606
                   ` (55 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-26 16:34 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From 97ee6361abdb136d6eaa205cac7fdd78aa10f36f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1065 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 6463e020bb473..1d598459aae04 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 0621f5b25ba597391ffed32a234e05f4a754cbb5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/26] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 01d113658d731256c7b9ff8c7dd8c52e64242d75 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 573bc6e6d730e2ba0ab862779d049671685baebf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/26] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 96b9105aa16554efbc2cad789ee3206e92e891a4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/26] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From f92f9f69d69ec641f49c109852573f07a1453df4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/26] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 5babaf81cbd348c8efe40276266d2ecf413f7abf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 1d598459aae04..0383a4d794443 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From da7267c1aafd50d8f176b528a9a3c561e5e129c6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/26] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From c9237db5b8521f0dfb3b3a6a59f05bb4c4eb2863 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/26] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index cc2d8a82ea7c7..09871cd3edd14 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.1
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From f408de4b2389bdd730ac4e8708faf830bb12c7a2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/26] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 04632ad883a99b0f8082eb1e8341501d57095e42 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 eea5d7690431f2bdce695c1e873a5c8d8ed9ef27 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/26] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 1f29d067b90f1c4d9619005772ceb1147ba14d09 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/26] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From c132813510cb1152267d62993a230d661f38f0f9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From c9538ad2cd1d2e46dbe6b2b868e4f24f27b64348 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/26] juCi++: rebuild for llvm17

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

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

From 1caa229dc840fc516498b75899d05fa027c5b854 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/26] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0383a4d794443..20b1d03bea1f4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2618,22 +2618,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From dcb86098e05a0ae536c93f09e5027a5d65d508c5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/26] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From aaf35f94a1a22fd5b6d21a5f56a9934a10bae0b0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/26] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 29f8b66e606eac5c1ecd0731bec883c76fc7dc25 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/26] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From c35ea95784b5e225f919ed6ca33897d217ff3804 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/26] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 9f6473f2054d700b2ea4cc4e51ab062da59f9e1d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/26] rtags: rebuild for llvm17

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

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

From 2dae3e42387c2a4d941185df99a718ca4376e6d4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/26] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From a0a8010de74147e3739b066b43c68bd1cab35897 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/26] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From e74fb88e455511e328e2e2a4583c33f00bf55a7f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 20c82a1fbfcc8f63822d78ce4e2525285d12b84f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/26] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index b0fc2d3cbd734..5bcbf7d43a139 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.1
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 92221e7bed4f92c86b5d9ee275d73eacade7d9d7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 16 Dec 2023 19:26:02 -0500
Subject: [PATCH 26/26] cups-filters: Rebuild against llvm17

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

diff --git a/srcpkgs/cups-filters/template b/srcpkgs/cups-filters/template
index fc711ee1bd76a..5a1c2d4473e86 100644
--- a/srcpkgs/cups-filters/template
+++ b/srcpkgs/cups-filters/template
@@ -1,7 +1,7 @@
 # Template file for 'cups-filters'
 pkgname=cups-filters
 version=1.28.17
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-static --with-rcdir=no --enable-avahi
  --with-browseremoteprotocols=DNSSD,CUPS

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (62 preceding siblings ...)
  2023-12-26 16:34 ` Calandracas606
@ 2023-12-31  3:58 ` Calandracas606
  2024-01-03 21:22 ` Calandracas606
                   ` (54 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2023-12-31  3:58 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From 7ccc7dd21ac34f95755ae78aec8741acd5915c13 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1065 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index c1792cffc77e4..f9ace0facc666 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -980,15 +980,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 7878e7105ce8828fcd9f1ca070f9c4f4f2a56930 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/26] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 834ecd53f3559cd88a609cf062b3e88fe17cb274 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From bcabcc54b40180e50660bdae0332fc403a691f6f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/26] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From a7c8e3a2b5683f0333f87d2352169883ac6dd8df Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/26] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 359a6659c748c7a950a0c1e0c3dfa3a7ded98681 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/26] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From d0bd7d5b855d0ef1575d10aa5738b0fd2a11db39 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index f9ace0facc666..3e6623abc0bcf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,7 +987,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 711c21c300ccb3d65732cb9573d215da3efc28e9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/26] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 75471d332356d88af5e94d92a4b7b39b6e58ac2c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/26] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index cc2d8a82ea7c7..09871cd3edd14 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.1
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 14d6bb54c6b2d0ad0c528b2cd790fddd6d60a12b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/26] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 388559b2d6f9df828ecfed047da8e6095039d8a8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 6c6febce780903ee63ffb1a87761316d4720a97d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/26] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 644e46351075fa190d1862b9d8b4e7c0607d277a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/26] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 0de967636643beb03838c46c096be5e6fe340d73 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 111966bc8d301bed6617e59e70eb121f72f18bed Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/26] juCi++: rebuild for llvm17

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

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

From 26b7071e8b98512fdf95f704b88411dfd8608d57 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/26] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 3e6623abc0bcf..f709ed75a1fce 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2618,22 +2618,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 322dd97e60f421edf2d8230083d5599417ecaa2a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/26] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From e7d6be3ebad003a7284d91a35bc91b238fb911cd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/26] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..f09346c302c0f 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
+version=23.08.2
 revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 740ac308cb4a163169102ef1d43f7a12b532d8cc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/26] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From aaaffe8f4fc20e68ea9bffc7c2d5b972f76086e7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/26] qt6-tools: rebuild for llvm17

---
 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 3f430540ed68a..97d028de2e3e1 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From fb05f80aecd4e12cbeaf9c6a5b682499a0f9aeb5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/26] rtags: rebuild for llvm17

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

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

From b79a666b75da41b50e5c5d7245794f6c56c5d4bc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/26] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 6a0658223e732c5a47069e273fdf3daab5e0ee72 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/26] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From ed331a0f8fc9302c74e79bbeb4700751b9006b66 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 1bec9587b6752f836442045945bb14ee92212b65 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/26] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index b0fc2d3cbd734..5bcbf7d43a139 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.1
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From eb12a6e58e48811d525c0c457e8e9d56862f18da Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 16 Dec 2023 19:26:02 -0500
Subject: [PATCH 26/26] cups-filters: Rebuild against llvm17

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

diff --git a/srcpkgs/cups-filters/template b/srcpkgs/cups-filters/template
index fc711ee1bd76a..5a1c2d4473e86 100644
--- a/srcpkgs/cups-filters/template
+++ b/srcpkgs/cups-filters/template
@@ -1,7 +1,7 @@
 # Template file for 'cups-filters'
 pkgname=cups-filters
 version=1.28.17
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-static --with-rcdir=no --enable-avahi
  --with-browseremoteprotocols=DNSSD,CUPS

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (63 preceding siblings ...)
  2023-12-31  3:58 ` Calandracas606
@ 2024-01-03 21:22 ` Calandracas606
  2024-01-03 21:24 ` Calandracas606
                   ` (53 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-03 21:22 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

**TODO**

- ~ompt-multiplex.h~
- ~libunwind docs~
- ~libcxx docs~
- ~remove sub-packages from llvm15~
- ~rev bump packages with llvm dependencies~

[ci skip]

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

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

From 79e713818721935945f3002fdc4f1aea4fe5b632 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |   2 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1065 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index cc42af6682aad..b624e39207705 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -978,15 +978,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 66242f205baab..24f73810c3aa5 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=2
+revision=3
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 33a349e93013526cb76333e9933377f9e03e97d7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/26] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 28a5a6a57408d01bd858324c0770d5aef528eec6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From cf8d08757dd8050581c66462f45e2692f484cce4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/26] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 1aa415cd8211c297043c85a7c6e20080c4dca68e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/26] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 5faf417b5ef84eccd0ccceea661018b7da653340 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/26] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 8e07b97c54e3497c8cfcae9d184878435a6a824f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index b624e39207705..e4b29c0905c7f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,7 +985,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 892febbf19e303f61b5ea4057ea494d908985c80 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/26] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From c89f22300ffc6c914588728015be49e148d93805 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/26] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 2f29fa6aa20d14056b0e19f107f4f028fc0519e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/26] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 8b6392b42b83b04e2788d0115755a2ac7a8862e9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 f6f1a5ac94c595c160aee4851b72cef7f71204a5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/26] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 930bdfbb2bea5efaf1fb6537203331f6706bd337 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/26] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 1040d5d1a386cf0480c565059a6ea358789b3158 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 9345777356e528a8b8ecb9301e3eb259dc8dad4e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/26] juCi++: rebuild for llvm17

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

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

From e0ef1ad703bcabd9b304bc581334dc0d038899ef Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/26] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e4b29c0905c7f..39685bba83907 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2616,22 +2616,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From d43779e68044eba2aa09cec044544547e6f6804f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/26] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From 5b621706bcac6c3477389971e840f3a2d97b6413 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/26] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..40c0614b6d2fb 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From af82612d78b489cbd5c74690d9f5225e1c99e1ab Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/26] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From d831b7d33631f43161f447db1db8569e908b3379 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 7f49399ec5ec4ccc98b3c838f495a77d62fd58e5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/26] rtags: rebuild for llvm17

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

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

From ac75802d64d28a06f72e2121cea36c66616293a5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/26] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From c17eb63a8efb88e1c6d4c7a71dc58ecf538ff47b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/26] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 0d72fa47d0905afe70610d499790c22a3732cbfb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 15d1f5b42e83fe7d6cca2720b4c73e4f80e10be0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/26] rust: update to 1.74.0.

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index b0fc2d3cbd734..5bcbf7d43a139 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.74.1
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From e5eb01b34690d9ed0621a7d19912109469e73dfd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 16 Dec 2023 19:26:02 -0500
Subject: [PATCH 26/26] cups-filters: Rebuild against llvm17

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

diff --git a/srcpkgs/cups-filters/template b/srcpkgs/cups-filters/template
index fc711ee1bd76a..5a1c2d4473e86 100644
--- a/srcpkgs/cups-filters/template
+++ b/srcpkgs/cups-filters/template
@@ -1,7 +1,7 @@
 # Template file for 'cups-filters'
 pkgname=cups-filters
 version=1.28.17
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-static --with-rcdir=no --enable-avahi
  --with-browseremoteprotocols=DNSSD,CUPS

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (64 preceding siblings ...)
  2024-01-03 21:22 ` Calandracas606
@ 2024-01-03 21:24 ` Calandracas606
  2024-01-08 13:37 ` [PR PATCH] [Updated] " Calandracas606
                   ` (52 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-03 21:24 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1875991410

Comment:
fixed xlint issue

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (65 preceding siblings ...)
  2024-01-03 21:24 ` Calandracas606
@ 2024-01-08 13:37 ` Calandracas606
  2024-01-09  5:08 ` Calandracas606
                   ` (51 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-08 13:37 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

[ci skip]

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

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

From 60dc6b3c622810f15fd797b32148b332bf9583c1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 41 files changed, 1064 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 3d5db5f1c5823..5a6b8af57b443 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -979,15 +979,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From b845870fa59942e89b66f1355d0d27a82efd61ea Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/26] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 25862f269cb5b70245b804ad537ba2fdb69207dd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 92a2f9d162a47647686ad2688389e7053ff26dba Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/26] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 015bd8ba13dffc281295693bf3455abb903d8909 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/26] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 5bf72f738e8fd6f7ffcb127187e4d4f8e5f0a7a0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/26] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From caffbc9435cd98abcf5bdaafdf111703df0438ca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 5a6b8af57b443..0f5f088581d1e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -986,7 +986,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 4acaf3d62c848dfa24369c69aaebf5670e862ea3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/26] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 57193d62c7aeaefce1de4c4a2411d0967ae22b48 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/26] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 06c44bcd6546c4ab918a33c8891b41aa1150ea3e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/26] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From db8216f538a59e6bfc211605f011fa2596799ce2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 664816f9aab09a6a30113e23a41d79eb51d84830 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/26] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 4e9d3d87ee10e142a0cc7bc840b80b2eeaa96458 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/26] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 1884287fa6b23a00771b79193988237deb6a3f52 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 2f14abb6f0a6b99931b491e62d04e1dd7dc80e58 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/26] juCi++: rebuild for llvm17

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

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

From 39d6c4b534e7ed36997cdbb8db83708cf1f04236 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/26] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0f5f088581d1e..d907f8f028899 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2623,22 +2623,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From b89bccdc41c0e98c05b52d6947de862ef3f674f0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/26] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From b9c2a07c6cfb8d6c11c386a8800cdd124823834b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/26] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..40c0614b6d2fb 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 35fc0288f788bed719d99f95a43b09ce1e993a2f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/26] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 093b6aeb295e4c9c696f80a276e9f80dc2799b8e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From c7ecc6a5883bae2165f06b7bd3adcb690bc6a54d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/26] rtags: rebuild for llvm17

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

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

From df53eddc92208cd372108b6320f99f7057265ed7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/26] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 09ec634c1d3f7292afba3659de118e2583867a15 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/26] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From de53c71c6288032c0e1d5044935c5f19949dbef0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From da88de5aed9c1951fdd4a7ca2fa69b3167b1841d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/26] rust: Rebuild against llvm17

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 42ff348004186..b4eb6749ab0b9 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.75.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 9f1091538122ac8d6b19669e7de0d21d32e5036a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 16 Dec 2023 19:26:02 -0500
Subject: [PATCH 26/26] cups-filters: Rebuild against llvm17

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

diff --git a/srcpkgs/cups-filters/template b/srcpkgs/cups-filters/template
index fc711ee1bd76a..5a1c2d4473e86 100644
--- a/srcpkgs/cups-filters/template
+++ b/srcpkgs/cups-filters/template
@@ -1,7 +1,7 @@
 # Template file for 'cups-filters'
 pkgname=cups-filters
 version=1.28.17
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-static --with-rcdir=no --enable-avahi
  --with-browseremoteprotocols=DNSSD,CUPS

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (66 preceding siblings ...)
  2024-01-08 13:37 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-01-09  5:08 ` Calandracas606
  2024-01-09  5:14 ` sbromberger
                   ` (50 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-09  5:08 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

[ci skip]

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

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

From 60dc6b3c622810f15fd797b32148b332bf9583c1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/27] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 41 files changed, 1064 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 3d5db5f1c5823..5a6b8af57b443 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -979,15 +979,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From b845870fa59942e89b66f1355d0d27a82efd61ea Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/27] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 25862f269cb5b70245b804ad537ba2fdb69207dd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/27] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 92a2f9d162a47647686ad2688389e7053ff26dba Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/27] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 015bd8ba13dffc281295693bf3455abb903d8909 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/27] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From 5bf72f738e8fd6f7ffcb127187e4d4f8e5f0a7a0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/27] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From caffbc9435cd98abcf5bdaafdf111703df0438ca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/27] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 5a6b8af57b443..0f5f088581d1e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -986,7 +986,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 4acaf3d62c848dfa24369c69aaebf5670e862ea3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/27] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 57193d62c7aeaefce1de4c4a2411d0967ae22b48 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/27] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 06c44bcd6546c4ab918a33c8891b41aa1150ea3e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/27] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From db8216f538a59e6bfc211605f011fa2596799ce2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/27] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 664816f9aab09a6a30113e23a41d79eb51d84830 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/27] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 4e9d3d87ee10e142a0cc7bc840b80b2eeaa96458 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/27] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 1884287fa6b23a00771b79193988237deb6a3f52 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/27] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 2f14abb6f0a6b99931b491e62d04e1dd7dc80e58 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/27] juCi++: rebuild for llvm17

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

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

From 39d6c4b534e7ed36997cdbb8db83708cf1f04236 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/27] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0f5f088581d1e..d907f8f028899 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2623,22 +2623,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From b89bccdc41c0e98c05b52d6947de862ef3f674f0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/27] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From b9c2a07c6cfb8d6c11c386a8800cdd124823834b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/27] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..40c0614b6d2fb 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From 35fc0288f788bed719d99f95a43b09ce1e993a2f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/27] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 093b6aeb295e4c9c696f80a276e9f80dc2799b8e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/27] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From c7ecc6a5883bae2165f06b7bd3adcb690bc6a54d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/27] rtags: rebuild for llvm17

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

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

From df53eddc92208cd372108b6320f99f7057265ed7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/27] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 09ec634c1d3f7292afba3659de118e2583867a15 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/27] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From de53c71c6288032c0e1d5044935c5f19949dbef0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/27] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From da88de5aed9c1951fdd4a7ca2fa69b3167b1841d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/27] rust: Rebuild against llvm17

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 42ff348004186..b4eb6749ab0b9 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.75.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 9f1091538122ac8d6b19669e7de0d21d32e5036a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 16 Dec 2023 19:26:02 -0500
Subject: [PATCH 26/27] cups-filters: Rebuild against llvm17

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

diff --git a/srcpkgs/cups-filters/template b/srcpkgs/cups-filters/template
index fc711ee1bd76a..5a1c2d4473e86 100644
--- a/srcpkgs/cups-filters/template
+++ b/srcpkgs/cups-filters/template
@@ -1,7 +1,7 @@
 # Template file for 'cups-filters'
 pkgname=cups-filters
 version=1.28.17
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-static --with-rcdir=no --enable-avahi
  --with-browseremoteprotocols=DNSSD,CUPS

From 1d666d88ab2780f7712e31234ec2cc5af37b512c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 27/27] libclc: update to 17.0.6.

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

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (67 preceding siblings ...)
  2024-01-09  5:08 ` Calandracas606
@ 2024-01-09  5:14 ` sbromberger
  2024-01-09  5:59 ` Calandracas606
                   ` (49 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: sbromberger @ 2024-01-09  5:14 UTC (permalink / raw)
  To: ml

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

New comment by sbromberger on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1882425321

Comment:
Thank you for your continued work on this. Any sense of what it's going to take to be merged?

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (68 preceding siblings ...)
  2024-01-09  5:14 ` sbromberger
@ 2024-01-09  5:59 ` Calandracas606
  2024-01-09  6:00 ` Calandracas606
                   ` (48 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-09  5:59 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1882458236

Comment:
> Thank you for your continued work on this. Any sense of what it's going to take to be merged?

I'm just an ordinary contributor so I don't make those calls.

Something I see as problematic is that Zig is hard tied to a  specific llvm release. Currently this PR is using a development snapshot for Zig.

imo it's problematic to have a single package that could potentially be a blocker. It might be possible to avoid this by packaging multiple releases of llvm and of all the tools (clang etc.)

A bigger problem could simply be that this PR has a lot to test and a lot of dependencies. 

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (69 preceding siblings ...)
  2024-01-09  5:59 ` Calandracas606
@ 2024-01-09  6:00 ` Calandracas606
  2024-01-10  3:31 ` [PR PATCH] [Updated] " Calandracas606
                   ` (47 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-09  6:00 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1882458236

Comment:
> Thank you for your continued work on this. Any sense of what it's going to take to be merged?

I'm just an ordinary contributor so I don't make those calls.

Something I see as problematic is that Zig is hard tied to a  specific llvm release. Currently this PR is using a development snapshot for Zig.

imo it's problematic to have a single package (Zig) that could potentially be a blocker. It might be possible to avoid this by packaging multiple releases of llvm and of all the tools (clang etc.)

A bigger problem could simply be that this PR has a lot to test and a lot of dependencies. 

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (70 preceding siblings ...)
  2024-01-09  6:00 ` Calandracas606
@ 2024-01-10  3:31 ` Calandracas606
  2024-01-10 19:51 ` Calandracas606
                   ` (46 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-10  3:31 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

[ci skip]

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

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

From 1df35293f3357974286ead93f516348a0b2d3075 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 41 files changed, 1064 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 454e3b8d267f4..6505dde71b8fc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -979,15 +979,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 0556bacb7278b34a86854130ffcd465c314e112e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/26] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 24c9902a3533b2ad3d629c0faf21848604bf6cc9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 6ee9c42669f793917b947b7aa5fbf986645370b5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/26] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From e6f9842316464886d35da01a02e33f9689e15939 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/26] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From c2cde8e0d6df3e68ec73f3c75e7a290d8c211a20 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/26] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 3325e4b79831eb7c7aeea96be7ca32191c786c5b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 6505dde71b8fc..6bbdb2e7bd278 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -986,7 +986,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 7c1865bd0d5f5bf77fe6c60335c24be1a84de117 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/26] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 2f01c0b475cb94a9bcba22ec0f98edb25998f14c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/26] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From f9eabb79cb243d167409c63fb7e79f8934a408fc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/26] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From b740ac11ddda63ef63b98c4730ae0ed8a30801d4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 1960001126e532a6a67e3da683494ef1f0e3b28a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/26] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 7ec175322675dd68b1266f7ae06dbe5d841e3cff Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/26] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 005c353dbf55e2f00a9c9e9dab57c08c76b1ad58 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 934e5fbe356c1f73a1da1822684fcc59d387a1fd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/26] juCi++: rebuild for llvm17

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

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

From a911c0e55f9d77e30e1b70d1d0a31e14e0580cb3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/26] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 6bbdb2e7bd278..0ce7272abc3c4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2623,22 +2623,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..7b077494b2837 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=577715eeb0d6bce068987a7e66988616e9b483e8ad384901e90254fd209cc513
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 09d84017538e40fb0179c9a947b695635d77e72b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/26] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..b18abb55fa6d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.2
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=943e5a5b00ec1ad2f786145febd3673c8dce73972bfec8db1ad1782ee54038a1

From ee3084aa61811fd44f7dfd19a61205141d74806e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/26] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..40c0614b6d2fb 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.2
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=c408f9f8c94271b4cd9bce861c4f069dcd2df7833652c1f82aff399ec05e41a2
 python_version=3
 
 post_install() {

From b03cd03e2314e9bbac6046b48b5b6f7e3189ec86 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/26] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 8c4f0b39420a820128a099a889b0f4e0eafe3647 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From a6c64d8cb2e57ed02806d08bb21504a34279d930 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/26] rtags: rebuild for llvm17

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

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

From 2269d75e5f95fde6f51b00561be238d075207829 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/26] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 82606594279d9b7a9229f5d7a1036057f912fa7b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/26] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From ad57d4973ed3bb72f2065abd39279a3cf5758a16 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 16ba9511981c107a1b3b825887f7b60b59aa59af Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/26] rust: Rebuild against llvm17

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 42ff348004186..b4eb6749ab0b9 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.75.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From a8f9144bdc408fb98ceee941139c4d9fd42dea1d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 26/26] libclc: update to 17.0.6.

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

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (71 preceding siblings ...)
  2024-01-10  3:31 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-01-10 19:51 ` Calandracas606
  2024-01-11 12:27 ` Luciogi
                   ` (45 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-10 19:51 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

[ci skip]

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

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

From a8c68412ec7a45c5f34b0c6dbf7bb08b58dd4901 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/27] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 41 files changed, 1064 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 27fa3b59ca68d..44c4520fa85b7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 7da00d1d152d605c0783bee10b60a24f8d53f931 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/27] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 85bddfea2418c7c1c6ad0f265e240aae2ec1bd37 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/27] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 9d11b170946aa7941244b45390fe61b8a84fa94c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/27] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 1bc218625597b20c2d3648f40d03712516c3749a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/27] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From aebca176bc5fc2695889916955eb61c23b9fe5e5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/27] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 11aef5d720df908bd2cfd7ff490614f590c86147 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/27] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 44c4520fa85b7..75ac3ce6f24aa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -988,7 +988,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 20df0601339ffcb1df67b7c9dc9f33ab058e4af5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/27] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From db1d1a7903a9dcca03dc553661b4f9a6f1698dc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/27] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 59d2db4c73c2c2e7c63f53acdfcec1f1adc5b333 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/27] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 958ff1da44f4fa3ca3b8e8d39a58312ced8cece5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/27] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 689de0338016c75ff4d59169d93db528640ea450 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/27] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From e07bbb332286c502887dd5a4dc53bf4b88445bb8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/27] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From c3ad0cf3370d32eb93de84837f6c43e858a2e90c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/27] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From cd10f1ad7e54051202357b8555dd857b3bff158d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/27] juCi++: rebuild for llvm17

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

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

From d04723f93d3f99f7e335ca9a73e6a1148588b1bc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/27] kdevelop: update to 23.08.2.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 75ac3ce6f24aa..9f424f1297f7c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2625,22 +2625,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 232e914289ae19c95f334b8d87c402025f41f194 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/27] kdevelop-php: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From f00cf67dac241329964159350dcef8c038de6c19 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/27] kdevelop-python: update to 23.08.2.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 1130683c60d9dd19c1ca07367c78b286f57fc279 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/27] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 192a4000e696611a5c473a6d96eee7cb91697dcd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/27] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From fe384a37cfe71d05dbccadf78129c7efd0b5c4df Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/27] rtags: rebuild for llvm17

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

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

From 56b82eca61742166eb6d42f1a741e731e5cfe92f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/27] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 8157d9d0da88a4265877c45002bafb926c4f3b35 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/27] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From b39c7b86f918ba63f9cbf335255dcb2f8112f2c7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/27] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 2d30d210c1785077876464fefc4a83fca510df32 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/27] rust: Rebuild against llvm17

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 42ff348004186..b4eb6749ab0b9 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.75.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 997bd1f86a632d4012ef82d98ad389ddc7dbd518 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 26/27] libclc: update to 17.0.6.

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

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From fb8c87c8284d96472b9da9a937684938cc7cd130 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 27/27] qtcreator: update to 12.0.1.

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (72 preceding siblings ...)
  2024-01-10 19:51 ` Calandracas606
@ 2024-01-11 12:27 ` Luciogi
  2024-01-11 12:39 ` [PR PATCH] [Updated] " Calandracas606
                   ` (44 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Luciogi @ 2024-01-11 12:27 UTC (permalink / raw)
  To: ml

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

New comment by Luciogi on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1887056936

Comment:
kdevelop* commit message should be 
```
kdevelop-php: update to 23.08.4.
```

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (73 preceding siblings ...)
  2024-01-11 12:27 ` Luciogi
@ 2024-01-11 12:39 ` Calandracas606
  2024-01-11 12:40 ` Calandracas606
                   ` (43 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-11 12:39 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
Additional builds:
- x86_64-musl
- aarch64-musl (cross)
- i686

[ci skip]

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

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

From a8c68412ec7a45c5f34b0c6dbf7bb08b58dd4901 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/27] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/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 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 41 files changed, 1064 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 27fa3b59ca68d..44c4520fa85b7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -981,15 +981,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..12eeeb86efb93
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 7da00d1d152d605c0783bee10b60a24f8d53f931 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/27] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 85bddfea2418c7c1c6ad0f265e240aae2ec1bd37 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/27] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 9d11b170946aa7941244b45390fe61b8a84fa94c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/27] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 1bc218625597b20c2d3648f40d03712516c3749a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/27] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From aebca176bc5fc2695889916955eb61c23b9fe5e5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/27] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 11aef5d720df908bd2cfd7ff490614f590c86147 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/27] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 44c4520fa85b7..75ac3ce6f24aa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -988,7 +988,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 20df0601339ffcb1df67b7c9dc9f33ab058e4af5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/27] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From db1d1a7903a9dcca03dc553661b4f9a6f1698dc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/27] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 59d2db4c73c2c2e7c63f53acdfcec1f1adc5b333 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/27] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 958ff1da44f4fa3ca3b8e8d39a58312ced8cece5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/27] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 689de0338016c75ff4d59169d93db528640ea450 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/27] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From e07bbb332286c502887dd5a4dc53bf4b88445bb8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/27] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From c3ad0cf3370d32eb93de84837f6c43e858a2e90c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/27] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From cd10f1ad7e54051202357b8555dd857b3bff158d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/27] juCi++: rebuild for llvm17

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

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

From c79410f1ba1d7840eb058a1eb66751e616f0e8fd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/27] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 75ac3ce6f24aa..9f424f1297f7c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2625,22 +2625,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From e5e86efda7b1fc6225673e0a773cd834f195fda5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/27] kdevelop-php: update to 23.08.4.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 0a8c3222a8d6cf44f7b253896cd0ff4496f4c69e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/27] kdevelop-python: update to 23.08.4.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 0612339e9057d1fafe7a6f959b046c8a907726b6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/27] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From fed9e5a54c71df3922fbc905f5ed3027cfe524c7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/27] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 5ef5ad6cc2a62f143318c0c1e32805ff9007414e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/27] rtags: rebuild for llvm17

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

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

From e7568f4b9418d3de120cb786aa4a313000e9753a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/27] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From c0b272dd468952d03b5d4df7a1f46070117878c0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/27] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 64a246709840e4eff8784dd0f5f9d1901fcdd9a2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/27] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 9590c0a8b4d7594dd1e53739613949a35dc6ac8a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/27] rust: Rebuild against llvm17

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 42ff348004186..b4eb6749ab0b9 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.75.0
-revision=1
+revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From e8704fcc2d79b58575e8b7b1e7a8d21a8152e5c4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 26/27] libclc: update to 17.0.6.

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

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 576f95ef93bbdf12032495a98ab7d6af97c92997 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 27/27] qtcreator: update to 12.0.1.

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (74 preceding siblings ...)
  2024-01-11 12:39 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-01-11 12:40 ` Calandracas606
  2024-01-11 13:02 ` Calandracas606
                   ` (42 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-11 12:40 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1887080621

Comment:
> kdevelop* commit message should be
> 
> ```
> kdevelop-php: update to 23.08.4.
> ```

nice catch, forgot to update commit message when rebasing

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (75 preceding siblings ...)
  2024-01-11 12:40 ` Calandracas606
@ 2024-01-11 13:02 ` Calandracas606
  2024-01-12 13:07 ` Luciogi
                   ` (41 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-11 13:02 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1887120262

Comment:
build is failing on armv6l-musl

Will need to do some more tests to figure out why

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (76 preceding siblings ...)
  2024-01-11 13:02 ` Calandracas606
@ 2024-01-12 13:07 ` Luciogi
  2024-01-12 13:07 ` Luciogi
                   ` (40 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Luciogi @ 2024-01-12 13:07 UTC (permalink / raw)
  To: ml

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

New comment by Luciogi on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1889152189

Comment:
> build is failing on armv6l-musl
> 
> Will need to do some more tests to figure out why

is there testing repository for llvm 17?
we can test too

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (77 preceding siblings ...)
  2024-01-12 13:07 ` Luciogi
@ 2024-01-12 13:07 ` Luciogi
  2024-01-12 13:23 ` Calandracas606
                   ` (39 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Luciogi @ 2024-01-12 13:07 UTC (permalink / raw)
  To: ml

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

New comment by Luciogi on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1889152189

Comment:
> build is failing on armv6l-musl
> 
> Will need to do some more tests to figure out why

is there testing repository for llvm 17 binaries ?
we can test too

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (78 preceding siblings ...)
  2024-01-12 13:07 ` Luciogi
@ 2024-01-12 13:23 ` Calandracas606
  2024-01-16 19:43 ` [PR REVIEW] " Calandracas606
                   ` (38 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-12 13:23 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1889194553

Comment:
> is there testing repository for llvm 17 binaries ? we can test too

No, to test you will need to checkout the PR and build it. Unfortunately the build can be quite slow

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

* Re: [PR REVIEW] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (79 preceding siblings ...)
  2024-01-12 13:23 ` Calandracas606
@ 2024-01-16 19:43 ` Calandracas606
  2024-01-17 16:30 ` Luciogi
                   ` (37 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-16 19:43 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1453934301

Comment:
armv* builds failing appears to be due to a gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180

We already have this patch file to work around it, but it still isn't working.

I'm completely stumped as to what to do. If anybody has ideas i would love it hear them

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

* Re: [PR REVIEW] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (80 preceding siblings ...)
  2024-01-16 19:43 ` [PR REVIEW] " Calandracas606
@ 2024-01-17 16:30 ` Luciogi
  2024-01-17 16:30 ` Luciogi
                   ` (36 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Luciogi @ 2024-01-17 16:30 UTC (permalink / raw)
  To: ml

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

New review comment by Luciogi on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1456013746

Comment:
Alpine Linux llvm17 is compiled with gcc 13, I should try with gcc 13 too

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

* Re: [PR REVIEW] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (81 preceding siblings ...)
  2024-01-17 16:30 ` Luciogi
@ 2024-01-17 16:30 ` Luciogi
  2024-01-17 17:09 ` Calandracas606
                   ` (35 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Luciogi @ 2024-01-17 16:30 UTC (permalink / raw)
  To: ml

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

New review comment by Luciogi on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1456013746

Comment:
Alpine Linux llvm17 is compiled with gcc 13, you should try with gcc 13 too

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

* Re: [PR REVIEW] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (82 preceding siblings ...)
  2024-01-17 16:30 ` Luciogi
@ 2024-01-17 17:09 ` Calandracas606
  2024-01-26  0:03 ` [PR PATCH] [Updated] " Calandracas606
                   ` (34 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-17 17:09 UTC (permalink / raw)
  To: ml

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

New review comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#discussion_r1456104337

Comment:
> Alpine Linux llvm17 is compiled with gcc 13, you should try with gcc 13 too

Can't build with #45500 because cross-compiling binutils to armv7l fails

A quick check suggests that the bug still exists in gcc 13.2 https://godbolt.org/z/qq1ehaK43

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (83 preceding siblings ...)
  2024-01-17 17:09 ` Calandracas606
@ 2024-01-26  0:03 ` Calandracas606
  2024-01-26  0:06 ` Calandracas606
                   ` (33 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-26  0:03 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686

[ci skip]

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

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

From 7dd44715ac6cec69c10909331044b9bc277bd115 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/27] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 ++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 ++
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1090 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index c75bfe2670907..a815824569f96 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -979,15 +979,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..03e690745a962
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 8246d59abb4aa995d7e9ed5492a95a88b75125dd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:18:25 -0400
Subject: [PATCH 02/27] New package: python3-sphinx-markdown-tables-0.0.17

---
 srcpkgs/python3-sphinx-markdown-tables/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/python3-sphinx-markdown-tables/template

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..0885e33777a25
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,13 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-Markdown"
+short_desc="Sphinx extension for markdown tables"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="https://github.com/ryanfox/sphinx-markdown-tables/archive/refs/tags/v${version}.tar.gz"
+checksum=a99586cd287dc9d2e5ce1f85f7ffa2e3d18afd96ba463d75dcad95527c0073ec

From 92117f8294793f9a6fc41cbfd1253c970639d1a3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 03/27] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From c7d5307eb6154d7ee61bfcc1a03b78d8c541439d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 04/27] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From df852e47f129d0fadb8a6c1515d187c2584e5510 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 05/27] bpftrace: update to 0.19.1.

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 34e56e8c1f595..604d54c991774 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,6 +1,6 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
-version=0.19.0
+version=0.19.1
 revision=1
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
@@ -12,7 +12,7 @@ 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"
-checksum=bcf3964009bfda13718ee1974c4c780434613cf900ecb3b26dd7882a8bebee36
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From b474b84452d238758e1c42f4dec0e935064fc470 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 06/27] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 91c26adfd59a6078fec53275c49f9295b8c3e0db Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 07/27] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index a815824569f96..3484b0e4a3070 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -986,7 +986,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 1830c9c31347c05294fbc86ddfae9a19c7ac7d15 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 08/27] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 6f176e355995113e04e00cdcfee57407da46daa7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 09/27] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 850f34a66f18791468ad3558be1ff27a6946301a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 10/27] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From e48faabd31683f80cb3ec148be98c60c044aa515 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 11/27] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 6e22202e0ceaabb339c22f88a6493ace6ee5708f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 12/27] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From b6e1f41dc976db35c2cad8fca4db7b8be31dc6f1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 13/27] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 56857416e72bda6bb462405e6a7768eb9e31e538 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 14/27] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From dd9d4ab40e48de88055bd894aa274c18baa520c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 15/27] juCi++: rebuild for llvm17

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

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

From 97aa7dd94dbbf531ac9ea31593d020e70d63a566 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 16/27] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 3484b0e4a3070..a520f22dd2a06 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2608,22 +2608,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From e29362eb85dcb830af6627a29169dedf7cd65617 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 17/27] kdevelop-php: update to 23.08.4.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 6b65830a74cb525e9ac2f7ce49067cf589dd9903 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 18/27] kdevelop-python: update to 23.08.4.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From f134b61910cbb8645163a07c03f686a89dc1003e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 19/27] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From feef3712724dc824957a3469c95d56314d416045 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 20/27] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 39cf2f278c3183d21d62a7959a70f4b012fa3639 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 21/27] rtags: rebuild for llvm17

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

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

From e7dee5f2632c8ca14e82e086062f154c079cd122 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 22/27] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 47e0fb10709e7a66d9126a6a82740cfbd4d7015a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 23/27] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From ee6121e0de37d3cd0eff4303847d0e3e94554dfd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 24/27] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 55b31e5573c44..be6da17fc8b86 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm 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=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From d1d4d59f47cab54dca3de30a8e77e21da8834f64 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 25/27] rust: Rebuild against llvm17

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..ba92918b29dce 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 59f9c887fe8e9e8d9c0e846e2ac262b20ee91a21 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 26/27] libclc: update to 17.0.6.

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

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 32378fb9942eb74046bad4af55820248d5a24c5f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 27/27] qtcreator: update to 12.0.1.

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

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

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (84 preceding siblings ...)
  2024-01-26  0:03 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-01-26  0:06 ` Calandracas606
  2024-01-30 13:23 ` [PR PATCH] [Updated] " Calandracas606
                   ` (32 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-26  0:06 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1911196575

Comment:
Fixed building on armv* with workaround

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

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (85 preceding siblings ...)
  2024-01-26  0:06 ` Calandracas606
@ 2024-01-30 13:23 ` Calandracas606
  2024-01-30 13:26 ` Calandracas606
                   ` (31 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-30 13:23 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

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

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

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

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

From 88ffc39d8fbfb9f38d569484243203e35fe27fe9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 ++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 ++
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1090 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..d3a6846177ba5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..03e690745a962
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 03c29292fc7ec83b2076df93072ac79bc3280ddc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 02/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From adcea3e558c199cdc52ce19b72b9a18bd4316cbe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 03/26] CastXML: update to 0.6.2.

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From ceaa846e20c6ee6ab8eb3b031ef851439c4293e4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 04/26] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..b2fb70790c491 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
@@ -12,7 +12,11 @@ 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"
+<<<<<<< HEAD
 checksum=ee70af32b208eff32e59108c9f1dcc569ce207f95babed68db9c408ca617bf08
+=======
+checksum=b520340f28ce4d6f2fb2355f1675b6801ff8498ed9e8bff14abbbf6baff5a08e
+>>>>>>> df852e47f12 (bpftrace: update to 0.19.1.)
 nostrip=yes  # needs to read own symbol table
 
 CXXFLAGS="-isystem ${XBPS_CROSS_BASE}/usr/include/bcc/compat"

From e49ff1eb30332589afd9d666bd7b913e1c925a25 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 05/26] SPIRV-Tools: rebuild for llvm17

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

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From dac555d7426e63bc97f7fb6f23221e350374412c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 06/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d3a6846177ba5..0fb6bc6cca844 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -989,7 +989,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 6f8356a3e15800352b090e73cf21948459dacb1b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/26] SPIRV-Headers: update to 1.3.268.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 02d5465bd8eb821e0b559374c0b4dd536b898593 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/26] mesa: rebuild for llvm17

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 2770e99c728f9876e66c7be160cc244b032bbad3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/26] ccls: rebuild for llvm17

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 915bcaef4f989f4c347129292e227c2d8c8a7915 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 a3f1fb4d91d3fc31eafc755641d5a71d36a28b75 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 11/26] codelite: rebuild for llvm17

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 63bbaae9132655698639abd9b290d88acd969f24 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 12/26] gnome-builder: rebuild for llvm17

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

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 28e15c03333b3e521eae30dc9afb48722eb19716 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 13/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 1d02f370ec86e971b5919d403c44ec110cb458ec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 14/26] juCi++: rebuild for llvm17

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

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

From ca0188390c7879478490bdd80a20b3f820f1da15 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 15/26] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0fb6bc6cca844..555c0f7fd1819 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2609,22 +2609,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From fe67d4aa6dc9c0ba55890954e0fee443bf9c4bee Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 16/26] kdevelop-php: update to 23.08.4.

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

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 6a0528520de016c8cd058949d2cc75eeb208269b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 17/26] kdevelop-python: update to 23.08.4.

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

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 6015803dd2e817c4ce781ebba5562b3ec02e8755 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 18/26] ldc: rebuild for llvm17

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From b336357c87f0f510f46769a1fe88a8f4aad041b7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 19/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From a128b363d4d146933de94b6057a945075350ef55 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 20/26] rtags: rebuild for llvm17

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

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

From dc8b401a9a7ead8e1415d09807281c650ff5e2ee Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 21/26] shiboken2: rebuild for llvm17

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

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From f250d87eb4958f90afc9122df40af7f434ba7fab Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 22/26] tilix: rebuild for llvm17

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

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 03fd65107db33916b6664f394fbaf1106d1e2bec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 23/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..bc0fae6665f2a 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://ziglang.org"
-distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 583c9c1c82f85115df5cd2cd35c49d10c5d0eaad Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 24/26] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..ba92918b29dce 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 6fa71c3e8dac9a5374e7af7408416358ec74ae88 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 25/26] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 947995ab1dbf2b569a063889ea4b4262ca185316 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 26/26] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (86 preceding siblings ...)
  2024-01-30 13:23 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-01-30 13:26 ` Calandracas606
  2024-01-30 22:17 ` Calandracas606
                   ` (30 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-30 13:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 95732 bytes --]

From 88ffc39d8fbfb9f38d569484243203e35fe27fe9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 ++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 ++
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 572 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1090 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..d3a6846177ba5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..03e690745a962
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,572 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+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;lld;mlir;libclc;polly"
+
+_lldb_enable=yes
+_libomp_enable=no
+_flang_enable=no
+_llvm_bolt_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _flang_enable=yes;;
+esac
+
+if [ "$_flang_enable" = "yes" ]; then
+	_enabled_projects+=";flang"
+	subpackages+=" flang flang-devel "
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) _llvm_bolt_enable=yes;;
+esac
+
+if [ "$_llvm_bolt_enable" = "yes" ]; then
+	_enabled_projects+=";bolt"
+	subpackages+=" llvm-bolt "
+fi
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm17 mlir "
+
+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
+}
+
+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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-tblgen
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 03c29292fc7ec83b2076df93072ac79bc3280ddc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 02/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From adcea3e558c199cdc52ce19b72b9a18bd4316cbe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 03/26] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 87900036b422f469915718d2ed7335af108b0bbc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 04/26] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..ff0808df4462c 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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 70297d7456e065b3d32f057471492d0227bc8cd9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 05/26] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 776ee83002f5296e71894b5755fce451201d3537 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 06/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d3a6846177ba5..0fb6bc6cca844 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -989,7 +989,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 128575846f452706dc0fc0051b786978d2259cc8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/26] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From c5265dd1a8865856b9a0e2864c88d844be8c9695 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/26] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From c7c2cef798c3bfcfa06a0d9b2f74ce2f2db95082 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/26] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From e4fd6061ab94c1ba06ea20b94cbf1d8320a36c86 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 8ba61a5ecfc72e63174630b29ae697463d87013a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 11/26] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 1d9ae787cd493ec8dbf955d90372ffd839191077 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 12/26] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 6e9bc4467b0a741c0ea68b8b4333edad3907e533 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 13/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From deb281cebc85b0601dee39dc7d21562194f8902c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 14/26] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..4b40d142462dc 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From b75f5fd6ec1eb120764e23b61a111ce111d1ac5f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 15/26] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0fb6bc6cca844..555c0f7fd1819 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2609,22 +2609,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 3eee02fbeb63609bd76cf30f3abf015d465bbc74 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 16/26] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 4555ca0c595ac112957591478a5e9f64ac6a7995 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 17/26] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 0a97fd5895d5170e3491e6467c609c570af95a89 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 18/26] ldc: rebuild for llvm17

---
 srcpkgs/ldc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From d8d6390eebdbad6c21c05d46a5a02b73f1ce1df6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 19/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From b88941df7e8be3e9728bdd730c382d04e0476d28 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 20/26] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..0067603a23362 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From daa0e2deb460c4fd6d5761ed39518f7d872045d9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 21/26] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From bf3a5d4c57c4a55be015f4c3e3208d21089594d8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 22/26] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From e8f551588c821adb82615dfc36a2deaf22b18de8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 23/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..bc0fae6665f2a 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://ziglang.org"
-distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 3366cae1f547a28b0f7f3c8bedc3196b92f92bc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 24/26] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..ba92918b29dce 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 0072d14efe179e7f036433ccdc3bb21d646819c8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 25/26] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 788a70569695134a2a3b9b98ff31fcc0f4f3299c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 26/26] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (87 preceding siblings ...)
  2024-01-30 13:26 ` Calandracas606
@ 2024-01-30 22:17 ` Calandracas606
  2024-01-30 22:18 ` Calandracas606
                   ` (29 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-30 22:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 95485 bytes --]

From 36338eb9b0113c39723b14117271c3cc31fe3973 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 ++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 ++
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 561 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 42 files changed, 1079 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..d3a6846177ba5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..4976426e06e6d
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,561 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" libclang libclang-cpp clang "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-analyzer clang-tools-extra "
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+subpackages+=" libllvm17 llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel "
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/mlir*"
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+		vmove "usr/lib/libflang*"
+		vmove usr/share/doc/LLVM/flang
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*bolt*"
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 270492feb6a1eda433af087228406d288444f374 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 02/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From afe5e95631088532bf84c373ca027e24213cd6e0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 03/26] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 9281eb28e4512d70afe5bddf5d2190f8a66ed64e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 04/26] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..ff0808df4462c 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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 0ad6fcf6997f196f9a8cf088f83bfcbf1fb394c8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 05/26] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 8662bda98504b5e4c995cbfacde6ee3d51ad4928 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 06/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d3a6846177ba5..0fb6bc6cca844 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -989,7 +989,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From a627961c1afd69c1ff3c69f11174e1f30518b61e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/26] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 1f4fcf8c3b5df20644f968ac3ed011f204fd526c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/26] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From ddae5c9075379f316455051d43c8017e1eb2a27a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/26] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 9657aaea339426f766f021e2895405a16ab0c91c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 411e485469d6021314909bb6e6cfbf8de5567dcc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 11/26] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 50f3ba405b2febc628969630a8869b62a7e6f96a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 12/26] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From b8cf4a1df38e1015c16fdacc9e024556c19ce66b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 13/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 0c16520e9c156d44e446d411a7363ae43123d42e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 14/26] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..4b40d142462dc 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 852256ecfac206c110826001694803b56222f0fa Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 15/26] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0fb6bc6cca844..555c0f7fd1819 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2609,22 +2609,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 8f8fe7d7a92fa9bcdb3a93baa2cea5b812fe45df Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 16/26] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 73dacb11acea85b8834a39637f2fc07dc311cb9b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 17/26] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 853c05ba7f811ac368757351d80975cd5441c3bc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 18/26] ldc: rebuild for llvm17

---
 srcpkgs/ldc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From c151d56e5b301cbb5d86130bcff9d59499759a63 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 19/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 251ce79436f4084c5c4be791c4b4f09542e398b9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 20/26] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..0067603a23362 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From c9ffa494742e2a25fe5f92ea22212440b8c9ca73 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 21/26] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From c143397651302b929c85ee80c2ce5456c15465ef Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 22/26] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From eb30f9b462595550a9dfd8c05df95da6f0fdab98 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 23/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..bc0fae6665f2a 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://ziglang.org"
-distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 82e7200db487006d68fc0aedb26bcfac5b3365f6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 24/26] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..ba92918b29dce 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 695d3b2e450ee0f87dd0c97a6c404e8bd911e9b9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 25/26] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From c31b8f14d1e0a6a290fc68e81f562914750cef77 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 26/26] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (88 preceding siblings ...)
  2024-01-30 22:17 ` Calandracas606
@ 2024-01-30 22:18 ` Calandracas606
  2024-01-31  2:35 ` [PR PATCH] [Updated] " Calandracas606
                   ` (28 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-30 22:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1917993910

Comment:
Cleaned up the template by using options to determine which llvm components should be built

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (89 preceding siblings ...)
  2024-01-30 22:18 ` Calandracas606
@ 2024-01-31  2:35 ` Calandracas606
  2024-01-31  3:01 ` Calandracas606
                   ` (27 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-31  2:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 96461 bytes --]

From 1b6ac83efb96ff28b208bef74af8cce42f0178ae Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 ++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 ++
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 581 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 44 files changed, 1101 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..d3a6846177ba5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..966b857f29353
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,581 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang libclang-cpp "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-analyzer clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/share/man/man1/clang.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	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/include/clang-tidy
+		vmove usr/include/polly
+		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/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.*"
+	}
+}
+
+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/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/libbolt_rt_instr.a
+		vmove usr/lib/libbolt_rt_hugify.a
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+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/lua/5.3/lldb.so
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove usr/lib/python*
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/mlir*"
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/doc/LLVM/llvm/html/CommandGuide/mlir-tblgen.html
+		vmove usr/share/doc/LLVM/llvm/html/_sources/CommandGuide/mlir-tblgen.rst.txt
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/bin/*flang*"
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove usr/share/doc/LLVM/flang
+		vmove "usr/lib/libflang*"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		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/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove "usr/lib/libarcher*.a"
+		vmove "usr/lib/libomp*.a"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 98cc4f41738b704bed499f42f82402336c107acf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 02/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From a77cd0323430d456d4555b7c4489d483c1c24516 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 03/26] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 034401c39a6bc5a10d9796d2ecc161fb4566596e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 04/26] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..ff0808df4462c 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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 40d278ddb3151b47025e5253b4d9a8c50b6c5443 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 05/26] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 33b43fd0bd63c244b5d6c71f8b4b2d6b3dd0b178 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 06/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d3a6846177ba5..0fb6bc6cca844 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -989,7 +989,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 6e3019da5e2eeb2378f1d49e38f7e947c911d161 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/26] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 641c24339f546a6f3a761106173097025c0d31f9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/26] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 09faf4b3a37ff6b79fc3c531ff63faea851872b6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/26] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From a51777bbbb41ed78897ebb9f55185719521a05b0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 6ddd7fdc63d599fc8ace8258c67d2e7b2c66675f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 11/26] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From b9054a24508f4d885a6cba4e0f7a60c8edeb6165 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 12/26] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 13ec89e404dc4a685b7e705e4a43754706840ad2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 13/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From d1ce7fe83dd50398d844f35edecdfda9577e1f0b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 14/26] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..4b40d142462dc 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From ac7ea250a17a90f1a4bd68933c879c7d17be4c8a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 15/26] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0fb6bc6cca844..555c0f7fd1819 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2609,22 +2609,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 6179933de205b329690fdc7c3c8951225c400927 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 16/26] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From e109d19042a5c9c053218cca9bb03fc8d72c5933 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 17/26] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From b9780cd654c33600055b22b3b0e964e223ded077 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 18/26] ldc: rebuild for llvm17

---
 srcpkgs/ldc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 8410f61355acdea0ceaaef35ad851813a8fe888d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 19/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 5d45b6360271e78f43e1ba2823e4a704429ffe1e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 20/26] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..0067603a23362 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 51d9a017069854e00e65817b81777590d86accfd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 21/26] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From baa3bd766d97434eebc167431ef6c56d559df20b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 22/26] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 7008f8ec3d688203364315d3685a3d455eeb07df Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 23/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..bc0fae6665f2a 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://ziglang.org"
-distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 6c4a8562ac46c885f04d19cef2ced8fc65f688bf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 24/26] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..ba92918b29dce 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 9ea285e8030c7db2519423155e907e66e7a43100 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 25/26] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 9cf242964dc93b88333925cd458eb6f051d18d98 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 26/26] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (90 preceding siblings ...)
  2024-01-31  2:35 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-01-31  3:01 ` Calandracas606
  2024-01-31  4:50 ` [PR PATCH] [Updated] " Calandracas606
                   ` (26 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-31  3:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1918296911

Comment:
Working on changes that will allow parallel installations 

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (91 preceding siblings ...)
  2024-01-31  3:01 ` Calandracas606
@ 2024-01-31  4:50 ` Calandracas606
  2024-01-31 17:38 ` Calandracas606
                   ` (25 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-31  4:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 102924 bytes --]

From c7799cfac9e936c8acc8a075c60f742e8fb23c9c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 780 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 44 files changed, 1300 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..d3a6846177ba5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..bb8ae71a5c82a
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,780 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang libclang-cpp "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-analyzer clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-devel llvm17-tools "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/share/man/man1/clang.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/include/clang-tidy
+		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/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/share/doc/LLVM/polly
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+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.*"
+	}
+}
+
+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/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+	}
+}
+
+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/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-include-cleaner
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		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/bin/run-clang-tidy
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/bin/git-clang-format
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/libbolt_rt_instr.a
+		vmove usr/lib/libbolt_rt_hugify.a
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		vmove usr/share/doc/LLVM/bolt
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		vmove /usr/lib/lua/5.3/lldb.so
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove usr/share/doc/LLVM/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		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/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove "usr/lib/libarcher*.a"
+		vmove "usr/lib/libomp*.a"
+		vmove "usr/lib/libomptarget*.bc"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove usr/share/doc/LLVM/llvm
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+	}
+}
+
+llvm17-tools_package() {
+	short_desc+=" - development tools"
+	pkg_install() {
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 1192bcfbbbc860f63e3ec522b5356ce15fe6fa49 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 02/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From bda05b34bc7776722842cecd494c39b283bbd0c8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 03/26] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From a01feee5403fad0942121828e96931c1e55e5034 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 04/26] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..ff0808df4462c 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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 bacc9ae0938025d18999dea6a190d5eba4fc813a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 05/26] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From daf42057635b5e88030320724c1723166fb17766 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 06/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d3a6846177ba5..0fb6bc6cca844 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -989,7 +989,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 2a52498283d51a8878ea171998610c52bf4e861b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/26] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 1ecee0f6ce41f7d2a29f2fa5ca1cfa377f5a1782 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/26] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 4dae696a6effb7080e8a7b5cbde6aa2378927906 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/26] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 646259fb061e25c19bdecb19ce5abff762b829e9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 f28d7028dfb3b7cea9a1716dc67ecc188b24f62b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 11/26] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 3d3693740da7fa8a38b0845a129914f73cc91671 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 12/26] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 9be892e68cbd691e5bb62b56da2bbed9d7df84be Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 13/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From e6445adfb00078153fda5e48e50cf6d16b904eae Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 14/26] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..4b40d142462dc 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From daab4fa32e664128f542af4e170295c7e9b2916f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 15/26] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0fb6bc6cca844..555c0f7fd1819 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2609,22 +2609,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From bc5174caf9a046088d923100111756e4949120cc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 16/26] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From b9d37c8f6cc43651b58207d5fd484aa855f82fd7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 17/26] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 0e2969835a7c0d585fdeecdfdb9828abc6da9523 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 18/26] ldc: rebuild for llvm17

---
 srcpkgs/ldc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From fdb9a3752cffc2fdf64882eb4683b8654426a12e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 19/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 56f3a74a733ac7f9f5d62d19bb52474e633a090c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 20/26] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..0067603a23362 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From e73b2abf1078fba859f5c58ccb384ab819dc0cff Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 21/26] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 3fe9cbac90916f630a1a28f14ba8fc102901cfc2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 22/26] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 8d8b0b9be75aab0c3faa656860a35745d58d3bb1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 23/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..bc0fae6665f2a 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://ziglang.org"
-distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 13afd2daf0fe0962802e8fcbd04216339992543d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 24/26] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..ba92918b29dce 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 203913acba7af994821d556fe2fc9dc40002df48 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 25/26] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 79f8128f800e24432c914fe4ae3ba76bbe9f0b97 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 26/26] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (92 preceding siblings ...)
  2024-01-31  4:50 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-01-31 17:38 ` Calandracas606
  2024-01-31 20:58 ` Calandracas606
                   ` (24 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-31 17:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 104011 bytes --]

From 04cadc30048ea8510c47ccc983578622603c8a6f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm17-devel                          |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 806 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 45 files changed, 1327 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..d3a6846177ba5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..fd922d33cf1c3
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,806 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang libclang-cpp clang-analyzer "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		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/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/share/doc/LLVM/polly
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+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.*"
+	}
+}
+
+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/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		vmove usr/share/doc/LLVM/bolt
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove usr/lib/libbolt_rt_instr.a
+			vmove usr/lib/libbolt_rt_hugify.a
+		fi
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove usr/share/doc/LLVM/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-devel_package() {
+	pycompile_dirs="usr/share/opt-viewer"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/share/opt-viewer
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove usr/share/doc/LLVM/llvm
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/lib/LLVMgold.so
+		vmove usr/lib/cmake/llvm
+
+		# Development Tools
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/bin/llvm-addr2line
+		vmove usr/bin/llvm-bitcode-strip
+		vmove usr/bin/llvm-dlltool
+		vmove usr/bin/llvm-install-name-tool
+		vmove usr/bin/llvm-lib
+		vmove usr/bin/llvm-otool
+		vmove usr/bin/llvm-ranlib
+		vmove usr/bin/llvm-readelf
+		vmove usr/bin/llvm-strip
+		vmove usr/bin/llvm-windres
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From d5fa6710abd2ac77d5417761d38ddc1bcadd4353 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 02/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From 946796b9e6ce460375ed24e09566b100c05e3886 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 03/26] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 3d7bcfd947dc527491e25a35c7e47252c9ca5e11 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 04/26] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..ff0808df4462c 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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 813db2b51783315aafc1146521d856786234f974 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 05/26] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From ed005ceb303bd61155251ec8c192763d3897401f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 06/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d3a6846177ba5..0fb6bc6cca844 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -989,7 +989,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 30b72cfa9eebe4c73ce6d3ce85452496681e89cd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/26] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 441358e2f05bd34160562e45bff72626b56f377b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/26] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 78bb62b4ca74777165001845647341bbde6402ec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/26] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 908f5c20f794e319b2e6d2fe8016b65fd39b5707 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 091d985f40577d061059afd408d51502d5efe448 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 11/26] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From b95935a11aca69741b295597a155b6fb59ca22ba Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 12/26] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 85d744a9579e3aaacad95857e14f8f132de571a3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 13/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 2c04b14fbb4662a25672ec78704bfab299155906 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 14/26] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..4b40d142462dc 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From d86f813fd42b32c3639708f17ee25b309d596843 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 15/26] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0fb6bc6cca844..555c0f7fd1819 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2609,22 +2609,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 7723fd7432af39bb34c07e40cdf4d96f29a65e29 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 16/26] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From a019ebaf7d27c9a9183ecde910f5152a692a4cf2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 17/26] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From a1113974447d7b360bd17843f35545819a9bb214 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 18/26] ldc: rebuild for llvm17

---
 srcpkgs/ldc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 1345b88becfbfbfd5d2b60a493d8911b8180c007 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 19/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From ab86dbfc935b250e064df6e0403e9ce3f1f1d642 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 20/26] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..0067603a23362 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 54b8270b8e261b85fe91b1fc57f1a0150c6b5135 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 21/26] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 88c9643750bf9b1a61ad0bbd6accd9f99fb9fff2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 22/26] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 2eb263530fc55c13050ee504c0b546ddb006afbb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 23/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..bc0fae6665f2a 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://ziglang.org"
-distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From fbd37a920b8665dc10bc0403b6390edff54f282b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 24/26] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..ba92918b29dce 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From f3d52a967f5b432bddb56be2aeb86c2d0639f89d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 25/26] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From e6cdef0a156c307e7993ccab58e2bad8c5e9347d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 26/26] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (93 preceding siblings ...)
  2024-01-31 17:38 ` Calandracas606
@ 2024-01-31 20:58 ` Calandracas606
  2024-01-31 21:42 ` Calandracas606
                   ` (23 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-31 20:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 104590 bytes --]

From dc599fd6cbfa1859aed226d98cf89fe03eaf1496 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/26] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/clang17                               |   1 +
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm17-devel                          |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 816 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 46 files changed, 1338 insertions(+), 24 deletions(-)
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..d3a6846177ba5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..bed7398d28227
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,816 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang17 clang-devel libclang libclang-cpp clang-analyzer "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend - Version 17"
+	pkg_install() {
+		vmove usr/bin/clang-17
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision} clang17-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		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/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/share/doc/LLVM/polly
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+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.*"
+	}
+}
+
+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/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		vmove usr/share/doc/LLVM/bolt
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove usr/share/doc/LLVM/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-devel_package() {
+	pycompile_dirs="usr/share/opt-viewer"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/share/opt-viewer
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove usr/share/doc/LLVM/llvm
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/lib/LLVMgold.so
+		vmove usr/lib/cmake/llvm
+
+		# Development Tools
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/bin/llvm-addr2line
+		vmove usr/bin/llvm-bitcode-strip
+		vmove usr/bin/llvm-dlltool
+		vmove usr/bin/llvm-install-name-tool
+		vmove usr/bin/llvm-lib
+		vmove usr/bin/llvm-otool
+		vmove usr/bin/llvm-ranlib
+		vmove usr/bin/llvm-readelf
+		vmove usr/bin/llvm-strip
+		vmove usr/bin/llvm-windres
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From abca0101253e358347aeae6e9b05cd08eef87aec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 09:02:42 -0400
Subject: [PATCH 02/26] llvm15: remove bumped subpackages

---
 srcpkgs/llvm15/template | 287 +---------------------------------------
 1 file changed, 2 insertions(+), 285 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..0ea8babf4be7b 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -54,59 +54,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*|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 \
@@ -153,8 +101,7 @@ 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
 		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
@@ -164,7 +111,6 @@ pre_configure() {
 		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
 
@@ -212,235 +158,6 @@ do_install() {
 		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() {

From df391776e549983fe7310cc636f6e99c4f3d508c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 03/26] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From cefd52e9da3ffebd308de5ffb9e08cf97232f9cf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 04/26] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..ff0808df4462c 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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 270533689fde746af3269880a29537225b862b17 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 05/26] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From dfa13861efa8346b99daf45924993ae7ca6fea97 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 06/26] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d3a6846177ba5..0fb6bc6cca844 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -989,7 +989,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 347abea07e48b74128c1040eb9d06ccb5840cf99 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/26] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 1f8c548f69f6666ed416f8ddc3530235fcc864eb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/26] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From 06140f1e62d2f5f7f84abfd840c9d86dfd5fbcae Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/26] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 41913efa3106b2fbeedea098d670fdcd354411f3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/26] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 5f57263549da579c8a97dbb433e450d2912703cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 11/26] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From cf85a74294e4c023b49f57d0f6b05ec8285cc20e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 12/26] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 2125f7f1bce08b727561d75323b9657a26611a4d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 13/26] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From eb14ca648f9d6271997d54973f59ee1b90c44028 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 14/26] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..4b40d142462dc 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From d84ac5e6aefd5c1e66c5b94ea192574fa7296130 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 15/26] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0fb6bc6cca844..555c0f7fd1819 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2609,22 +2609,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From e095a176003605199af97d65777ac161db139cf7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 16/26] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From c74056b06f24953742e0b26501e5497374c4cc30 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 17/26] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From ed5d594d8db17c0fa51662138b01069afa67fc61 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 18/26] ldc: rebuild for llvm17

---
 srcpkgs/ldc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From 471ce81139be3dca60f3ba598a66769e0da2970a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 19/26] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From a3af1c47147c65b8513d2b57301d406410946073 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 20/26] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..0067603a23362 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From a43a26e3174b090682a674b94d2657b6d4b66c01 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 21/26] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 6b3a7dbcaf521290eb279273631665f86a156c95 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 22/26] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 2eeb3c0d7170636f00d649c0f4df03e8d6ae7499 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 23/26] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..bc0fae6665f2a 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://ziglang.org"
-distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From f02bd174233904e37e468c06e6f2aad3e3b585cf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 24/26] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..ba92918b29dce 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From 95eb6f5d68279957488d0f055c65f1a780959e1c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 25/26] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 5035bccc0eb33a06530a815b244fac5488beb062 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 26/26] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (94 preceding siblings ...)
  2024-01-31 20:58 ` Calandracas606
@ 2024-01-31 21:42 ` Calandracas606
  2024-02-01  3:41 ` Calandracas606
                   ` (22 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-01-31 21:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 106575 bytes --]

From 3fb2482562daeadb42d8a6dfc45284fdbfb45824 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/25] New package: llvm17

---
 common/shlibs                                 |   9 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-analyzer15                      |   1 +
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/clang-tools-extra15                   |   1 +
 srcpkgs/clang15                               |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15                              |   1 +
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15                           |   1 +
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/libomp15                              |   1 +
 srcpkgs/libomp15-devel                        |   1 +
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm-libunwind15                      |   1 +
 srcpkgs/llvm-libunwind15-devel                |   1 +
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |  75 +-
 srcpkgs/llvm17-devel                          |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 807 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 64 files changed, 1382 insertions(+), 63 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libcxx15
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/libomp15
 create mode 120000 srcpkgs/libomp15-devel
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-libunwind15
 create mode 120000 srcpkgs/llvm-libunwind15-devel
 create mode 120000 srcpkgs/llvm17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..d3a6846177ba5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,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.17 lldb-17.0.3_1
+libclang.so.17 libclang-17.0.3_1
+libclang-cpp.so.17 libclang-cpp-17.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
+libLLVM-17.so libllvm17-17.0.3_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
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15 b/srcpkgs/libcxx15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15 b/srcpkgs/libcxxabi15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp15 b/srcpkgs/libomp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp15-devel b/srcpkgs/libomp15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15 b/srcpkgs/llvm-libunwind15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15-devel b/srcpkgs/llvm-libunwind15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..bdd9b40ef82e7 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -34,8 +34,8 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -68,12 +68,12 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
 esac
 
-subpackages="clang-tools-extra"
+subpackages="clang-tools-extra15"
 
 # must go before clang
 if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
+	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
 	depends+=" libomp>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
@@ -83,17 +83,17 @@ if [ "$_libomp_enable" = "yes" ]; then
 	fi
 fi
 
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm15"
+subpackages+=" clang15 clang-analyzer15 libclang15 libclang-cpp15
+ llvm-libunwind15 llvm-libunwind15-devel libcxx15 libcxx15-devel
+ libcxxabi15 libcxxabi15-devel libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -224,9 +224,9 @@ do_install() {
 		644 usr/include/mach-o
 }
 
-clang-analyzer_package() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +237,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -279,10 +279,10 @@ clang-tools-extra_package() {
 	}
 }
 
-clang_package() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -302,21 +302,21 @@ clang_package() {
 	}
 }
 
-libclang_package() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -329,11 +329,11 @@ lld_package() {
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +341,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +353,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,16 +363,16 @@ lldb-devel_package() {
 	}
 }
 
-llvm-libunwind_package() {
+llvm-libunwind15_package() {
 	short_desc+=" - libunwind"
 	pkg_install() {
 		vmove "usr/lib/libunwind.so.*"
 	}
 }
 
-llvm-libunwind-devel_package() {
+llvm-libunwind15-devel_package() {
 	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
+	depends="llvm-libunwind15>=${version}_${revision}"
 	conflicts="libunwind-devel>=0"
 	pkg_install() {
 		vmove usr/include/mach-o
@@ -383,16 +383,16 @@ llvm-libunwind-devel_package() {
 	}
 }
 
-libcxxabi_package() {
+libcxxabi15_package() {
 	short_desc+=" - low level support for libc++"
 	pkg_install() {
 		vmove "usr/lib/libc++abi.so.*"
 	}
 }
 
-libcxxabi-devel_package() {
+libcxxabi15-devel_package() {
 	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
+	depends="libcxxabi15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/*cxxabi*"
 		vmove "usr/lib/libc++abi.so"
@@ -400,16 +400,16 @@ libcxxabi-devel_package() {
 	}
 }
 
-libcxx_package() {
+libcxx15_package() {
 	short_desc+=" - C++ standard library"
 	pkg_install() {
 		vmove "usr/lib/libc++.so.*"
 	}
 }
 
-libcxx-devel_package() {
+libcxx15-devel_package() {
 	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
+	depends="libcxx15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/c++
 		vmove "usr/lib/libc++.so"
@@ -419,19 +419,16 @@ libcxx-devel_package() {
 	}
 }
 
-libomp_package() {
+libomp15_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() {
+libomp15-devel_package() {
 	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
+	depends="libomp15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/omp*.h"
 		vmove "usr/lib/clang/${version}/include/omp*.h"
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..1aa81e94524ee
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,807 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang libclang-cpp clang-analyzer "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		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/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/share/doc/LLVM/polly
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+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.*"
+	}
+}
+
+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/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		vmove usr/share/doc/LLVM/bolt
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove usr/share/doc/LLVM/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-devel_package() {
+	pycompile_dirs="usr/share/opt-viewer"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/share/opt-viewer
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove usr/share/doc/LLVM/llvm
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/lib/LLVMgold.so
+		vmove usr/lib/cmake/llvm
+
+		# Development Tools
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/bin/llvm-addr2line
+		vmove usr/bin/llvm-bitcode-strip
+		vmove usr/bin/llvm-dlltool
+		vmove usr/bin/llvm-install-name-tool
+		vmove usr/bin/llvm-lib
+		vmove usr/bin/llvm-otool
+		vmove usr/bin/llvm-ranlib
+		vmove usr/bin/llvm-readelf
+		vmove usr/bin/llvm-strip
+		vmove usr/bin/llvm-windres
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From fe82cd076e5ad55c5986f817b60f1e528fd83092 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/25] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..c59fd4e0ee040 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
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 6f67e54aa3ef55316b79d151ed69682c91035162 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/25] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..ff0808df4462c 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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 88fce46fb4c075dc5a9955cd1d83b203c34f240f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/25] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 7b26c4cc24371ee161baa192a9d01d2d4aec1246 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/25] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d3a6846177ba5..0fb6bc6cca844 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -989,7 +989,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-17.so libllvm17-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 48bdacd2fa8784ae867853aa2ba63f52192f1da1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/25] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 78b5fe7fde1c840611912ea5d2db22cf1e6aa1ea Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/25] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..f87669c10e45c 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled

From bc4ad56768b8cbca52fc8ffa6a169029e74cc025 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/25] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From ec0ba6ae3ce562515608dd899c216d9c8b601133 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/25] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  2 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..bdec40488d6a4 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 a285ee31b0b3c8948bf49a6f6f3dd9da2b070238 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 10/25] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From a2fdafff9d41eeee876fdc767f0f81174b843a95 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 11/25] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..45b89ab3bb159 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,7 +1,7 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"

From 9372c7229abfe0c0624fc5ce3b30b0da1213c2fc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 12/25] include-what-you-use: update to 0.20.

---
 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 1a30bc04bb2db..a2b1d3ea32b1e 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.19
+version=0.20
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 08911a0fa8c80e26efa405874a617b3ca092b8e2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 13/25] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..4b40d142462dc 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 25fb4eaec498d3e8a24b513649466bc3bb568a9c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 14/25] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0fb6bc6cca844..555c0f7fd1819 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2609,22 +2609,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..64b90ee141502 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
@@ -9,7 +9,7 @@ hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 7413cefa7d8a1de886d4a9749063376a5a1a0153 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 15/25] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From bb86fca3da9f445763b200a25c76ca2b7272e591 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 16/25] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From d999bb950bf3a5bdb2a8b08c24a6d7342b981f81 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 17/25] ldc: rebuild for llvm17

---
 srcpkgs/ldc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From a81dda9a2efbb2e47da4d20a0536ef42ab5fb808 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 18/25] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..82e351d38364c 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.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
@@ -13,7 +13,7 @@ makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
  gumbo-parser-devel icu-devel llvm clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 5d6de2928ceffe6cbc343de87c58794e3e374c5c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 19/25] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..0067603a23362 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 4b4bb4148de851849d3772efb206ff17a59c346d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 20/25] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..f3c06ec245a1f 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake

From 3c9babb6598bcdab977eeffac5cd6f359eb79771 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 21/25] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..77da7f7940caf 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=8
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From e76959f6d4b5a161254b42d384f19744153a3ec7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 22/25] zig: update to 0.12.0.dev.1390.

---
 srcpkgs/zig/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..bc0fae6665f2a 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,20 +1,22 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.10.1
-revision=2
+version=0.12.0.dev.1390
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang llvm lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://ziglang.org"
-distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
+#distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
+# zig 12 needs llvm == 17
+distfiles="https://ziglang.org/builds/zig-0.12.0-dev.1390+94cee4fb2.tar.xz"
+checksum=621fc37bb70c4ce4e2edbbade19ef055404793e2289f6daed92c34269bcad1eb
 nopie=yes
 nocross=yes
 

From 00e57c4aa53fd20178c4b4e7da0bc8c656bc3186 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 23/25] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..ba92918b29dce 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"

From a3a8add82d82cb5b3b37304c92263df91cca7d7d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 24/25] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..617a84884c431 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,6 +1,6 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # disable clspv (failing tests, we don't ship it)
@@ -13,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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 66d9126e1260b61164b9560bd42094da06816d97 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 25/25] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..0f6eb6e4cb730 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,6 +1,6 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (95 preceding siblings ...)
  2024-01-31 21:42 ` Calandracas606
@ 2024-02-01  3:41 ` Calandracas606
  2024-02-01  4:01 ` Calandracas606
                   ` (21 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-01  3:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 131552 bytes --]

From 601580dd22769d7a735147c52c45f035784102cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/44] New package: llvm17

---
 common/shlibs                                 |  17 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-analyzer15                      |   1 +
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/clang-tools-extra15                   |   1 +
 srcpkgs/clang15                               |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15                              |   1 +
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15                           |   1 +
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/libomp15                              |   1 +
 srcpkgs/libomp15-devel                        |   1 +
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-devel                            |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm-libunwind15                      |   1 +
 srcpkgs/llvm-libunwind15-devel                |   1 +
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |  75 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 817 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 64 files changed, 1398 insertions(+), 65 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libcxx15
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libomp15
 create mode 120000 srcpkgs/libomp15-devel
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-devel
 create mode 120000 srcpkgs/llvm-libunwind15
 create mode 120000 srcpkgs/llvm-libunwind15-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..26204361d967e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,20 @@ 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.17 lldb-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm-17.0.3_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
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.15 libomp15-15.0.7_4
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15 b/srcpkgs/libcxx15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15 b/srcpkgs/libcxxabi15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp15 b/srcpkgs/libomp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp15-devel b/srcpkgs/libomp15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-devel b/srcpkgs/llvm-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15 b/srcpkgs/llvm-libunwind15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15-devel b/srcpkgs/llvm-libunwind15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..bdd9b40ef82e7 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -34,8 +34,8 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -68,12 +68,12 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
 esac
 
-subpackages="clang-tools-extra"
+subpackages="clang-tools-extra15"
 
 # must go before clang
 if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
+	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
 	depends+=" libomp>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
@@ -83,17 +83,17 @@ if [ "$_libomp_enable" = "yes" ]; then
 	fi
 fi
 
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm15"
+subpackages+=" clang15 clang-analyzer15 libclang15 libclang-cpp15
+ llvm-libunwind15 llvm-libunwind15-devel libcxx15 libcxx15-devel
+ libcxxabi15 libcxxabi15-devel libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -224,9 +224,9 @@ do_install() {
 		644 usr/include/mach-o
 }
 
-clang-analyzer_package() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +237,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -279,10 +279,10 @@ clang-tools-extra_package() {
 	}
 }
 
-clang_package() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -302,21 +302,21 @@ clang_package() {
 	}
 }
 
-libclang_package() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -329,11 +329,11 @@ lld_package() {
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +341,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +353,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,16 +363,16 @@ lldb-devel_package() {
 	}
 }
 
-llvm-libunwind_package() {
+llvm-libunwind15_package() {
 	short_desc+=" - libunwind"
 	pkg_install() {
 		vmove "usr/lib/libunwind.so.*"
 	}
 }
 
-llvm-libunwind-devel_package() {
+llvm-libunwind15-devel_package() {
 	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
+	depends="llvm-libunwind15>=${version}_${revision}"
 	conflicts="libunwind-devel>=0"
 	pkg_install() {
 		vmove usr/include/mach-o
@@ -383,16 +383,16 @@ llvm-libunwind-devel_package() {
 	}
 }
 
-libcxxabi_package() {
+libcxxabi15_package() {
 	short_desc+=" - low level support for libc++"
 	pkg_install() {
 		vmove "usr/lib/libc++abi.so.*"
 	}
 }
 
-libcxxabi-devel_package() {
+libcxxabi15-devel_package() {
 	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
+	depends="libcxxabi15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/*cxxabi*"
 		vmove "usr/lib/libc++abi.so"
@@ -400,16 +400,16 @@ libcxxabi-devel_package() {
 	}
 }
 
-libcxx_package() {
+libcxx15_package() {
 	short_desc+=" - C++ standard library"
 	pkg_install() {
 		vmove "usr/lib/libc++.so.*"
 	}
 }
 
-libcxx-devel_package() {
+libcxx15-devel_package() {
 	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
+	depends="libcxx15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/c++
 		vmove "usr/lib/libc++.so"
@@ -419,19 +419,16 @@ libcxx-devel_package() {
 	}
 }
 
-libomp_package() {
+libomp15_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() {
+libomp15-devel_package() {
 	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
+	depends="libomp15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/omp*.h"
 		vmove "usr/lib/clang/${version}/include/omp*.h"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..528a9cee37996
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,817 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang libclang-cpp clang-analyzer "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm llvm-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		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/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/share/doc/LLVM/polly
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+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.*"
+	}
+}
+
+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/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		vmove usr/share/doc/LLVM/bolt
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove usr/share/doc/LLVM/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm-devel_package() {
+	pycompile_dirs="usr/share/opt-viewer"
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/share/opt-viewer
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove usr/share/doc/LLVM/llvm
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/lib/LLVMgold.so
+		vmove usr/lib/cmake/llvm
+
+		# Development Tools
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/bin/llvm-addr2line
+		vmove usr/bin/llvm-bitcode-strip
+		vmove usr/bin/llvm-dlltool
+		vmove usr/bin/llvm-install-name-tool
+		vmove usr/bin/llvm-lib
+		vmove usr/bin/llvm-otool
+		vmove usr/bin/llvm-ranlib
+		vmove usr/bin/llvm-readelf
+		vmove usr/bin/llvm-strip
+		vmove usr/bin/llvm-windres
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From b4b51bab5bf86819f392a91abb2a907d4cddc768 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/44] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..8efb70113fb30 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 06e4dbed0703f6214fbbfdbae402840a9002a0a0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/44] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..ff0808df4462c 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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 6a3ec5558ab61c4939cb218d7b439a8d3d0186cf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/44] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From ae87c4038f8e0aeee3c8d27c7effa7f9353c9835 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/44] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 26204361d967e..050b15a8a4f83 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-17.0.6_1
 libomptarget.so.15 libomp15-15.0.7_4
 libomptarget.so.17 libomp-17.0.3_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..65c609bdc9294 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -14,7 +14,7 @@ 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 06903768a2374c243030a5e7eb13d54279715f09 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:13:47 -0500
Subject: [PATCH 06/44] spirv-llvm

---
 srcpkgs/SPIRV-LLVM-Translator/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index 65c609bdc9294..a34368ee7797f 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -7,8 +7,8 @@ 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 llvm-devel"
+makedepends="clang-tools-extra llvm-devel SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"

From 22e6df15102386be8f572c36d1f09623b8a298da Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/44] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 131e7cb4d5c26c163f5aba4f55ac18c75f00a0e2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/44] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..9985f41576bdb 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex llvm-devel pkg-config python3-Mako glslang
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From f36c89e8a8485ce0f7a1e0913ff23228a9cd9df1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/44] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d0b21fa9cbb1d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"

From 8bd8252cbd5af7151683f5364992ec6d6ed4e732 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/44] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  6 +--
 3 files changed, 114 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..62ac45e1b933a 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
-hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+hostmakedepends="llvm-devel"
+makedepends="clang llvm-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 9fe38d2a780f13b21e57a93e82c89a21dd1e1a59 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 11/44] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From fbf57dedd08590b63ed27882cfd9bbf79cb8cd77 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 12/44] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..e75cb131ff4b5 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,12 +1,12 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+ llvm-devel mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
 makedepends="cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel

From 9f080d381963e3d0f865a2c841274bb1bf34cb4b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 13/44] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..1b8b034641953 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 468024b085f346eaf1ba132d1aadcae388b2583e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 14/44] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..4b40d142462dc 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 869c5aa6438dcd22e41b684c14b09c76ecd19aea Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 15/44] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 10 +++++-----
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 050b15a8a4f83..df2e82b8e1494 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2613,22 +2613,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..e3fc424d535b9 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm-devel tar which"
 makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 2f90d8a95e27238e80b86d210395906c2350397d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 16/44] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 4c7a5f851765ed9c64762ffdbefd0bd668998a26 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 17/44] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 15830ec56b5bb5e2bb58f4982cb5cfd7a1a364f3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 18/44] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 6 +++---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index df2e82b8e1494..251e463c070e7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2148,10 +2148,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..c95ed661f6cff 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
@@ -13,8 +13,8 @@ configure_args="
 conf_files="/etc/ldc2.conf"
 hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
- llvm-libunwind-devel"
-depends="ldc-runtime llvm-libunwind-devel"
+ llvm-libunwind15-devel"
+depends="ldc-runtime llvm-libunwind15-devel"
 checkdepends="python3"
 short_desc="Portable D programming language compiler based on LLVM"
 maintainer="Auri <me@aurieh.me>"

From f3d504288a43e2f56a648fd4eeb7ee909c4f4954 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 19/44] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..4cdd6307260f8 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+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
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm-devel clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 78d9067b453a2be449296543417e44396447c564 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 20/44] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..3cbc4a23aa62b 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From cff5f931dea181e1be066baf0c393a40d70e23f6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 21/44] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..80b156e616de8 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 6192061cd8980ea7a7006ffb3d9de8b021e9850b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 22/44] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..90860da764ba7 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=9
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From e1ca0b8ec5bef10e8a3dbae3294c3185b48b5cea Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 23/44] zig: Build against old llvm15 packages

---
 srcpkgs/llvm15/template | 2 +-
 srcpkgs/zig/template    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index bdd9b40ef82e7..1253f17cf1c4f 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -75,7 +75,7 @@ if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
 	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
+	depends+=" libomp15>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
 		# Seems to require a full host llvm/clang build
 		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 9058734b18d355e6aa22d8427c9456cb663a02c6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 24/44] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..d7f3f87e38f52 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 70c014f8091db4a091a8b69d438617cc1e10a3f0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 25/44] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..6608262305784 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,19 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang llvm-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From b62631b652d6761e910f26f95399bad7462d6980 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 26/44] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..20c34b6b014c6 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang llvm-devel perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From 168fc367a07ba2712220bf08be9a991f60aa500e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:56:50 -0500
Subject: [PATCH 27/44] btdu: Rebuild against llvm17

---
 srcpkgs/btdu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/btdu/template b/srcpkgs/btdu/template
index a42917b4f665b..eb2a33360b3f6 100644
--- a/srcpkgs/btdu/template
+++ b/srcpkgs/btdu/template
@@ -1,7 +1,7 @@
 # Template file for 'btdu'
 pkgname=btdu
 version=0.5.1
-revision=1
+revision=2
 hostmakedepends="ldc dub"
 makedepends="zlib-devel ncurses-devel"
 short_desc="Sampling disk usage profiler for btrfs"

From c96d069f508e9bbae8b373426e14b520b2f007bb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:56:53 -0500
Subject: [PATCH 28/44] gtkd: Rebuild against llvm17

---
 srcpkgs/gtkd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index 6a75d69e19cec..da7d58bb5fb71 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=10
+revision=11
 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 1d15a07f38ff49be452e0bfa1dcd8ba93e88795a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:56:56 -0500
Subject: [PATCH 29/44] gtkd: Rebuild against llvm17

---
 srcpkgs/gtkd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index da7d58bb5fb71..5b2f55f857437 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=11
+revision=12
 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 ea48cf8df6bb78b969163e8eb34a8a067bfee167 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:57:00 -0500
Subject: [PATCH 30/44] onedrive: Rebuild against llvm17

---
 srcpkgs/onedrive/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 019a89325aace..ec226d7616b2e 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.25
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="DC=ldc2 --enable-notifications --enable-completions
  --with-bash-completion-dir=/usr/share/bash-completion/completions

From e8e8ce594997cd9933b8fddbb8967e080ebced4e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 20:04:18 -0500
Subject: [PATCH 31/44] qt5: Rebuild against llvm17

---
 srcpkgs/qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index ef6e437e02dbc..db638ce548541 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,9 +5,9 @@ pkgname=qt5
 version=5.15.11+20231124
 # commit 4765fa1df7a837db9c1f89c4da0dd76b74bb5fab
 # 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
+hostmakedepends="cmake clang llvm-devel flex perl glib-devel pkg-config
  python3 re2c ruby which"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel

From 1e71721dcb00e213240988c10aed0e0b5dfee34d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:31 -0500
Subject: [PATCH 32/44] afl++: Rebuild against llvm17

---
 srcpkgs/afl++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/afl++/template b/srcpkgs/afl++/template
index fff658acbe1d7..a32eb3024c714 100644
--- a/srcpkgs/afl++/template
+++ b/srcpkgs/afl++/template
@@ -1,12 +1,12 @@
 # Template file for 'afl++'
 pkgname=afl++
 version=4.07c
-revision=2
+revision=3
 # x86 only currently
 archs="i686* x86_64*"
 build_style=gnu-makefile
 hostmakedepends="which"
-makedepends="clang gmp-devel lld llvm python3-devel"
+makedepends="clang gmp-devel lld llvm-devel python3-devel"
 short_desc="American fuzzy lop Plus Plus - a brute-force fuzzer"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 543da90113373fd3650cb997c8ca0f9df2d41a7f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 33/44] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..87a6324099ce0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From cc4a357143fb0efa9d56a1c37ecbe0fb4eb8c2f5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:38 -0500
Subject: [PATCH 34/44] blender: Rebuild against llvm17

---
 srcpkgs/blender/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index 1dc61ec9d29d8..274f84b0a63c3 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
 # Template file for 'blender'
 pkgname=blender
 version=4.0.2
-revision=1
+revision=2
 archs="x86_64* ppc64*"
 build_style="cmake"
 pycompile_dirs="usr/share/blender/${version%.*}/scripts"
@@ -17,7 +17,7 @@ configure_args="-DWITH_INSTALL_PORTABLE=OFF -DWITH_PYTHON_INSTALL=OFF
 hostmakedepends="pkg-config"
 makedepends="libgomp-devel libpng-devel tiff-devel python3-devel glu-devel
  glew-devel freetype-devel jack-devel libopenal-devel libsndfile-devel
- libsamplerate-devel ffmpeg-devel fftw-devel boost-devel pcre-devel llvm
+ libsamplerate-devel ffmpeg-devel fftw-devel boost-devel pcre-devel llvm-devel
  libopenexr-devel libopenjpeg2-devel libXi-devel openimageio-devel
  opencolorio-devel opencollada-devel python3-numpy libXrender-devel
  OpenSubdiv-devel tbb-devel libxml2-devel openvdb-devel alembic-devel

From 8bfaf3d0a6774a29f99d0058784e178d8521d55a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:41 -0500
Subject: [PATCH 35/44] bpftrace: Rebuild against llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index ff0808df4462c..10b91dfd52d2c 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From d13c8ea2482a8db5ea6789c8737e664af27ee825 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:45 -0500
Subject: [PATCH 36/44] ccls: Rebuild against llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index d0b21fa9cbb1d..866ac36d932f1 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From a61f3f5c9288b026baccb1d2b93a0bd2e2f35ad7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:48 -0500
Subject: [PATCH 37/44] firefox-esr: Rebuild against llvm17

---
 srcpkgs/firefox-esr/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/firefox-esr/template b/srcpkgs/firefox-esr/template
index baa8e8455f224..07e82d3196511 100644
--- a/srcpkgs/firefox-esr/template
+++ b/srcpkgs/firefox-esr/template
@@ -5,7 +5,7 @@
 #
 pkgname=firefox-esr
 version=115.0.2
-revision=2
+revision=3
 build_helper="rust"
 short_desc="Mozilla Firefox web browser - Extended Support Release"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,7 +17,7 @@ checksum=45723c83ea7dc318ec50d67eebf834163b626ec3924a3131fecddfc7268a95f5
 lib32disabled=yes
 
 hostmakedepends="autoconf213 unzip zip pkg-config perl python3 yasm rust cargo
- llvm clang lld nodejs cbindgen nasm which tar"
+ llvm-devel clang lld nodejs cbindgen nasm which tar"
 makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
  pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
  libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std

From e44ea9b4f8fcb50e2be04abb886771e99dbf93b9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:52 -0500
Subject: [PATCH 38/44] firefox: Rebuild against llvm17

---
 srcpkgs/firefox/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template
index 0cca0ac17ab3f..8c87dcf9ef777 100644
--- a/srcpkgs/firefox/template
+++ b/srcpkgs/firefox/template
@@ -4,7 +4,7 @@
 #
 pkgname=firefox
 version=122.0
-revision=1
+revision=2
 build_helper="rust"
 short_desc="Mozilla Firefox web browser"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -16,7 +16,7 @@ checksum=b84815a90e147965e4c0b50599c85b1022ab0fce42105e5ef45c630dcca5dec3
 lib32disabled=yes
 
 hostmakedepends="autoconf213 unzip zip pkg-config perl python3.11 yasm rust
- cargo llvm clang lld nodejs cbindgen nasm which tar"
+ cargo llvm-devel clang lld nodejs cbindgen nasm which tar"
 makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
  pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
  libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std

From c01b68418c7289c1f0438182548a035a74137314 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 39/44] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..89783ec09f747 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,11 +1,11 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
-hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm-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>"

From c75b1659bcd15821e358bfe00f7a51a124e5c845 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:59 -0500
Subject: [PATCH 40/44] juCi++: Rebuild against llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4b40d142462dc..458d95891cc22 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=7
+revision=8
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From 8d47cf1b8c1c9bd0b4f21db6b882465225017c36 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:02 -0500
Subject: [PATCH 41/44] openpgp-ca: Rebuild against llvm17

---
 srcpkgs/openpgp-ca/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/openpgp-ca/template b/srcpkgs/openpgp-ca/template
index 9f26ac5769fc0..3339e9890feab 100644
--- a/srcpkgs/openpgp-ca/template
+++ b/srcpkgs/openpgp-ca/template
@@ -1,10 +1,10 @@
 # Template file for 'openpgp-ca'
 pkgname=openpgp-ca
 version=0.13.0
-revision=1
+revision=2
 build_style=cargo
 make_install_args="--path openpgp-ca-bin"
-hostmakedepends="pkg-config clang llvm nettle-devel sqlite-devel"
+hostmakedepends="pkg-config clang llvm-devel nettle-devel sqlite-devel"
 makedepends="openssl-devel nettle-devel clang sqlite-devel pcsclite-devel"
 depends="gnupg"
 short_desc="Tool for handling OpenPGP keys in organizaations"

From aa156a5c11cd27ffe43eaa12dcafa26b9513a598 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:06 -0500
Subject: [PATCH 42/44] openpgp-card-tools: Rebuild against llvm17

---
 srcpkgs/openpgp-card-tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/openpgp-card-tools/template b/srcpkgs/openpgp-card-tools/template
index 23e3730701db3..c312716349d80 100644
--- a/srcpkgs/openpgp-card-tools/template
+++ b/srcpkgs/openpgp-card-tools/template
@@ -1,9 +1,9 @@
 # Template file for 'openpgp-card-tools'
 pkgname=openpgp-card-tools
 version=0.9.5
-revision=1
+revision=2
 build_style=cargo
-hostmakedepends="pkg-config llvm clang"
+hostmakedepends="pkg-config llvm-devel clang"
 makedepends="nettle-devel pcsclite-devel"
 depends="pcsclite pcsc-ccid"
 short_desc="Tools for inspecting, configuring and using OpenPGP cards"
@@ -11,7 +11,7 @@ maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="MIT, Apache-2.0"
 homepage="https://codeberg.org/openpgp-card/openpgp-card-tools"
 distfiles="https://codeberg.org/openpgp-card/openpgp-card-tools/archive/v${version}.tar.gz"
-checksum=11f4900d76ee65b8434c6feccf78aa7c3a09454dc8e46aca10c708cedadffc38
+checksum=72c0595834495d7a2003670937108d1c520ae1d5a3e79f2a929af4249d847266
 
 post_install() {
 	vlicense "LICENSES/MIT.txt"

From 0b8d8cd5e76c92c28c09c71e6193b8f564573a2e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:09 -0500
Subject: [PATCH 43/44] sequoia-sop: Rebuild against llvm17

---
 srcpkgs/sequoia-sop/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/sequoia-sop/template b/srcpkgs/sequoia-sop/template
index afcf0ace397dc..7e67f2bba7fd5 100644
--- a/srcpkgs/sequoia-sop/template
+++ b/srcpkgs/sequoia-sop/template
@@ -1,10 +1,10 @@
 # Template file for 'sequoia-sop'
 pkgname=sequoia-sop
 version=0.31.0
-revision=1
+revision=2
 build_style=cargo
 configure_args="--bin sqop --features cli"
-hostmakedepends="pkg-config llvm clang"
+hostmakedepends="pkg-config llvm-devel clang"
 makedepends="nettle-devel"
 short_desc="Implementation of the Stateless OpenPGP CLI using Sequoia"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"

From 804a6c8182c6edc938fbf801e99aaa9b8faef6c6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:13 -0500
Subject: [PATCH 44/44] sequoia-sq: Rebuild against llvm17

---
 srcpkgs/sequoia-sq/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/sequoia-sq/template b/srcpkgs/sequoia-sq/template
index 8c1f896cbd1a3..afcbea287a1dc 100644
--- a/srcpkgs/sequoia-sq/template
+++ b/srcpkgs/sequoia-sq/template
@@ -1,11 +1,11 @@
 # Template file for 'sequoia-sq'
 pkgname=sequoia-sq
 version=0.32.0
-revision=1
+revision=2
 build_style=cargo
 build_helper=qemu
 _deps="nettle-devel openssl-devel sqlite-devel"
-hostmakedepends="pkg-config llvm clang ${_deps}"
+hostmakedepends="pkg-config llvm-devel clang ${_deps}"
 makedepends="${_deps}"
 short_desc="Command-line frontend for Sequoia, a new OpenPGP implementation"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (96 preceding siblings ...)
  2024-02-01  3:41 ` Calandracas606
@ 2024-02-01  4:01 ` Calandracas606
  2024-02-01 17:39 ` [PR PATCH] [Updated] " Calandracas606
                   ` (20 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-01  4:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1920463322

Comment:
Heavily reworked the template, and made changes to allow packages to be built with old llvm versions (eg. zig)

Additionally, both clang15 and clang (17) are available to be installed, but not both at the same time.

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (97 preceding siblings ...)
  2024-02-01  4:01 ` Calandracas606
@ 2024-02-01 17:39 ` Calandracas606
  2024-02-01 17:49 ` Calandracas606
                   ` (19 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-01 17:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 131158 bytes --]

From ca83ccf8c931c08a6f95aed08d9d5e1efe9f5294 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/40] New package: llvm17

---
 common/shlibs                                 |  17 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-analyzer15                      |   1 +
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/clang-tools-extra15                   |   1 +
 srcpkgs/clang15                               |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15                              |   1 +
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15                           |   1 +
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/libomp15                              |   1 +
 srcpkgs/libomp15-devel                        |   1 +
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-devel                            |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm-libunwind15                      |   1 +
 srcpkgs/llvm-libunwind15-devel                |   1 +
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |  75 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 823 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 64 files changed, 1404 insertions(+), 65 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libcxx15
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libomp15
 create mode 120000 srcpkgs/libomp15-devel
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-devel
 create mode 120000 srcpkgs/llvm-libunwind15
 create mode 120000 srcpkgs/llvm-libunwind15-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..26204361d967e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,20 @@ 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.17 lldb-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm-17.0.3_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
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.15 libomp15-15.0.7_4
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15 b/srcpkgs/libcxx15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15 b/srcpkgs/libcxxabi15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp15 b/srcpkgs/libomp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp15-devel b/srcpkgs/libomp15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-devel b/srcpkgs/llvm-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15 b/srcpkgs/llvm-libunwind15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15-devel b/srcpkgs/llvm-libunwind15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..bdd9b40ef82e7 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -34,8 +34,8 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -68,12 +68,12 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
 esac
 
-subpackages="clang-tools-extra"
+subpackages="clang-tools-extra15"
 
 # must go before clang
 if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
+	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
 	depends+=" libomp>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
@@ -83,17 +83,17 @@ if [ "$_libomp_enable" = "yes" ]; then
 	fi
 fi
 
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm15"
+subpackages+=" clang15 clang-analyzer15 libclang15 libclang-cpp15
+ llvm-libunwind15 llvm-libunwind15-devel libcxx15 libcxx15-devel
+ libcxxabi15 libcxxabi15-devel libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -224,9 +224,9 @@ do_install() {
 		644 usr/include/mach-o
 }
 
-clang-analyzer_package() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +237,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -279,10 +279,10 @@ clang-tools-extra_package() {
 	}
 }
 
-clang_package() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -302,21 +302,21 @@ clang_package() {
 	}
 }
 
-libclang_package() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -329,11 +329,11 @@ lld_package() {
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +341,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +353,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,16 +363,16 @@ lldb-devel_package() {
 	}
 }
 
-llvm-libunwind_package() {
+llvm-libunwind15_package() {
 	short_desc+=" - libunwind"
 	pkg_install() {
 		vmove "usr/lib/libunwind.so.*"
 	}
 }
 
-llvm-libunwind-devel_package() {
+llvm-libunwind15-devel_package() {
 	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
+	depends="llvm-libunwind15>=${version}_${revision}"
 	conflicts="libunwind-devel>=0"
 	pkg_install() {
 		vmove usr/include/mach-o
@@ -383,16 +383,16 @@ llvm-libunwind-devel_package() {
 	}
 }
 
-libcxxabi_package() {
+libcxxabi15_package() {
 	short_desc+=" - low level support for libc++"
 	pkg_install() {
 		vmove "usr/lib/libc++abi.so.*"
 	}
 }
 
-libcxxabi-devel_package() {
+libcxxabi15-devel_package() {
 	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
+	depends="libcxxabi15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/*cxxabi*"
 		vmove "usr/lib/libc++abi.so"
@@ -400,16 +400,16 @@ libcxxabi-devel_package() {
 	}
 }
 
-libcxx_package() {
+libcxx15_package() {
 	short_desc+=" - C++ standard library"
 	pkg_install() {
 		vmove "usr/lib/libc++.so.*"
 	}
 }
 
-libcxx-devel_package() {
+libcxx15-devel_package() {
 	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
+	depends="libcxx15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/c++
 		vmove "usr/lib/libc++.so"
@@ -419,19 +419,16 @@ libcxx-devel_package() {
 	}
 }
 
-libomp_package() {
+libomp15_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() {
+libomp15-devel_package() {
 	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
+	depends="libomp15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/omp*.h"
 		vmove "usr/lib/clang/${version}/include/omp*.h"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..94d4963e8e24d
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,823 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="llvm-tools>=${version}_${revision} libllvm>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang libclang-cpp clang-analyzer "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm llvm-doc llvm-tools llvm-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+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.*"
+	}
+}
+
+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/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm-tools_package() {
+	pycompile_dirs="usr/share/opt-viewer"
+	short_desc+=" - development tools"
+	pkg_install() {
+		vmove usr/share/opt-viewer
+
+		vmove usr/lib/LLVMgold.so
+
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/bin/llvm-addr2line
+		vmove usr/bin/llvm-bitcode-strip
+		vmove usr/bin/llvm-dlltool
+		vmove usr/bin/llvm-install-name-tool
+		vmove usr/bin/llvm-lib
+		vmove usr/bin/llvm-otool
+		vmove usr/bin/llvm-ranlib
+		vmove usr/bin/llvm-readelf
+		vmove usr/bin/llvm-strip
+		vmove usr/bin/llvm-windres
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
+
+llvm-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From d317226da20b893b1d41d21272d59aa915998d10 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/40] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..8efb70113fb30 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 3c38d2a3ef262a12ebb360095dfad4f0ce8ed376 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/40] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..db822a6a6363b 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From f1ce28f44434af8aef619ae3d0148784154cb0c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/40] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From af90794b7fd4002ab8c7bf8d25a8f6c9ec339d9b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/40] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 26204361d967e..050b15a8a4f83 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-17.0.6_1
 libomptarget.so.15 libomp15-15.0.7_4
 libomptarget.so.17 libomp-17.0.3_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..2623bf312ffb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From f8490e9af8b649d7af34493a28e439d7a15443a1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/40] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 797e6c8d7ecfc1dd9e22eb1d2f578bf2485ac9b7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/40] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..5e0edbfa4dc9e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
@@ -13,7 +13,7 @@ hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 169ceb13b240e836b434592e774ce23a06dace5f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/40] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d664f26ae0f5e 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From a78427ea4e5b6c3532cc63862eae382efedc5ba5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/40] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..4baa49355752c 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 975b11e3c79e839cc0efdfcf19ce9ef6b63a4d6b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 10/40] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 4aa96170bb2f9ad849f677f7cea9de46acde0529 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 11/40] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..8bf31491da7cb 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 0c16f08c5f6c2c742b3f6f18f5142ed1441c077a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 12/40] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..1b8b034641953 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 2088194ea1c28b394d8bc302c3ae6d27b2d4c5ca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 13/40] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From e4047f86578bdd58c3aac22ffc122f0cbc6b0490 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 14/40] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 050b15a8a4f83..df2e82b8e1494 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2613,22 +2613,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..ddffef8aeb2a3 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 6793d6cd6761a22664cf0cf089284c4534539d3a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 15/40] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 6da34681793c60459ab5a0dbb0cc5546230fef6e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 16/40] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From d342d0b97c463ed7312014178681bf15c452c776 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 17/40] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 6 +++---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index df2e82b8e1494..251e463c070e7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2148,10 +2148,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..c95ed661f6cff 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
@@ -13,8 +13,8 @@ configure_args="
 conf_files="/etc/ldc2.conf"
 hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
- llvm-libunwind-devel"
-depends="ldc-runtime llvm-libunwind-devel"
+ llvm-libunwind15-devel"
+depends="ldc-runtime llvm-libunwind15-devel"
 checkdepends="python3"
 short_desc="Portable D programming language compiler based on LLVM"
 maintainer="Auri <me@aurieh.me>"

From 11920aafb6ff94d3c1475aac7d2c769a0a69f762 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 18/40] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..214278f13a993 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 85a2c2ba190961eb32a678a9812ffec00d3b34c9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 19/40] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..3cbc4a23aa62b 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 93eaa4d6d0708474ad5b632ff9c3fca4a0b5320c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 20/40] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..80b156e616de8 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 9f87ec22f00e4e336fa6a471494c25d2801ba5f0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 21/40] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..90860da764ba7 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=9
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From c8fec139b05bb783371eb73cbc2c18b36b10d087 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 22/40] zig: Build against old llvm15 packages

---
 srcpkgs/llvm15/template | 2 +-
 srcpkgs/zig/template    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index bdd9b40ef82e7..1253f17cf1c4f 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -75,7 +75,7 @@ if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
 	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
+	depends+=" libomp15>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
 		# Seems to require a full host llvm/clang build
 		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From b5a79f96816b2b0ee4613ae30b286a6bff7f2c55 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 23/40] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..d7f3f87e38f52 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 082247ce2fb4e8dc7757eafc6157071ad21893e6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 24/40] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..dc8729faf6ceb 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From d0752017f583a6fc68c120ed2756f66622c90b3f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 25/40] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..20c34b6b014c6 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang llvm-devel perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From 3c0b28800344bdae328e7a4f06457fd30d410c9d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:56:50 -0500
Subject: [PATCH 26/40] btdu: Rebuild against llvm17

---
 srcpkgs/btdu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/btdu/template b/srcpkgs/btdu/template
index a42917b4f665b..eb2a33360b3f6 100644
--- a/srcpkgs/btdu/template
+++ b/srcpkgs/btdu/template
@@ -1,7 +1,7 @@
 # Template file for 'btdu'
 pkgname=btdu
 version=0.5.1
-revision=1
+revision=2
 hostmakedepends="ldc dub"
 makedepends="zlib-devel ncurses-devel"
 short_desc="Sampling disk usage profiler for btrfs"

From a2bc85e40378a73ca27c974d97f155a4729d915e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:56:53 -0500
Subject: [PATCH 27/40] gtkd: Rebuild against llvm17

---
 srcpkgs/gtkd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index 6a75d69e19cec..da7d58bb5fb71 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=10
+revision=11
 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 8947a5de5e0b2866f4e7b12a74a9d76f28dfd1fa Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:57:00 -0500
Subject: [PATCH 28/40] onedrive: Rebuild against llvm17

---
 srcpkgs/onedrive/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 019a89325aace..ec226d7616b2e 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.25
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="DC=ldc2 --enable-notifications --enable-completions
  --with-bash-completion-dir=/usr/share/bash-completion/completions

From ca1e0ecc0a69e01ec24295685bdd122f1043d3c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:31 -0500
Subject: [PATCH 29/40] afl++: Rebuild against llvm17

---
 srcpkgs/afl++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/afl++/template b/srcpkgs/afl++/template
index fff658acbe1d7..a32eb3024c714 100644
--- a/srcpkgs/afl++/template
+++ b/srcpkgs/afl++/template
@@ -1,12 +1,12 @@
 # Template file for 'afl++'
 pkgname=afl++
 version=4.07c
-revision=2
+revision=3
 # x86 only currently
 archs="i686* x86_64*"
 build_style=gnu-makefile
 hostmakedepends="which"
-makedepends="clang gmp-devel lld llvm python3-devel"
+makedepends="clang gmp-devel lld llvm-devel python3-devel"
 short_desc="American fuzzy lop Plus Plus - a brute-force fuzzer"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 46381e09f592e11d5867e9b4cde9705948898961 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 30/40] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..87a6324099ce0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From b3e9c8cacad574331d280479cc584e39a1ab3c0e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:48 -0500
Subject: [PATCH 31/40] firefox-esr: Rebuild against llvm17

---
 srcpkgs/firefox-esr/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/firefox-esr/template b/srcpkgs/firefox-esr/template
index baa8e8455f224..6f2269d6429b5 100644
--- a/srcpkgs/firefox-esr/template
+++ b/srcpkgs/firefox-esr/template
@@ -5,7 +5,7 @@
 #
 pkgname=firefox-esr
 version=115.0.2
-revision=2
+revision=3
 build_helper="rust"
 short_desc="Mozilla Firefox web browser - Extended Support Release"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,7 +18,7 @@ lib32disabled=yes
 
 hostmakedepends="autoconf213 unzip zip pkg-config perl python3 yasm rust cargo
  llvm clang lld nodejs cbindgen nasm which tar"
-makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
+makedepends="llvm-devel nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
  pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
  libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std
  libXdamage-devel freetype-devel

From 937fb5da54022623889b0af7f906cc6f23b66161 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:52 -0500
Subject: [PATCH 32/40] firefox: Rebuild against llvm17

---
 srcpkgs/firefox/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template
index 0cca0ac17ab3f..ac62c1f8938f4 100644
--- a/srcpkgs/firefox/template
+++ b/srcpkgs/firefox/template
@@ -4,7 +4,7 @@
 #
 pkgname=firefox
 version=122.0
-revision=1
+revision=2
 build_helper="rust"
 short_desc="Mozilla Firefox web browser"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -17,7 +17,7 @@ lib32disabled=yes
 
 hostmakedepends="autoconf213 unzip zip pkg-config perl python3.11 yasm rust
  cargo llvm clang lld nodejs cbindgen nasm which tar"
-makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
+makedepends="llvm-devel nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
  pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
  libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std
  libXdamage-devel freetype-devel

From 887c5304ac862ce7503554c162bfeb67b4169685 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 33/40] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..4d00474cfdd69 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm-devel 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"

From 5a66d7dbeaa6ccab00d1880dcbff5089393ab3f0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:02 -0500
Subject: [PATCH 34/40] openpgp-ca: Rebuild against llvm17

---
 srcpkgs/openpgp-ca/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/openpgp-ca/template b/srcpkgs/openpgp-ca/template
index 9f26ac5769fc0..a264d11522a08 100644
--- a/srcpkgs/openpgp-ca/template
+++ b/srcpkgs/openpgp-ca/template
@@ -1,11 +1,11 @@
 # Template file for 'openpgp-ca'
 pkgname=openpgp-ca
 version=0.13.0
-revision=1
+revision=2
 build_style=cargo
 make_install_args="--path openpgp-ca-bin"
-hostmakedepends="pkg-config clang llvm nettle-devel sqlite-devel"
-makedepends="openssl-devel nettle-devel clang sqlite-devel pcsclite-devel"
+hostmakedepends="pkg-config nettle-devel sqlite-devel"
+makedepends="openssl-devel nettle-devel libclang sqlite-devel pcsclite-devel"
 depends="gnupg"
 short_desc="Tool for handling OpenPGP keys in organizaations"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"

From 4c0fd908b21a90bd2f6ee76597bdd76a560be68c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:06 -0500
Subject: [PATCH 35/40] openpgp-card-tools: Rebuild against llvm17, update
 checksum

---
 srcpkgs/openpgp-card-tools/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/openpgp-card-tools/template b/srcpkgs/openpgp-card-tools/template
index 23e3730701db3..5892678f288c5 100644
--- a/srcpkgs/openpgp-card-tools/template
+++ b/srcpkgs/openpgp-card-tools/template
@@ -1,17 +1,17 @@
 # Template file for 'openpgp-card-tools'
 pkgname=openpgp-card-tools
 version=0.9.5
-revision=1
+revision=2
 build_style=cargo
-hostmakedepends="pkg-config llvm clang"
-makedepends="nettle-devel pcsclite-devel"
+hostmakedepends="pkg-config"
+makedepends="nettle-devel libclang pcsclite-devel"
 depends="pcsclite pcsc-ccid"
 short_desc="Tools for inspecting, configuring and using OpenPGP cards"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="MIT, Apache-2.0"
 homepage="https://codeberg.org/openpgp-card/openpgp-card-tools"
 distfiles="https://codeberg.org/openpgp-card/openpgp-card-tools/archive/v${version}.tar.gz"
-checksum=11f4900d76ee65b8434c6feccf78aa7c3a09454dc8e46aca10c708cedadffc38
+checksum=72c0595834495d7a2003670937108d1c520ae1d5a3e79f2a929af4249d847266
 
 post_install() {
 	vlicense "LICENSES/MIT.txt"

From 8448d9f0c5e8a4cf4b8f76725498729dc2a5dc0a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:09 -0500
Subject: [PATCH 36/40] sequoia-sop: Rebuild against llvm17

---
 srcpkgs/sequoia-sop/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/sequoia-sop/template b/srcpkgs/sequoia-sop/template
index afcf0ace397dc..a2d4558db5447 100644
--- a/srcpkgs/sequoia-sop/template
+++ b/srcpkgs/sequoia-sop/template
@@ -1,11 +1,11 @@
 # Template file for 'sequoia-sop'
 pkgname=sequoia-sop
 version=0.31.0
-revision=1
+revision=2
 build_style=cargo
 configure_args="--bin sqop --features cli"
-hostmakedepends="pkg-config llvm clang"
-makedepends="nettle-devel"
+hostmakedepends="pkg-config"
+makedepends="nettle-devel libclang"
 short_desc="Implementation of the Stateless OpenPGP CLI using Sequoia"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="GPL-2.0-or-later"

From 130e7879a51944739af809ade3619624e2c76045 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:13 -0500
Subject: [PATCH 37/40] sequoia-sq: Rebuild against llvm17

---
 srcpkgs/sequoia-sq/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/sequoia-sq/template b/srcpkgs/sequoia-sq/template
index 8c1f896cbd1a3..f4cdc77efc945 100644
--- a/srcpkgs/sequoia-sq/template
+++ b/srcpkgs/sequoia-sq/template
@@ -1,12 +1,11 @@
 # Template file for 'sequoia-sq'
 pkgname=sequoia-sq
 version=0.32.0
-revision=1
+revision=2
 build_style=cargo
 build_helper=qemu
-_deps="nettle-devel openssl-devel sqlite-devel"
-hostmakedepends="pkg-config llvm clang ${_deps}"
-makedepends="${_deps}"
+hostmakedepends="pkg-config"
+makedepends="libclang nettle-devel openssl-devel sqlite-devel"
 short_desc="Command-line frontend for Sequoia, a new OpenPGP implementation"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="GPL-2.0-or-later"

From 63caf72de5a3ba9d1dd68681b57346e2360bb9bb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 38/40] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..478ab9d5fbd94 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm-devel")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From d1c5230f149030c7efe32c5dc0bd548421fbd591 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 39/40] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..c1a47f0be6ef2 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm-devel"
+	depends+=" llvm-devel"
 	;;
 esac
 

From d9d1e642366b5ff8c4dfd69626f6009cfc58fcfd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 40/40] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  8 ++++----
 3 files changed, 18 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..f326acd2961de 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
-revision=1
+version=2.70.3
+revision=2
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config llvm-devel which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (98 preceding siblings ...)
  2024-02-01 17:39 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-02-01 17:49 ` Calandracas606
  2024-02-01 20:43 ` Calandracas606
                   ` (18 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-01 17:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 131133 bytes --]

From ca83ccf8c931c08a6f95aed08d9d5e1efe9f5294 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/40] New package: llvm17

---
 common/shlibs                                 |  17 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-analyzer15                      |   1 +
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/clang-tools-extra15                   |   1 +
 srcpkgs/clang15                               |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15                              |   1 +
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15                           |   1 +
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/libomp15                              |   1 +
 srcpkgs/libomp15-devel                        |   1 +
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-devel                            |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm-libunwind15                      |   1 +
 srcpkgs/llvm-libunwind15-devel                |   1 +
 srcpkgs/llvm/template                         |   6 +-
 srcpkgs/llvm15/template                       |  75 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 823 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 64 files changed, 1404 insertions(+), 65 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libcxx15
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libomp15
 create mode 120000 srcpkgs/libomp15-devel
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-devel
 create mode 120000 srcpkgs/llvm-libunwind15
 create mode 120000 srcpkgs/llvm-libunwind15-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..26204361d967e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,20 @@ 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.17 lldb-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm-17.0.3_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
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.15 libomp15-15.0.7_4
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15 b/srcpkgs/libcxx15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15 b/srcpkgs/libcxxabi15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp15 b/srcpkgs/libomp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp15-devel b/srcpkgs/libomp15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-devel b/srcpkgs/llvm-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15 b/srcpkgs/llvm-libunwind15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15-devel b/srcpkgs/llvm-libunwind15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..24fcd5123cc53 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..bdd9b40ef82e7 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -34,8 +34,8 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -68,12 +68,12 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
 esac
 
-subpackages="clang-tools-extra"
+subpackages="clang-tools-extra15"
 
 # must go before clang
 if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
+	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
 	depends+=" libomp>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
@@ -83,17 +83,17 @@ if [ "$_libomp_enable" = "yes" ]; then
 	fi
 fi
 
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm15"
+subpackages+=" clang15 clang-analyzer15 libclang15 libclang-cpp15
+ llvm-libunwind15 llvm-libunwind15-devel libcxx15 libcxx15-devel
+ libcxxabi15 libcxxabi15-devel libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -224,9 +224,9 @@ do_install() {
 		644 usr/include/mach-o
 }
 
-clang-analyzer_package() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +237,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -279,10 +279,10 @@ clang-tools-extra_package() {
 	}
 }
 
-clang_package() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -302,21 +302,21 @@ clang_package() {
 	}
 }
 
-libclang_package() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -329,11 +329,11 @@ lld_package() {
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +341,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +353,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,16 +363,16 @@ lldb-devel_package() {
 	}
 }
 
-llvm-libunwind_package() {
+llvm-libunwind15_package() {
 	short_desc+=" - libunwind"
 	pkg_install() {
 		vmove "usr/lib/libunwind.so.*"
 	}
 }
 
-llvm-libunwind-devel_package() {
+llvm-libunwind15-devel_package() {
 	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
+	depends="llvm-libunwind15>=${version}_${revision}"
 	conflicts="libunwind-devel>=0"
 	pkg_install() {
 		vmove usr/include/mach-o
@@ -383,16 +383,16 @@ llvm-libunwind-devel_package() {
 	}
 }
 
-libcxxabi_package() {
+libcxxabi15_package() {
 	short_desc+=" - low level support for libc++"
 	pkg_install() {
 		vmove "usr/lib/libc++abi.so.*"
 	}
 }
 
-libcxxabi-devel_package() {
+libcxxabi15-devel_package() {
 	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
+	depends="libcxxabi15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/*cxxabi*"
 		vmove "usr/lib/libc++abi.so"
@@ -400,16 +400,16 @@ libcxxabi-devel_package() {
 	}
 }
 
-libcxx_package() {
+libcxx15_package() {
 	short_desc+=" - C++ standard library"
 	pkg_install() {
 		vmove "usr/lib/libc++.so.*"
 	}
 }
 
-libcxx-devel_package() {
+libcxx15-devel_package() {
 	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
+	depends="libcxx15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/c++
 		vmove "usr/lib/libc++.so"
@@ -419,19 +419,16 @@ libcxx-devel_package() {
 	}
 }
 
-libomp_package() {
+libomp15_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() {
+libomp15-devel_package() {
 	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
+	depends="libomp15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/omp*.h"
 		vmove "usr/lib/clang/${version}/include/omp*.h"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..94d4963e8e24d
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,823 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="llvm-tools>=${version}_${revision} libllvm>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang libclang-cpp clang-analyzer "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm llvm-doc llvm-tools llvm-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+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-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+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.*"
+	}
+}
+
+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/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm-tools_package() {
+	pycompile_dirs="usr/share/opt-viewer"
+	short_desc+=" - development tools"
+	pkg_install() {
+		vmove usr/share/opt-viewer
+
+		vmove usr/lib/LLVMgold.so
+
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/bin/llvm-addr2line
+		vmove usr/bin/llvm-bitcode-strip
+		vmove usr/bin/llvm-dlltool
+		vmove usr/bin/llvm-install-name-tool
+		vmove usr/bin/llvm-lib
+		vmove usr/bin/llvm-otool
+		vmove usr/bin/llvm-ranlib
+		vmove usr/bin/llvm-readelf
+		vmove usr/bin/llvm-strip
+		vmove usr/bin/llvm-windres
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
+
+llvm-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From d317226da20b893b1d41d21272d59aa915998d10 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/40] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..8efb70113fb30 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 3c38d2a3ef262a12ebb360095dfad4f0ce8ed376 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/40] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..db822a6a6363b 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From f1ce28f44434af8aef619ae3d0148784154cb0c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/40] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From af90794b7fd4002ab8c7bf8d25a8f6c9ec339d9b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/40] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 26204361d967e..050b15a8a4f83 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm-17.0.3_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-17.0.6_1
 libomptarget.so.15 libomp15-15.0.7_4
 libomptarget.so.17 libomp-17.0.3_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..2623bf312ffb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From f8490e9af8b649d7af34493a28e439d7a15443a1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/40] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 797e6c8d7ecfc1dd9e22eb1d2f578bf2485ac9b7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/40] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..5e0edbfa4dc9e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
@@ -13,7 +13,7 @@ hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 169ceb13b240e836b434592e774ce23a06dace5f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/40] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d664f26ae0f5e 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From a78427ea4e5b6c3532cc63862eae382efedc5ba5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/40] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..4baa49355752c 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 975b11e3c79e839cc0efdfcf19ce9ef6b63a4d6b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 10/40] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 4aa96170bb2f9ad849f677f7cea9de46acde0529 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 11/40] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..8bf31491da7cb 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 0c16f08c5f6c2c742b3f6f18f5142ed1441c077a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 12/40] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..1b8b034641953 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 2088194ea1c28b394d8bc302c3ae6d27b2d4c5ca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 13/40] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From e4047f86578bdd58c3aac22ffc122f0cbc6b0490 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 14/40] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 050b15a8a4f83..df2e82b8e1494 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2613,22 +2613,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..ddffef8aeb2a3 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 6793d6cd6761a22664cf0cf089284c4534539d3a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 15/40] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 6da34681793c60459ab5a0dbb0cc5546230fef6e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 16/40] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From d342d0b97c463ed7312014178681bf15c452c776 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 17/40] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 6 +++---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index df2e82b8e1494..251e463c070e7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2148,10 +2148,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..c95ed661f6cff 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
@@ -13,8 +13,8 @@ configure_args="
 conf_files="/etc/ldc2.conf"
 hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
- llvm-libunwind-devel"
-depends="ldc-runtime llvm-libunwind-devel"
+ llvm-libunwind15-devel"
+depends="ldc-runtime llvm-libunwind15-devel"
 checkdepends="python3"
 short_desc="Portable D programming language compiler based on LLVM"
 maintainer="Auri <me@aurieh.me>"

From 11920aafb6ff94d3c1475aac7d2c769a0a69f762 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 18/40] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..214278f13a993 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 85a2c2ba190961eb32a678a9812ffec00d3b34c9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 19/40] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..3cbc4a23aa62b 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 93eaa4d6d0708474ad5b632ff9c3fca4a0b5320c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 20/40] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..80b156e616de8 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 9f87ec22f00e4e336fa6a471494c25d2801ba5f0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 21/40] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..90860da764ba7 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=9
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From c8fec139b05bb783371eb73cbc2c18b36b10d087 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 22/40] zig: Build against old llvm15 packages

---
 srcpkgs/llvm15/template | 2 +-
 srcpkgs/zig/template    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index bdd9b40ef82e7..1253f17cf1c4f 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -75,7 +75,7 @@ if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
 	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
+	depends+=" libomp15>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
 		# Seems to require a full host llvm/clang build
 		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From b5a79f96816b2b0ee4613ae30b286a6bff7f2c55 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 23/40] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..d7f3f87e38f52 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 082247ce2fb4e8dc7757eafc6157071ad21893e6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 24/40] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..dc8729faf6ceb 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From d0752017f583a6fc68c120ed2756f66622c90b3f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 25/40] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..20c34b6b014c6 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang llvm-devel perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From 3c0b28800344bdae328e7a4f06457fd30d410c9d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:56:50 -0500
Subject: [PATCH 26/40] btdu: Rebuild against llvm17

---
 srcpkgs/btdu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/btdu/template b/srcpkgs/btdu/template
index a42917b4f665b..eb2a33360b3f6 100644
--- a/srcpkgs/btdu/template
+++ b/srcpkgs/btdu/template
@@ -1,7 +1,7 @@
 # Template file for 'btdu'
 pkgname=btdu
 version=0.5.1
-revision=1
+revision=2
 hostmakedepends="ldc dub"
 makedepends="zlib-devel ncurses-devel"
 short_desc="Sampling disk usage profiler for btrfs"

From a2bc85e40378a73ca27c974d97f155a4729d915e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:56:53 -0500
Subject: [PATCH 27/40] gtkd: Rebuild against llvm17

---
 srcpkgs/gtkd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index 6a75d69e19cec..da7d58bb5fb71 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=10
+revision=11
 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 8947a5de5e0b2866f4e7b12a74a9d76f28dfd1fa Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:57:00 -0500
Subject: [PATCH 28/40] onedrive: Rebuild against llvm17

---
 srcpkgs/onedrive/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 019a89325aace..ec226d7616b2e 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.25
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="DC=ldc2 --enable-notifications --enable-completions
  --with-bash-completion-dir=/usr/share/bash-completion/completions

From ca1e0ecc0a69e01ec24295685bdd122f1043d3c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:31 -0500
Subject: [PATCH 29/40] afl++: Rebuild against llvm17

---
 srcpkgs/afl++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/afl++/template b/srcpkgs/afl++/template
index fff658acbe1d7..a32eb3024c714 100644
--- a/srcpkgs/afl++/template
+++ b/srcpkgs/afl++/template
@@ -1,12 +1,12 @@
 # Template file for 'afl++'
 pkgname=afl++
 version=4.07c
-revision=2
+revision=3
 # x86 only currently
 archs="i686* x86_64*"
 build_style=gnu-makefile
 hostmakedepends="which"
-makedepends="clang gmp-devel lld llvm python3-devel"
+makedepends="clang gmp-devel lld llvm-devel python3-devel"
 short_desc="American fuzzy lop Plus Plus - a brute-force fuzzer"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 46381e09f592e11d5867e9b4cde9705948898961 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 30/40] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..87a6324099ce0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From b3e9c8cacad574331d280479cc584e39a1ab3c0e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:48 -0500
Subject: [PATCH 31/40] firefox-esr: Rebuild against llvm17

---
 srcpkgs/firefox-esr/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/firefox-esr/template b/srcpkgs/firefox-esr/template
index baa8e8455f224..6f2269d6429b5 100644
--- a/srcpkgs/firefox-esr/template
+++ b/srcpkgs/firefox-esr/template
@@ -5,7 +5,7 @@
 #
 pkgname=firefox-esr
 version=115.0.2
-revision=2
+revision=3
 build_helper="rust"
 short_desc="Mozilla Firefox web browser - Extended Support Release"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,7 +18,7 @@ lib32disabled=yes
 
 hostmakedepends="autoconf213 unzip zip pkg-config perl python3 yasm rust cargo
  llvm clang lld nodejs cbindgen nasm which tar"
-makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
+makedepends="llvm-devel nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
  pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
  libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std
  libXdamage-devel freetype-devel

From 937fb5da54022623889b0af7f906cc6f23b66161 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:52 -0500
Subject: [PATCH 32/40] firefox: Rebuild against llvm17

---
 srcpkgs/firefox/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template
index 0cca0ac17ab3f..ac62c1f8938f4 100644
--- a/srcpkgs/firefox/template
+++ b/srcpkgs/firefox/template
@@ -4,7 +4,7 @@
 #
 pkgname=firefox
 version=122.0
-revision=1
+revision=2
 build_helper="rust"
 short_desc="Mozilla Firefox web browser"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -17,7 +17,7 @@ lib32disabled=yes
 
 hostmakedepends="autoconf213 unzip zip pkg-config perl python3.11 yasm rust
  cargo llvm clang lld nodejs cbindgen nasm which tar"
-makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
+makedepends="llvm-devel nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
  pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
  libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std
  libXdamage-devel freetype-devel

From 887c5304ac862ce7503554c162bfeb67b4169685 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 33/40] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..4d00474cfdd69 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm-devel 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"

From 5a66d7dbeaa6ccab00d1880dcbff5089393ab3f0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:02 -0500
Subject: [PATCH 34/40] openpgp-ca: Rebuild against llvm17

---
 srcpkgs/openpgp-ca/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/openpgp-ca/template b/srcpkgs/openpgp-ca/template
index 9f26ac5769fc0..a264d11522a08 100644
--- a/srcpkgs/openpgp-ca/template
+++ b/srcpkgs/openpgp-ca/template
@@ -1,11 +1,11 @@
 # Template file for 'openpgp-ca'
 pkgname=openpgp-ca
 version=0.13.0
-revision=1
+revision=2
 build_style=cargo
 make_install_args="--path openpgp-ca-bin"
-hostmakedepends="pkg-config clang llvm nettle-devel sqlite-devel"
-makedepends="openssl-devel nettle-devel clang sqlite-devel pcsclite-devel"
+hostmakedepends="pkg-config nettle-devel sqlite-devel"
+makedepends="openssl-devel nettle-devel libclang sqlite-devel pcsclite-devel"
 depends="gnupg"
 short_desc="Tool for handling OpenPGP keys in organizaations"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"

From 4c0fd908b21a90bd2f6ee76597bdd76a560be68c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:06 -0500
Subject: [PATCH 35/40] openpgp-card-tools: Rebuild against llvm17, update
 checksum

---
 srcpkgs/openpgp-card-tools/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/openpgp-card-tools/template b/srcpkgs/openpgp-card-tools/template
index 23e3730701db3..5892678f288c5 100644
--- a/srcpkgs/openpgp-card-tools/template
+++ b/srcpkgs/openpgp-card-tools/template
@@ -1,17 +1,17 @@
 # Template file for 'openpgp-card-tools'
 pkgname=openpgp-card-tools
 version=0.9.5
-revision=1
+revision=2
 build_style=cargo
-hostmakedepends="pkg-config llvm clang"
-makedepends="nettle-devel pcsclite-devel"
+hostmakedepends="pkg-config"
+makedepends="nettle-devel libclang pcsclite-devel"
 depends="pcsclite pcsc-ccid"
 short_desc="Tools for inspecting, configuring and using OpenPGP cards"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="MIT, Apache-2.0"
 homepage="https://codeberg.org/openpgp-card/openpgp-card-tools"
 distfiles="https://codeberg.org/openpgp-card/openpgp-card-tools/archive/v${version}.tar.gz"
-checksum=11f4900d76ee65b8434c6feccf78aa7c3a09454dc8e46aca10c708cedadffc38
+checksum=72c0595834495d7a2003670937108d1c520ae1d5a3e79f2a929af4249d847266
 
 post_install() {
 	vlicense "LICENSES/MIT.txt"

From 8448d9f0c5e8a4cf4b8f76725498729dc2a5dc0a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:09 -0500
Subject: [PATCH 36/40] sequoia-sop: Rebuild against llvm17

---
 srcpkgs/sequoia-sop/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/sequoia-sop/template b/srcpkgs/sequoia-sop/template
index afcf0ace397dc..a2d4558db5447 100644
--- a/srcpkgs/sequoia-sop/template
+++ b/srcpkgs/sequoia-sop/template
@@ -1,11 +1,11 @@
 # Template file for 'sequoia-sop'
 pkgname=sequoia-sop
 version=0.31.0
-revision=1
+revision=2
 build_style=cargo
 configure_args="--bin sqop --features cli"
-hostmakedepends="pkg-config llvm clang"
-makedepends="nettle-devel"
+hostmakedepends="pkg-config"
+makedepends="nettle-devel libclang"
 short_desc="Implementation of the Stateless OpenPGP CLI using Sequoia"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="GPL-2.0-or-later"

From 130e7879a51944739af809ade3619624e2c76045 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:13 -0500
Subject: [PATCH 37/40] sequoia-sq: Rebuild against llvm17

---
 srcpkgs/sequoia-sq/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/sequoia-sq/template b/srcpkgs/sequoia-sq/template
index 8c1f896cbd1a3..f4cdc77efc945 100644
--- a/srcpkgs/sequoia-sq/template
+++ b/srcpkgs/sequoia-sq/template
@@ -1,12 +1,11 @@
 # Template file for 'sequoia-sq'
 pkgname=sequoia-sq
 version=0.32.0
-revision=1
+revision=2
 build_style=cargo
 build_helper=qemu
-_deps="nettle-devel openssl-devel sqlite-devel"
-hostmakedepends="pkg-config llvm clang ${_deps}"
-makedepends="${_deps}"
+hostmakedepends="pkg-config"
+makedepends="libclang nettle-devel openssl-devel sqlite-devel"
 short_desc="Command-line frontend for Sequoia, a new OpenPGP implementation"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="GPL-2.0-or-later"

From 63caf72de5a3ba9d1dd68681b57346e2360bb9bb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 38/40] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..478ab9d5fbd94 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm-devel")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From d1c5230f149030c7efe32c5dc0bd548421fbd591 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 39/40] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..c1a47f0be6ef2 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm-devel"
+	depends+=" llvm-devel"
 	;;
 esac
 

From 479bd41a4d4d36ccc8354e695d559a21eb3e0302 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 40/40] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (99 preceding siblings ...)
  2024-02-01 17:49 ` Calandracas606
@ 2024-02-01 20:43 ` Calandracas606
  2024-02-01 20:58 ` Calandracas606
                   ` (17 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-01 20:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 193654 bytes --]

From 04037824929ea4238cef85499b171bef80ce0064 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/44] New package: llvm17

---
 common/shlibs                                 |  19 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-analyzer15                      |   1 +
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/clang-tools-extra15                   |   1 +
 srcpkgs/clang15                               |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15                              |   1 +
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15                           |   1 +
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/libomp15                              |   1 +
 srcpkgs/libomp15-devel                        |   1 +
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-devel                            |   1 +
 srcpkgs/llvm-doc                              |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm-libunwind15                      |   1 +
 srcpkgs/llvm-libunwind15-devel                |   1 +
 srcpkgs/llvm-tools                            |   1 +
 srcpkgs/llvm/template                         |  22 +-
 srcpkgs/llvm15/template                       |  75 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 823 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 69 files changed, 1426 insertions(+), 66 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx15
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/libomp15
 create mode 120000 srcpkgs/libomp15-devel
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-devel
 create mode 120000 srcpkgs/llvm-doc
 create mode 120000 srcpkgs/llvm-libunwind15
 create mode 120000 srcpkgs/llvm-libunwind15-devel
 create mode 120000 srcpkgs/llvm-tools
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..389991b3c262a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,20 @@ 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.17 lldb-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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
-libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libLLVM-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm17-17.0.6_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.15 libomp15-15.0.7_4
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15 b/srcpkgs/libcxx15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15 b/srcpkgs/libcxxabi15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp15 b/srcpkgs/libomp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp15-devel b/srcpkgs/libomp15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-devel b/srcpkgs/llvm-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-doc b/srcpkgs/llvm-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15 b/srcpkgs/llvm-libunwind15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15-devel b/srcpkgs/llvm-libunwind15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-tools b/srcpkgs/llvm-tools
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-tools
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..e8854e00f1a78 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,27 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..bdd9b40ef82e7 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -34,8 +34,8 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -68,12 +68,12 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
 esac
 
-subpackages="clang-tools-extra"
+subpackages="clang-tools-extra15"
 
 # must go before clang
 if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
+	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
 	depends+=" libomp>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
@@ -83,17 +83,17 @@ if [ "$_libomp_enable" = "yes" ]; then
 	fi
 fi
 
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm15"
+subpackages+=" clang15 clang-analyzer15 libclang15 libclang-cpp15
+ llvm-libunwind15 llvm-libunwind15-devel libcxx15 libcxx15-devel
+ libcxxabi15 libcxxabi15-devel libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -224,9 +224,9 @@ do_install() {
 		644 usr/include/mach-o
 }
 
-clang-analyzer_package() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +237,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -279,10 +279,10 @@ clang-tools-extra_package() {
 	}
 }
 
-clang_package() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -302,21 +302,21 @@ clang_package() {
 	}
 }
 
-libclang_package() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -329,11 +329,11 @@ lld_package() {
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +341,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +353,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,16 +363,16 @@ lldb-devel_package() {
 	}
 }
 
-llvm-libunwind_package() {
+llvm-libunwind15_package() {
 	short_desc+=" - libunwind"
 	pkg_install() {
 		vmove "usr/lib/libunwind.so.*"
 	}
 }
 
-llvm-libunwind-devel_package() {
+llvm-libunwind15-devel_package() {
 	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
+	depends="llvm-libunwind15>=${version}_${revision}"
 	conflicts="libunwind-devel>=0"
 	pkg_install() {
 		vmove usr/include/mach-o
@@ -383,16 +383,16 @@ llvm-libunwind-devel_package() {
 	}
 }
 
-libcxxabi_package() {
+libcxxabi15_package() {
 	short_desc+=" - low level support for libc++"
 	pkg_install() {
 		vmove "usr/lib/libc++abi.so.*"
 	}
 }
 
-libcxxabi-devel_package() {
+libcxxabi15-devel_package() {
 	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
+	depends="libcxxabi15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/*cxxabi*"
 		vmove "usr/lib/libc++abi.so"
@@ -400,16 +400,16 @@ libcxxabi-devel_package() {
 	}
 }
 
-libcxx_package() {
+libcxx15_package() {
 	short_desc+=" - C++ standard library"
 	pkg_install() {
 		vmove "usr/lib/libc++.so.*"
 	}
 }
 
-libcxx-devel_package() {
+libcxx15-devel_package() {
 	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
+	depends="libcxx15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/c++
 		vmove "usr/lib/libc++.so"
@@ -419,19 +419,16 @@ libcxx-devel_package() {
 	}
 }
 
-libomp_package() {
+libomp15_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() {
+libomp15-devel_package() {
 	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
+	depends="libomp15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/omp*.h"
 		vmove "usr/lib/clang/${version}/include/omp*.h"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..017771fb7626b
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,823 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="llvm-tools>=${version}_${revision} libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang17 libclang-cpp17 clang-analyzer "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm-doc llvm-tools llvm-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+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/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm-tools_package() {
+	pycompile_dirs="usr/share/opt-viewer"
+	short_desc+=" - development tools"
+	pkg_install() {
+		vmove usr/share/opt-viewer
+
+		vmove usr/lib/LLVMgold.so
+
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/bin/llvm-addr2line
+		vmove usr/bin/llvm-bitcode-strip
+		vmove usr/bin/llvm-dlltool
+		vmove usr/bin/llvm-install-name-tool
+		vmove usr/bin/llvm-lib
+		vmove usr/bin/llvm-otool
+		vmove usr/bin/llvm-ranlib
+		vmove usr/bin/llvm-readelf
+		vmove usr/bin/llvm-strip
+		vmove usr/bin/llvm-windres
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
+
+llvm-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From f312458d946c9e6c85db80be4fb9ab1be9dd5d41 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/44] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..8efb70113fb30 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From b1e11157161b94b927824717c9b5934b92b29ef8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/44] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..db822a6a6363b 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 90e76e4ef7d316466147926509474e79af09fe60 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/44] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From adee0b247d1e771b99edbc42203b70a2de6b87be Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/44] SPIRV-LLVM-Translator: update to 17.0.0.

---
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..2623bf312ffb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 870e9d679f43774ca36ccaba799b82cb3f6147f7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/44] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From ffc8319d1d5637cf764ba2960dc9f81c7ca93970 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/44] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..5e0edbfa4dc9e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
@@ -13,7 +13,7 @@ hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 431e8f978b6d5a9155e683a23b574c5e2590014f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/44] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..d664f26ae0f5e 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From 5517cda02569c0a60dcd6bcf52f779f36c36a1e9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/44] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..4baa49355752c 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From e604941f4145dd9117dbd92d603294b5b804db77 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:03:22 -0400
Subject: [PATCH 10/44] codelite: rebuild for llvm17

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index f8206426888fd..ea61ee6e27507 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=4
+revision=5
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 2de035d9f41be790648e3f1cf5341ad250fe4883 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 11/44] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..8bf31491da7cb 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 4297fa271cda8535665c6925e9c1e00ea41bde59 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 12/44] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..1b8b034641953 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 9684966f9c673c6968a08bbb483bca77e46866ac Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 13/44] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From 93648a63cfca5f60eaaf5dc2c82deeac20632516 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 14/44] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 389991b3c262a..fcea763fcb975 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2613,22 +2613,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..ddffef8aeb2a3 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 29c260a17849abbea167d45ca9ad21bcb2e57e71 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 15/44] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 8503094df5645b89ae5ad0d3d28da68de2db327e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 16/44] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 61730695b716706d78cb2d77aeff280902c08312 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 17/44] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 6 +++---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index fcea763fcb975..9d99867914fe3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2148,10 +2148,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..c95ed661f6cff 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
@@ -13,8 +13,8 @@ configure_args="
 conf_files="/etc/ldc2.conf"
 hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
- llvm-libunwind-devel"
-depends="ldc-runtime llvm-libunwind-devel"
+ llvm-libunwind15-devel"
+depends="ldc-runtime llvm-libunwind15-devel"
 checkdepends="python3"
 short_desc="Portable D programming language compiler based on LLVM"
 maintainer="Auri <me@aurieh.me>"

From 6d3c768059eaaf103ab935956dc2b58d152ecfc8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 18/44] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..214278f13a993 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From d46303135aa00ec5b3c0f55fe7e274b126388d5b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 19/44] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..3cbc4a23aa62b 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 2c6c49f59ec7e23719e0f0991765cebd590a2221 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 20/44] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..80b156e616de8 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From f624de209435b00731cd450055e365d754c2fe0f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:15:43 -0400
Subject: [PATCH 21/44] tilix: rebuild for llvm17

---
 srcpkgs/tilix/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 74ccb4dd4592d..90860da764ba7 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,7 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=7
+revision=9
 _undead_version=1.1.8
 build_wrksrc="${pkgname}-${version}"
 build_style=meson

From 999b0a9ecdf3726dd436f61d71a9516d2d7d7c2b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 22/44] zig: Build against old llvm15 packages

---
 srcpkgs/llvm15/template | 2 +-
 srcpkgs/zig/template    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index bdd9b40ef82e7..1253f17cf1c4f 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -75,7 +75,7 @@ if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
 	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
+	depends+=" libomp15>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
 		# Seems to require a full host llvm/clang build
 		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 0559e66b212b735f19ce71fb3daf1272edbd0552 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 23/44] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..d7f3f87e38f52 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 686b834c3a08035e58f68592b12f640d05771555 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 24/44] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..dc8729faf6ceb 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From e9b78538d613d45afd40acc73197b82182c2c1a3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 25/44] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..20c34b6b014c6 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang llvm-devel perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From dba64f3ac696233edb9e3bb32a86c37249f28a58 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:56:50 -0500
Subject: [PATCH 26/44] btdu: Rebuild against llvm17

---
 srcpkgs/btdu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/btdu/template b/srcpkgs/btdu/template
index a42917b4f665b..eb2a33360b3f6 100644
--- a/srcpkgs/btdu/template
+++ b/srcpkgs/btdu/template
@@ -1,7 +1,7 @@
 # Template file for 'btdu'
 pkgname=btdu
 version=0.5.1
-revision=1
+revision=2
 hostmakedepends="ldc dub"
 makedepends="zlib-devel ncurses-devel"
 short_desc="Sampling disk usage profiler for btrfs"

From 15d02925c42c7ea40e912604d5f5ed416e07e956 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:56:53 -0500
Subject: [PATCH 27/44] gtkd: Rebuild against llvm17

---
 srcpkgs/gtkd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index 6a75d69e19cec..da7d58bb5fb71 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=10
+revision=11
 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 64d18a9463b239a8b114473ebe122b88444a3eb4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 18:57:00 -0500
Subject: [PATCH 28/44] onedrive: Rebuild against llvm17

---
 srcpkgs/onedrive/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 019a89325aace..ec226d7616b2e 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.25
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="DC=ldc2 --enable-notifications --enable-completions
  --with-bash-completion-dir=/usr/share/bash-completion/completions

From 1fd69f02c2771b28d86bbee139185c4ac5c80832 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:31 -0500
Subject: [PATCH 29/44] afl++: Rebuild against llvm17

---
 srcpkgs/afl++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/afl++/template b/srcpkgs/afl++/template
index fff658acbe1d7..a32eb3024c714 100644
--- a/srcpkgs/afl++/template
+++ b/srcpkgs/afl++/template
@@ -1,12 +1,12 @@
 # Template file for 'afl++'
 pkgname=afl++
 version=4.07c
-revision=2
+revision=3
 # x86 only currently
 archs="i686* x86_64*"
 build_style=gnu-makefile
 hostmakedepends="which"
-makedepends="clang gmp-devel lld llvm python3-devel"
+makedepends="clang gmp-devel lld llvm-devel python3-devel"
 short_desc="American fuzzy lop Plus Plus - a brute-force fuzzer"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 896f74432bc2d96eba299948c6d093d9b80c4ba3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 30/44] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..87a6324099ce0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 0650746966de0a6fe43535383818a4efee9ba63a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:48 -0500
Subject: [PATCH 31/44] firefox-esr: Rebuild against llvm17

---
 srcpkgs/firefox-esr/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/firefox-esr/template b/srcpkgs/firefox-esr/template
index baa8e8455f224..6f2269d6429b5 100644
--- a/srcpkgs/firefox-esr/template
+++ b/srcpkgs/firefox-esr/template
@@ -5,7 +5,7 @@
 #
 pkgname=firefox-esr
 version=115.0.2
-revision=2
+revision=3
 build_helper="rust"
 short_desc="Mozilla Firefox web browser - Extended Support Release"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,7 +18,7 @@ lib32disabled=yes
 
 hostmakedepends="autoconf213 unzip zip pkg-config perl python3 yasm rust cargo
  llvm clang lld nodejs cbindgen nasm which tar"
-makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
+makedepends="llvm-devel nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
  pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
  libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std
  libXdamage-devel freetype-devel

From 366134c6407124fe0c20e8921256a51b1268e721 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:52 -0500
Subject: [PATCH 32/44] firefox: Rebuild against llvm17

---
 srcpkgs/firefox/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template
index 0cca0ac17ab3f..ac62c1f8938f4 100644
--- a/srcpkgs/firefox/template
+++ b/srcpkgs/firefox/template
@@ -4,7 +4,7 @@
 #
 pkgname=firefox
 version=122.0
-revision=1
+revision=2
 build_helper="rust"
 short_desc="Mozilla Firefox web browser"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -17,7 +17,7 @@ lib32disabled=yes
 
 hostmakedepends="autoconf213 unzip zip pkg-config perl python3.11 yasm rust
  cargo llvm clang lld nodejs cbindgen nasm which tar"
-makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
+makedepends="llvm-devel nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel
  pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel
  libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std
  libXdamage-devel freetype-devel

From 1c86e20d7eaac23a50b292c7d0d8379f4d26a73e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 33/44] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..4d00474cfdd69 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm-devel 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"

From eef6432ea1732416abe8167edd2b685d76f35038 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:02 -0500
Subject: [PATCH 34/44] openpgp-ca: Rebuild against llvm17

---
 srcpkgs/openpgp-ca/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/openpgp-ca/template b/srcpkgs/openpgp-ca/template
index 9f26ac5769fc0..a264d11522a08 100644
--- a/srcpkgs/openpgp-ca/template
+++ b/srcpkgs/openpgp-ca/template
@@ -1,11 +1,11 @@
 # Template file for 'openpgp-ca'
 pkgname=openpgp-ca
 version=0.13.0
-revision=1
+revision=2
 build_style=cargo
 make_install_args="--path openpgp-ca-bin"
-hostmakedepends="pkg-config clang llvm nettle-devel sqlite-devel"
-makedepends="openssl-devel nettle-devel clang sqlite-devel pcsclite-devel"
+hostmakedepends="pkg-config nettle-devel sqlite-devel"
+makedepends="openssl-devel nettle-devel libclang sqlite-devel pcsclite-devel"
 depends="gnupg"
 short_desc="Tool for handling OpenPGP keys in organizaations"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"

From d259812dc8a4d0f5ca49e9d5310c4f448710563d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:06 -0500
Subject: [PATCH 35/44] openpgp-card-tools: Rebuild against llvm17, update
 checksum

---
 srcpkgs/openpgp-card-tools/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/openpgp-card-tools/template b/srcpkgs/openpgp-card-tools/template
index 23e3730701db3..5892678f288c5 100644
--- a/srcpkgs/openpgp-card-tools/template
+++ b/srcpkgs/openpgp-card-tools/template
@@ -1,17 +1,17 @@
 # Template file for 'openpgp-card-tools'
 pkgname=openpgp-card-tools
 version=0.9.5
-revision=1
+revision=2
 build_style=cargo
-hostmakedepends="pkg-config llvm clang"
-makedepends="nettle-devel pcsclite-devel"
+hostmakedepends="pkg-config"
+makedepends="nettle-devel libclang pcsclite-devel"
 depends="pcsclite pcsc-ccid"
 short_desc="Tools for inspecting, configuring and using OpenPGP cards"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="MIT, Apache-2.0"
 homepage="https://codeberg.org/openpgp-card/openpgp-card-tools"
 distfiles="https://codeberg.org/openpgp-card/openpgp-card-tools/archive/v${version}.tar.gz"
-checksum=11f4900d76ee65b8434c6feccf78aa7c3a09454dc8e46aca10c708cedadffc38
+checksum=72c0595834495d7a2003670937108d1c520ae1d5a3e79f2a929af4249d847266
 
 post_install() {
 	vlicense "LICENSES/MIT.txt"

From 3ce94b7b5f12012d43067be7c53d8eb98e8bb67e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:09 -0500
Subject: [PATCH 36/44] sequoia-sop: Rebuild against llvm17

---
 srcpkgs/sequoia-sop/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/sequoia-sop/template b/srcpkgs/sequoia-sop/template
index afcf0ace397dc..a2d4558db5447 100644
--- a/srcpkgs/sequoia-sop/template
+++ b/srcpkgs/sequoia-sop/template
@@ -1,11 +1,11 @@
 # Template file for 'sequoia-sop'
 pkgname=sequoia-sop
 version=0.31.0
-revision=1
+revision=2
 build_style=cargo
 configure_args="--bin sqop --features cli"
-hostmakedepends="pkg-config llvm clang"
-makedepends="nettle-devel"
+hostmakedepends="pkg-config"
+makedepends="nettle-devel libclang"
 short_desc="Implementation of the Stateless OpenPGP CLI using Sequoia"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="GPL-2.0-or-later"

From 6cbd0093a667794b0335b283b965e76c59e93b96 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:41:13 -0500
Subject: [PATCH 37/44] sequoia-sq: Rebuild against llvm17

---
 srcpkgs/sequoia-sq/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/sequoia-sq/template b/srcpkgs/sequoia-sq/template
index 8c1f896cbd1a3..f4cdc77efc945 100644
--- a/srcpkgs/sequoia-sq/template
+++ b/srcpkgs/sequoia-sq/template
@@ -1,12 +1,11 @@
 # Template file for 'sequoia-sq'
 pkgname=sequoia-sq
 version=0.32.0
-revision=1
+revision=2
 build_style=cargo
 build_helper=qemu
-_deps="nettle-devel openssl-devel sqlite-devel"
-hostmakedepends="pkg-config llvm clang ${_deps}"
-makedepends="${_deps}"
+hostmakedepends="pkg-config"
+makedepends="libclang nettle-devel openssl-devel sqlite-devel"
 short_desc="Command-line frontend for Sequoia, a new OpenPGP implementation"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="GPL-2.0-or-later"

From 770e9c35fe5b53b88129f69e4fa0352b8531d53b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 38/44] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..478ab9d5fbd94 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm-devel")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From 2d457b61cd54e7a509feaefbc6c44eedf691e367 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 39/44] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..c1a47f0be6ef2 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm-devel"
+	depends+=" llvm-devel"
 	;;
 esac
 

From 03afd58f7222b43bb13e6194cd87c261af597776 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 40/44] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From fe728c1e83566d1bbce41238e04cc1afd395c7a6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:03:35 -0500
Subject: [PATCH 41/44] sequoia-sqv: Rebuild against llvm17

---
 .../patches/fix-incompatible-deps.diff        | 1799 +++++++++++++++++
 srcpkgs/sequoia-sqv/template                  |    6 +-
 2 files changed, 1802 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/sequoia-sqv/patches/fix-incompatible-deps.diff

diff --git a/srcpkgs/sequoia-sqv/patches/fix-incompatible-deps.diff b/srcpkgs/sequoia-sqv/patches/fix-incompatible-deps.diff
new file mode 100644
index 0000000000000..3ad10a790407c
--- /dev/null
+++ b/srcpkgs/sequoia-sqv/patches/fix-incompatible-deps.diff
@@ -0,0 +1,1799 @@
+diff --git a/Cargo.lock b/Cargo.lock
+index fc34d4f8a319fe53c299f812aebc19b5ad77638a..f58b827598b4509ad3269ec42a7b454df0b9ccd9 100644
+--- a/Cargo.lock
++++ b/Cargo.lock
+@@ -4,9 +4,9 @@ version = 3
+ 
+ [[package]]
+ name = "addr2line"
+-version = "0.17.0"
++version = "0.21.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b"
++checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
+ dependencies = [
+  "gimli",
+ ]
+@@ -19,22 +19,38 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+ 
+ [[package]]
+ name = "aead"
+-version = "0.3.2"
++version = "0.5.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331"
++checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
+ dependencies = [
++ "crypto-common",
+  "generic-array",
+ ]
+ 
+ [[package]]
+ name = "aho-corasick"
+-version = "0.7.18"
++version = "1.0.4"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
++checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a"
+ dependencies = [
+  "memchr",
+ ]
+ 
++[[package]]
++name = "android-tzdata"
++version = "0.1.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
++
++[[package]]
++name = "android_system_properties"
++version = "0.1.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
++dependencies = [
++ "libc",
++]
++
+ [[package]]
+ name = "ansi_term"
+ version = "0.12.1"
+@@ -46,9 +62,9 @@ dependencies = [
+ 
+ [[package]]
+ name = "anyhow"
+-version = "1.0.51"
++version = "1.0.75"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203"
++checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
+ 
+ [[package]]
+ name = "ascii-canvas"
+@@ -79,28 +95,22 @@ version = "0.2.14"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
+ dependencies = [
+- "hermit-abi",
++ "hermit-abi 0.1.19",
+  "libc",
+  "winapi",
+ ]
+ 
+ [[package]]
+ name = "autocfg"
+-version = "0.1.7"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
+-
+-[[package]]
+-name = "autocfg"
+-version = "1.0.1"
++version = "1.1.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
++checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+ 
+ [[package]]
+ name = "backtrace"
+-version = "0.3.63"
++version = "0.3.69"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6"
++checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
+ dependencies = [
+  "addr2line",
+  "cc",
+@@ -113,17 +123,17 @@ dependencies = [
+ 
+ [[package]]
+ name = "base64"
+-version = "0.13.0"
++version = "0.21.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
++checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d"
+ 
+ [[package]]
+ name = "bindgen"
+-version = "0.57.0"
++version = "0.63.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "fd4865004a46a0aafb2a0a5eb19d3c9fc46ee5f063a6cfc605c69ac9ecf5263d"
++checksum = "36d860121800b2a9a94f9b5604b332d5cffb234ce17609ea479d723dbc9d3885"
+ dependencies = [
+- "bitflags",
++ "bitflags 1.3.2",
+  "cexpr",
+  "clang-sys",
+  "lazy_static",
+@@ -134,13 +144,14 @@ dependencies = [
+  "regex",
+  "rustc-hash",
+  "shlex",
++ "syn 1.0.109",
+ ]
+ 
+ [[package]]
+ name = "bit-set"
+-version = "0.5.2"
++version = "0.5.3"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de"
++checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
+ dependencies = [
+  "bit-vec",
+ ]
+@@ -157,6 +168,12 @@ version = "1.3.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+ 
++[[package]]
++name = "bitflags"
++version = "2.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
++
+ [[package]]
+ name = "block-buffer"
+ version = "0.9.0"
+@@ -166,15 +183,40 @@ dependencies = [
+  "generic-array",
+ ]
+ 
++[[package]]
++name = "block-buffer"
++version = "0.10.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
++dependencies = [
++ "generic-array",
++]
++
++[[package]]
++name = "block-padding"
++version = "0.3.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
++dependencies = [
++ "generic-array",
++]
++
+ [[package]]
+ name = "buffered-reader"
+-version = "1.1.1"
++version = "1.2.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d72a4138b8e2219c358090c488434830a8266b0c6d4e3a121038c26e590e5f09"
++checksum = "66d3bea5bcc3ecc38fe5388e6bc35e6fe7bd665eb3ae9a44283e15b91ad3867d"
+ dependencies = [
++ "lazy_static",
+  "libc",
+ ]
+ 
++[[package]]
++name = "bumpalo"
++version = "3.13.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
++
+ [[package]]
+ name = "byteorder"
+ version = "1.4.3"
+@@ -183,15 +225,18 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
+ 
+ [[package]]
+ name = "cc"
+-version = "1.0.72"
++version = "1.0.83"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
++checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
++dependencies = [
++ "libc",
++]
+ 
+ [[package]]
+ name = "cexpr"
+-version = "0.4.0"
++version = "0.6.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27"
++checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
+ dependencies = [
+  "nom",
+ ]
+@@ -204,31 +249,34 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+ 
+ [[package]]
+ name = "chrono"
+-version = "0.4.19"
++version = "0.4.26"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
++checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5"
+ dependencies = [
+- "libc",
+- "num-integer",
++ "android-tzdata",
++ "iana-time-zone",
++ "js-sys",
+  "num-traits",
+  "time",
++ "wasm-bindgen",
+  "winapi",
+ ]
+ 
+ [[package]]
+ name = "cipher"
+-version = "0.2.5"
++version = "0.4.4"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801"
++checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
+ dependencies = [
+- "generic-array",
++ "crypto-common",
++ "inout",
+ ]
+ 
+ [[package]]
+ name = "clang-sys"
+-version = "1.3.0"
++version = "1.6.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90"
++checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
+ dependencies = [
+  "glob",
+  "libc",
+@@ -243,7 +291,7 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
+ dependencies = [
+  "ansi_term",
+  "atty",
+- "bitflags",
++ "bitflags 1.3.2",
+  "strsim",
+  "term_size",
+  "textwrap",
+@@ -253,30 +301,37 @@ dependencies = [
+ 
+ [[package]]
+ name = "cmac"
+-version = "0.5.1"
++version = "0.7.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "73d4de4f7724e5fe70addfb2bd37c2abd2f95084a429d7773b0b9645499b4272"
++checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa"
+ dependencies = [
+- "crypto-mac",
++ "cipher",
+  "dbl",
++ "digest 0.10.7",
+ ]
+ 
+ [[package]]
+ name = "colored"
+-version = "1.9.3"
++version = "1.9.4"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59"
++checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355"
+ dependencies = [
+- "atty",
++ "is-terminal",
+  "lazy_static",
+  "winapi",
+ ]
+ 
++[[package]]
++name = "core-foundation-sys"
++version = "0.8.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
++
+ [[package]]
+ name = "cpufeatures"
+-version = "0.2.1"
++version = "0.2.9"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469"
++checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1"
+ dependencies = [
+  "libc",
+ ]
+@@ -288,52 +343,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
+ 
+ [[package]]
+-name = "crypto-mac"
+-version = "0.10.1"
++name = "crypto-common"
++version = "0.1.6"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a"
++checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
+ dependencies = [
+- "cipher",
+  "generic-array",
+- "subtle",
++ "rand_core 0.6.4",
++ "typenum",
+ ]
+ 
+ [[package]]
+ name = "ctr"
+-version = "0.6.0"
++version = "0.9.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f"
++checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
+ dependencies = [
+  "cipher",
+ ]
+ 
+ [[package]]
+ name = "curve25519-dalek"
+-version = "3.2.0"
++version = "3.2.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61"
++checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0"
+ dependencies = [
+  "byteorder",
+- "digest",
+- "rand_core",
++ "digest 0.9.0",
++ "rand_core 0.5.1",
+  "subtle",
+  "zeroize",
+ ]
+ 
+ [[package]]
+ name = "dbl"
+-version = "0.3.1"
++version = "0.3.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "37e797687b5f09528a48fcb63b6914d0255b8a6c760699a919af37042f09d9b3"
++checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9"
+ dependencies = [
+  "generic-array",
+ ]
+ 
+ [[package]]
+ name = "diff"
+-version = "0.1.12"
++version = "0.1.13"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499"
++checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
+ 
+ [[package]]
+ name = "difference"
+@@ -350,6 +405,17 @@ dependencies = [
+  "generic-array",
+ ]
+ 
++[[package]]
++name = "digest"
++version = "0.10.7"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
++dependencies = [
++ "block-buffer 0.10.4",
++ "crypto-common",
++ "subtle",
++]
++
+ [[package]]
+ name = "dirs-next"
+ version = "2.0.0"
+@@ -379,15 +445,15 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
+ 
+ [[package]]
+ name = "dyn-clone"
+-version = "1.0.4"
++version = "1.0.13"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf"
++checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555"
+ 
+ [[package]]
+ name = "eax"
+-version = "0.3.0"
++version = "0.5.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "e1f76e7a5e594b299a0fa9a99de627530725e341df41376aa342aecb2c5eb76e"
++checksum = "9954fabd903b82b9d7a68f65f97dc96dd9ad368e40ccc907a7c19d53e6bfac28"
+ dependencies = [
+  "aead",
+  "cipher",
+@@ -398,9 +464,9 @@ dependencies = [
+ 
+ [[package]]
+ name = "ed25519"
+-version = "1.3.0"
++version = "1.5.3"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "74e1069e39f1454367eb2de793ed062fac4c35c2934b76a81d90dd9abcd28816"
++checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7"
+ dependencies = [
+  "signature",
+ ]
+@@ -420,15 +486,15 @@ dependencies = [
+ 
+ [[package]]
+ name = "either"
+-version = "1.6.1"
++version = "1.9.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
++checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
+ 
+ [[package]]
+ name = "ena"
+-version = "0.14.0"
++version = "0.14.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3"
++checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1"
+ dependencies = [
+  "log",
+ ]
+@@ -439,6 +505,33 @@ version = "0.1.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "1f4b14e20978669064c33b4c1e0fb4083412e40fe56cbea2eae80fd7591503ee"
+ 
++[[package]]
++name = "equivalent"
++version = "1.0.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
++
++[[package]]
++name = "errno"
++version = "0.3.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f"
++dependencies = [
++ "errno-dragonfly",
++ "libc",
++ "windows-sys",
++]
++
++[[package]]
++name = "errno-dragonfly"
++version = "0.1.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
++dependencies = [
++ "cc",
++ "libc",
++]
++
+ [[package]]
+ name = "failure"
+ version = "0.1.8"
+@@ -457,21 +550,27 @@ checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
+ dependencies = [
+  "proc-macro2",
+  "quote",
+- "syn",
++ "syn 1.0.109",
+  "synstructure",
+ ]
+ 
++[[package]]
++name = "fastrand"
++version = "2.0.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764"
++
+ [[package]]
+ name = "fixedbitset"
+-version = "0.2.0"
++version = "0.4.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
++checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
+ 
+ [[package]]
+ name = "generic-array"
+-version = "0.14.4"
++version = "0.14.7"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
++checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
+ dependencies = [
+  "typenum",
+  "version_check",
+@@ -479,32 +578,47 @@ dependencies = [
+ 
+ [[package]]
+ name = "getrandom"
+-version = "0.2.3"
++version = "0.1.16"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
++checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
+ dependencies = [
+  "cfg-if",
++ "js-sys",
+  "libc",
+- "wasi",
++ "wasi 0.9.0+wasi-snapshot-preview1",
++ "wasm-bindgen",
++]
++
++[[package]]
++name = "getrandom"
++version = "0.2.10"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
++dependencies = [
++ "cfg-if",
++ "js-sys",
++ "libc",
++ "wasi 0.11.0+wasi-snapshot-preview1",
++ "wasm-bindgen",
+ ]
+ 
+ [[package]]
+ name = "gimli"
+-version = "0.26.1"
++version = "0.28.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4"
++checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
+ 
+ [[package]]
+ name = "glob"
+-version = "0.3.0"
++version = "0.3.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
++checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
+ 
+ [[package]]
+ name = "hashbrown"
+-version = "0.11.2"
++version = "0.14.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
++checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
+ 
+ [[package]]
+ name = "hermit-abi"
+@@ -515,68 +629,116 @@ dependencies = [
+  "libc",
+ ]
+ 
++[[package]]
++name = "hermit-abi"
++version = "0.3.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b"
++
++[[package]]
++name = "iana-time-zone"
++version = "0.1.57"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613"
++dependencies = [
++ "android_system_properties",
++ "core-foundation-sys",
++ "iana-time-zone-haiku",
++ "js-sys",
++ "wasm-bindgen",
++ "windows",
++]
++
++[[package]]
++name = "iana-time-zone-haiku"
++version = "0.1.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
++dependencies = [
++ "cc",
++]
++
+ [[package]]
+ name = "idna"
+-version = "0.2.3"
++version = "0.3.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
++checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
+ dependencies = [
+- "matches",
+  "unicode-bidi",
+  "unicode-normalization",
+ ]
+ 
+ [[package]]
+ name = "indexmap"
+-version = "1.7.0"
++version = "2.0.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
++checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
+ dependencies = [
+- "autocfg 1.0.1",
++ "equivalent",
+  "hashbrown",
+ ]
+ 
+ [[package]]
+-name = "instant"
+-version = "0.1.12"
++name = "inout"
++version = "0.1.3"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
++checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
+ dependencies = [
+- "cfg-if",
++ "block-padding",
++ "generic-array",
++]
++
++[[package]]
++name = "is-terminal"
++version = "0.4.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
++dependencies = [
++ "hermit-abi 0.3.2",
++ "rustix",
++ "windows-sys",
+ ]
+ 
+ [[package]]
+ name = "itertools"
+-version = "0.10.3"
++version = "0.10.5"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
++checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
+ dependencies = [
+  "either",
+ ]
+ 
+ [[package]]
+ name = "itoa"
+-version = "0.4.8"
++version = "1.0.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
++
++[[package]]
++name = "js-sys"
++version = "0.3.64"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
++checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
++dependencies = [
++ "wasm-bindgen",
++]
+ 
+ [[package]]
+ name = "lalrpop"
+-version = "0.19.6"
++version = "0.19.12"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "b15174f1c529af5bf1283c3bc0058266b483a67156f79589fab2a25e23cf8988"
++checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b"
+ dependencies = [
+  "ascii-canvas",
+- "atty",
+  "bit-set",
+  "diff",
+  "ena",
++ "is-terminal",
+  "itertools",
+  "lalrpop-util",
+  "petgraph",
+- "pico-args",
+  "regex",
+- "regex-syntax",
++ "regex-syntax 0.6.29",
+  "string_cache",
+  "term",
+  "tiny-keccak",
+@@ -585,12 +747,9 @@ dependencies = [
+ 
+ [[package]]
+ name = "lalrpop-util"
+-version = "0.19.6"
++version = "0.19.12"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d3e58cce361efcc90ba8a0a5f982c741ff86b603495bb15a998412e957dcd278"
+-dependencies = [
+- "regex",
+-]
++checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed"
+ 
+ [[package]]
+ name = "lazy_static"
+@@ -609,15 +768,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
+ 
+ [[package]]
+ name = "libc"
+-version = "0.2.109"
++version = "0.2.147"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01"
++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
+ 
+ [[package]]
+ name = "libloading"
+-version = "0.7.2"
++version = "0.7.4"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52"
++checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
+ dependencies = [
+  "cfg-if",
+  "winapi",
+@@ -625,76 +784,83 @@ dependencies = [
+ 
+ [[package]]
+ name = "libm"
+-version = "0.2.1"
++version = "0.2.7"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a"
++checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4"
+ 
+ [[package]]
+-name = "lock_api"
++name = "linux-raw-sys"
+ version = "0.4.5"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
+-dependencies = [
+- "scopeguard",
+-]
++checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503"
+ 
+ [[package]]
+-name = "log"
+-version = "0.4.14"
++name = "lock_api"
++version = "0.4.10"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
++checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16"
+ dependencies = [
+- "cfg-if",
++ "autocfg",
++ "scopeguard",
+ ]
+ 
+ [[package]]
+-name = "matches"
+-version = "0.1.9"
++name = "log"
++version = "0.4.20"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
++checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
+ 
+ [[package]]
+ name = "memchr"
+-version = "2.4.1"
++version = "2.5.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
++checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
+ 
+ [[package]]
+ name = "memsec"
+-version = "0.6.0"
++version = "0.6.3"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "2af4f95d8737f4ffafbd1fb3c703cdc898868a244a59786793cba0520ebdcbdd"
++checksum = "0fa0916b001582d253822171bd23f4a0229d32b9507fae236f5da8cad515ba7c"
++
++[[package]]
++name = "minimal-lexical"
++version = "0.2.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
+ 
+ [[package]]
+ name = "miniz_oxide"
+-version = "0.4.4"
++version = "0.7.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
++checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
+ dependencies = [
+  "adler",
+- "autocfg 1.0.1",
+ ]
+ 
+ [[package]]
+ name = "nettle"
+-version = "7.0.3"
++version = "7.3.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "a04390f9570e0c8949ed8f15d9e6f6f8a0a37a82b8c084803e7cd2f7f5c09ae2"
++checksum = "b9fdccf3eae7b161910d2daa2f0155ca35041322e8fe5c5f1f2c9d0b12356336"
+ dependencies = [
+- "getrandom",
++ "getrandom 0.2.10",
+  "libc",
+  "nettle-sys",
+  "thiserror",
++ "typenum",
+ ]
+ 
+ [[package]]
+ name = "nettle-sys"
+-version = "2.0.8"
++version = "2.2.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "b95aff9e61c8d8132e41dceae74c6e526edcac8d120072c87a300b9ab7e75226"
++checksum = "b5e81c347b9002da0b6b0c4060993c280e99eb14b42ecf65a2fefcd6eb3d8a73"
+ dependencies = [
+  "bindgen",
++ "cc",
++ "libc",
+  "pkg-config",
++ "tempfile",
+  "vcpkg",
+ ]
+ 
+@@ -706,21 +872,20 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
+ 
+ [[package]]
+ name = "nom"
+-version = "5.1.2"
++version = "7.1.3"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af"
++checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
+ dependencies = [
+  "memchr",
+- "version_check",
++ "minimal-lexical",
+ ]
+ 
+ [[package]]
+ name = "num-bigint-dig"
+-version = "0.6.1"
++version = "0.8.4"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "5d51546d704f52ef14b3c962b5776e53d5b862e5790e40a350d366c209bd7f7a"
++checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151"
+ dependencies = [
+- "autocfg 0.1.7",
+  "byteorder",
+  "lazy_static",
+  "libm",
+@@ -732,43 +897,49 @@ dependencies = [
+ 
+ [[package]]
+ name = "num-integer"
+-version = "0.1.44"
++version = "0.1.45"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
++checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
+ dependencies = [
+- "autocfg 1.0.1",
++ "autocfg",
+  "num-traits",
+ ]
+ 
+ [[package]]
+ name = "num-iter"
+-version = "0.1.42"
++version = "0.1.43"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59"
++checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252"
+ dependencies = [
+- "autocfg 1.0.1",
++ "autocfg",
+  "num-integer",
+  "num-traits",
+ ]
+ 
+ [[package]]
+ name = "num-traits"
+-version = "0.2.14"
++version = "0.2.16"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
++checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2"
+ dependencies = [
+- "autocfg 1.0.1",
++ "autocfg",
+ ]
+ 
+ [[package]]
+ name = "object"
+-version = "0.27.1"
++version = "0.32.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9"
++checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe"
+ dependencies = [
+  "memchr",
+ ]
+ 
++[[package]]
++name = "once_cell"
++version = "1.18.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
++
+ [[package]]
+ name = "opaque-debug"
+ version = "0.3.0"
+@@ -777,27 +948,25 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
+ 
+ [[package]]
+ name = "parking_lot"
+-version = "0.11.2"
++version = "0.12.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
++checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
+ dependencies = [
+- "instant",
+  "lock_api",
+  "parking_lot_core",
+ ]
+ 
+ [[package]]
+ name = "parking_lot_core"
+-version = "0.8.5"
++version = "0.9.8"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
++checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"
+ dependencies = [
+  "cfg-if",
+- "instant",
+  "libc",
+- "redox_syscall",
++ "redox_syscall 0.3.5",
+  "smallvec",
+- "winapi",
++ "windows-targets",
+ ]
+ 
+ [[package]]
+@@ -808,9 +977,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
+ 
+ [[package]]
+ name = "petgraph"
+-version = "0.5.1"
++version = "0.6.4"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7"
++checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9"
+ dependencies = [
+  "fixedbitset",
+  "indexmap",
+@@ -818,30 +987,24 @@ dependencies = [
+ 
+ [[package]]
+ name = "phf_shared"
+-version = "0.8.0"
++version = "0.10.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7"
++checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
+ dependencies = [
+  "siphasher",
+ ]
+ 
+-[[package]]
+-name = "pico-args"
+-version = "0.4.2"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468"
+-
+ [[package]]
+ name = "pkg-config"
+-version = "0.3.23"
++version = "0.3.27"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d1a3ea4f0dd7f1f3e512cf97bf100819aa547f36a6eccac8dbaae839eb92363e"
++checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
+ 
+ [[package]]
+ name = "ppv-lite86"
+-version = "0.2.15"
++version = "0.2.17"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"
++checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
+ 
+ [[package]]
+ name = "precomputed-hash"
+@@ -851,18 +1014,18 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
+ 
+ [[package]]
+ name = "proc-macro2"
+-version = "1.0.33"
++version = "1.0.66"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a"
++checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"
+ dependencies = [
+- "unicode-xid",
++ "unicode-ident",
+ ]
+ 
+ [[package]]
+ name = "quote"
+-version = "1.0.10"
++version = "1.0.33"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
++checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
+ dependencies = [
+  "proc-macro2",
+ ]
+@@ -873,8 +1036,10 @@ version = "0.7.3"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
+ dependencies = [
++ "getrandom 0.1.16",
++ "libc",
+  "rand_chacha",
+- "rand_core",
++ "rand_core 0.5.1",
+  "rand_hc",
+ ]
+ 
+@@ -885,7 +1050,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
+ dependencies = [
+  "ppv-lite86",
+- "rand_core",
++ "rand_core 0.5.1",
+ ]
+ 
+ [[package]]
+@@ -893,6 +1058,18 @@ name = "rand_core"
+ version = "0.5.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
++dependencies = [
++ "getrandom 0.1.16",
++]
++
++[[package]]
++name = "rand_core"
++version = "0.6.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
++dependencies = [
++ "getrandom 0.2.10",
++]
+ 
+ [[package]]
+ name = "rand_hc"
+@@ -900,50 +1077,78 @@ version = "0.2.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
+ dependencies = [
+- "rand_core",
++ "rand_core 0.5.1",
+ ]
+ 
+ [[package]]
+ name = "redox_syscall"
+-version = "0.2.10"
++version = "0.2.16"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
++checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
+ dependencies = [
+- "bitflags",
++ "bitflags 1.3.2",
++]
++
++[[package]]
++name = "redox_syscall"
++version = "0.3.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
++dependencies = [
++ "bitflags 1.3.2",
+ ]
+ 
+ [[package]]
+ name = "redox_users"
+-version = "0.4.0"
++version = "0.4.3"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
++checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
+ dependencies = [
+- "getrandom",
+- "redox_syscall",
++ "getrandom 0.2.10",
++ "redox_syscall 0.2.16",
++ "thiserror",
+ ]
+ 
+ [[package]]
+ name = "regex"
+-version = "1.5.4"
++version = "1.9.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a"
++dependencies = [
++ "aho-corasick",
++ "memchr",
++ "regex-automata",
++ "regex-syntax 0.7.4",
++]
++
++[[package]]
++name = "regex-automata"
++version = "0.3.6"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
++checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69"
+ dependencies = [
+  "aho-corasick",
+  "memchr",
+- "regex-syntax",
++ "regex-syntax 0.7.4",
+ ]
+ 
+ [[package]]
+ name = "regex-syntax"
+-version = "0.6.25"
++version = "0.6.29"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
++checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
++
++[[package]]
++name = "regex-syntax"
++version = "0.7.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2"
+ 
+ [[package]]
+ name = "rustc-demangle"
+-version = "0.1.21"
++version = "0.1.23"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
++checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
+ 
+ [[package]]
+ name = "rustc-hash"
+@@ -951,38 +1156,52 @@ version = "1.1.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
+ 
++[[package]]
++name = "rustix"
++version = "0.38.8"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f"
++dependencies = [
++ "bitflags 2.4.0",
++ "errno",
++ "libc",
++ "linux-raw-sys",
++ "windows-sys",
++]
++
+ [[package]]
+ name = "rustversion"
+-version = "1.0.6"
++version = "1.0.14"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
++checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
+ 
+ [[package]]
+ name = "ryu"
+-version = "1.0.6"
++version = "1.0.15"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568"
++checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
+ 
+ [[package]]
+ name = "scopeguard"
+-version = "1.1.0"
++version = "1.2.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
++checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+ 
+ [[package]]
+ name = "sequoia-openpgp"
+-version = "1.6.0"
++version = "1.16.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "158f4efb19da91b4d72f55048f52c133faf4033e3886298d146f7e2da3ceb7d5"
++checksum = "30efff3f9930e85b4284e76bbdad741f36412dfb1e370efd0de5866ae1a11dfc"
+ dependencies = [
+  "anyhow",
+- "backtrace",
+  "base64",
+  "buffered-reader",
+  "chrono",
++ "cipher",
+  "dyn-clone",
+  "eax",
+  "ed25519-dalek",
++ "getrandom 0.2.10",
+  "idna",
+  "lalrpop",
+  "lalrpop-util",
+@@ -991,8 +1210,10 @@ dependencies = [
+  "memsec",
+  "nettle",
+  "num-bigint-dig",
++ "once_cell",
++ "rand",
+  "regex",
+- "regex-syntax",
++ "regex-syntax 0.6.29",
+  "sha1collisiondetection",
+  "thiserror",
+  "win-crypto-ng",
+@@ -1013,15 +1234,15 @@ dependencies = [
+ 
+ [[package]]
+ name = "serde"
+-version = "1.0.130"
++version = "1.0.185"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
++checksum = "be9b6f69f1dfd54c3b568ffa45c310d6973a5e5148fd40cf515acaf38cf5bc31"
+ 
+ [[package]]
+ name = "serde_json"
+-version = "1.0.72"
++version = "1.0.105"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527"
++checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360"
+ dependencies = [
+  "itoa",
+  "ryu",
+@@ -1034,46 +1255,46 @@ version = "0.2.7"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "b20793cf8330b2c7da4c438116660fed24e380bcb8a1bcfff2581b5593a0b38e"
+ dependencies = [
+- "digest",
++ "digest 0.9.0",
+  "generic-array",
+ ]
+ 
+ [[package]]
+ name = "sha2"
+-version = "0.9.8"
++version = "0.9.9"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa"
++checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
+ dependencies = [
+- "block-buffer",
++ "block-buffer 0.9.0",
+  "cfg-if",
+  "cpufeatures",
+- "digest",
++ "digest 0.9.0",
+  "opaque-debug",
+ ]
+ 
+ [[package]]
+ name = "shlex"
+-version = "0.1.1"
++version = "1.1.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
++checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
+ 
+ [[package]]
+ name = "signature"
+-version = "1.4.0"
++version = "1.6.4"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788"
++checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
+ 
+ [[package]]
+ name = "siphasher"
+-version = "0.3.7"
++version = "0.3.11"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "533494a8f9b724d33625ab53c6c4800f7cc445895924a8ef649222dcb76e938b"
++checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
+ 
+ [[package]]
+ name = "smallvec"
+-version = "1.7.0"
++version = "1.11.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
++checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9"
+ 
+ [[package]]
+ name = "spin"
+@@ -1083,12 +1304,12 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
+ 
+ [[package]]
+ name = "string_cache"
+-version = "0.8.2"
++version = "0.8.7"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "923f0f39b6267d37d23ce71ae7235602134b250ace715dd2c90421998ddac0c6"
++checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
+ dependencies = [
+- "lazy_static",
+  "new_debug_unreachable",
++ "once_cell",
+  "parking_lot",
+  "phf_shared",
+  "precomputed-hash",
+@@ -1102,19 +1323,30 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
+ 
+ [[package]]
+ name = "subtle"
+-version = "2.4.1"
++version = "2.5.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
++checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
+ 
+ [[package]]
+ name = "syn"
+-version = "1.0.82"
++version = "1.0.109"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59"
++checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+ dependencies = [
+  "proc-macro2",
+  "quote",
+- "unicode-xid",
++ "unicode-ident",
++]
++
++[[package]]
++name = "syn"
++version = "2.0.29"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "unicode-ident",
+ ]
+ 
+ [[package]]
+@@ -1125,10 +1357,23 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
+ dependencies = [
+  "proc-macro2",
+  "quote",
+- "syn",
++ "syn 1.0.109",
+  "unicode-xid",
+ ]
+ 
++[[package]]
++name = "tempfile"
++version = "3.8.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef"
++dependencies = [
++ "cfg-if",
++ "fastrand",
++ "redox_syscall 0.3.5",
++ "rustix",
++ "windows-sys",
++]
++
+ [[package]]
+ name = "term"
+ version = "0.7.0"
+@@ -1162,31 +1407,32 @@ dependencies = [
+ 
+ [[package]]
+ name = "thiserror"
+-version = "1.0.30"
++version = "1.0.47"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
++checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f"
+ dependencies = [
+  "thiserror-impl",
+ ]
+ 
+ [[package]]
+ name = "thiserror-impl"
+-version = "1.0.30"
++version = "1.0.47"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
++checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b"
+ dependencies = [
+  "proc-macro2",
+  "quote",
+- "syn",
++ "syn 2.0.29",
+ ]
+ 
+ [[package]]
+ name = "time"
+-version = "0.1.43"
++version = "0.1.45"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
++checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
+ dependencies = [
+  "libc",
++ "wasi 0.10.0+wasi-snapshot-preview1",
+  "winapi",
+ ]
+ 
+@@ -1201,51 +1447,57 @@ dependencies = [
+ 
+ [[package]]
+ name = "tinyvec"
+-version = "1.5.1"
++version = "1.6.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2"
++checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
+ dependencies = [
+  "tinyvec_macros",
+ ]
+ 
+ [[package]]
+ name = "tinyvec_macros"
+-version = "0.1.0"
++version = "0.1.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
++checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
+ 
+ [[package]]
+ name = "typenum"
+-version = "1.14.0"
++version = "1.16.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec"
++checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
+ 
+ [[package]]
+ name = "unicode-bidi"
+-version = "0.3.7"
++version = "0.3.13"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
++
++[[package]]
++name = "unicode-ident"
++version = "1.0.11"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f"
++checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
+ 
+ [[package]]
+ name = "unicode-normalization"
+-version = "0.1.19"
++version = "0.1.22"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9"
++checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
+ dependencies = [
+  "tinyvec",
+ ]
+ 
+ [[package]]
+ name = "unicode-width"
+-version = "0.1.9"
++version = "0.1.10"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
++checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
+ 
+ [[package]]
+ name = "unicode-xid"
+-version = "0.2.2"
++version = "0.2.4"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
++checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
+ 
+ [[package]]
+ name = "vcpkg"
+@@ -1261,25 +1513,91 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
+ 
+ [[package]]
+ name = "version_check"
+-version = "0.9.3"
++version = "0.9.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
++
++[[package]]
++name = "wasi"
++version = "0.9.0+wasi-snapshot-preview1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
++
++[[package]]
++name = "wasi"
++version = "0.10.0+wasi-snapshot-preview1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
++checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
+ 
+ [[package]]
+ name = "wasi"
+-version = "0.10.2+wasi-snapshot-preview1"
++version = "0.11.0+wasi-snapshot-preview1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
++checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
++
++[[package]]
++name = "wasm-bindgen"
++version = "0.2.87"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
++dependencies = [
++ "cfg-if",
++ "wasm-bindgen-macro",
++]
++
++[[package]]
++name = "wasm-bindgen-backend"
++version = "0.2.87"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
++dependencies = [
++ "bumpalo",
++ "log",
++ "once_cell",
++ "proc-macro2",
++ "quote",
++ "syn 2.0.29",
++ "wasm-bindgen-shared",
++]
++
++[[package]]
++name = "wasm-bindgen-macro"
++version = "0.2.87"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
++dependencies = [
++ "quote",
++ "wasm-bindgen-macro-support",
++]
++
++[[package]]
++name = "wasm-bindgen-macro-support"
++version = "0.2.87"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "syn 2.0.29",
++ "wasm-bindgen-backend",
++ "wasm-bindgen-shared",
++]
++
++[[package]]
++name = "wasm-bindgen-shared"
++version = "0.2.87"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
+ 
+ [[package]]
+ name = "win-crypto-ng"
+-version = "0.4.0"
++version = "0.5.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "24cf92e98e8f4ade45b5140795415a0f256fd9b69a1919248dcda11ba5d6466c"
++checksum = "aea60789d46dc8aa7d41758143c1b7dc2d6101a421712f88716a9646da2a4e39"
+ dependencies = [
+  "cipher",
+  "doc-comment",
+- "rand_core",
++ "rand_core 0.5.1",
+  "winapi",
+  "zeroize",
+ ]
+@@ -1306,29 +1624,103 @@ version = "0.4.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+ 
++[[package]]
++name = "windows"
++version = "0.48.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
++dependencies = [
++ "windows-targets",
++]
++
++[[package]]
++name = "windows-sys"
++version = "0.48.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
++dependencies = [
++ "windows-targets",
++]
++
++[[package]]
++name = "windows-targets"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
++dependencies = [
++ "windows_aarch64_gnullvm",
++ "windows_aarch64_msvc",
++ "windows_i686_gnu",
++ "windows_i686_msvc",
++ "windows_x86_64_gnu",
++ "windows_x86_64_gnullvm",
++ "windows_x86_64_msvc",
++]
++
++[[package]]
++name = "windows_aarch64_gnullvm"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
++
++[[package]]
++name = "windows_aarch64_msvc"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
++
++[[package]]
++name = "windows_i686_gnu"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
++
++[[package]]
++name = "windows_i686_msvc"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
++
++[[package]]
++name = "windows_x86_64_gnu"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
++
++[[package]]
++name = "windows_x86_64_gnullvm"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
++
++[[package]]
++name = "windows_x86_64_msvc"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
++
+ [[package]]
+ name = "xxhash-rust"
+-version = "0.8.2"
++version = "0.8.6"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "e575e15bedf6e57b5c2d763ffc6c3c760143466cbd09d762d539680ab5992ded"
++checksum = "735a71d46c4d68d71d4b24d03fdc2b98e38cea81730595801db779c04fe80d70"
+ 
+ [[package]]
+ name = "zeroize"
+-version = "1.4.3"
++version = "1.3.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619"
++checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd"
+ dependencies = [
+  "zeroize_derive",
+ ]
+ 
+ [[package]]
+ name = "zeroize_derive"
+-version = "1.2.2"
++version = "1.4.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73"
++checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
+ dependencies = [
+  "proc-macro2",
+  "quote",
+- "syn",
+- "synstructure",
++ "syn 2.0.29",
+ ]
+diff --git a/src/sqv.rs b/src/sqv.rs
+index 08beef3c092aeaa2f4a7051450d9550c1756f24c..07b0673b63bcb5626f2e0d9bff0d5a009b67ea75 100644
+--- a/src/sqv.rs
++++ b/src/sqv.rs
+@@ -260,7 +260,7 @@ fn main() -> Result<()> {
+ 
+     let not_before: Option<std::time::SystemTime> =
+         if let Some(t) = matches.value_of("not-before") {
+-            Some(parse_iso8601(t, chrono::NaiveTime::from_hms(0, 0, 0))
++            Some(parse_iso8601(t, chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap())
+                  .context(format!("Bad value passed to --not-before: {:?}", t))?
+                  .into())
+         } else {
+@@ -268,7 +268,7 @@ fn main() -> Result<()> {
+         };
+     let not_after: std::time::SystemTime =
+         if let Some(t) = matches.value_of("not-after") {
+-            Some(parse_iso8601(t, chrono::NaiveTime::from_hms(23, 59, 59))
++            Some(parse_iso8601(t, chrono::NaiveTime::from_hms_opt(23, 59, 59).unwrap())
+                  .context(format!("Bad value passed to --not-after: {:?}", t))?
+                  .into())
+         } else {
+@@ -342,7 +342,7 @@ fn parse_iso8601(s: &str, pad_date_with: chrono::NaiveTime)
+ 
+ #[test]
+ fn test_parse_iso8601() {
+-    let z = chrono::NaiveTime::from_hms(0, 0, 0);
++    let z = chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap();
+     parse_iso8601("2017-03-04T13:25:35Z", z).unwrap();
+     parse_iso8601("2017-03-04T13:25:35+08:30", z).unwrap();
+     parse_iso8601("2017-03-04T13:25:35", z).unwrap();
+diff --git a/tests/revoked-key.rs b/tests/revoked-key.rs
+index 86caceae742d535aae9e81014accadb279ea22a1..d5ae27dd11fca81d6860ff5ec0add31ceab5345c 100644
+--- a/tests/revoked-key.rs
++++ b/tests/revoked-key.rs
+@@ -276,10 +276,10 @@ fn create_key() {
+     use chrono::offset::TimeZone;
+ 
+     let msg = b"Hello, World";
+-    let t0 = chrono::offset::Utc.timestamp(1483228800, 0); // 2017-01-01
+-    let t1 = chrono::offset::Utc.timestamp(1514764800, 0); // 2018-01-01
+-    let t2 = chrono::offset::Utc.timestamp(1546300800, 0); // 2019-01-01
+-    let t3 = chrono::offset::Utc.timestamp(1577836800, 0); // 2020-01-01
++    let t0 = chrono::offset::Utc.timestamp_opt(1483228800, 0).unwrap(); // 2017-01-01
++    let t1 = chrono::offset::Utc.timestamp_opt(1514764800, 0).unwrap(); // 2018-01-01
++    let t2 = chrono::offset::Utc.timestamp_opt(1546300800, 0).unwrap(); // 2019-01-01
++    let t3 = chrono::offset::Utc.timestamp_opt(1577836800, 0).unwrap(); // 2020-01-01
+     let f1: f32 = 0.4; // Chosen by fair dice roll.
+     let f2: f32 = 0.7; // Likewise.
+     let t12 = t1 + chrono::Duration::days((300.0 * f1) as i64);
diff --git a/srcpkgs/sequoia-sqv/template b/srcpkgs/sequoia-sqv/template
index d663d78abb9bf..a54a8c1785ad6 100644
--- a/srcpkgs/sequoia-sqv/template
+++ b/srcpkgs/sequoia-sqv/template
@@ -1,10 +1,10 @@
 # Template file for 'sequoia-sqv'
 pkgname=sequoia-sqv
 version=1.1.0
-revision=1
+revision=2
 build_style=cargo
-hostmakedepends="pkg-config llvm clang"
-makedepends="nettle-devel"
+hostmakedepends="pkg-config"
+makedepends="nettle-devel libclang"
 short_desc="Simple PGP signature verification program"
 maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
 license="GPL-2.0-or-later"

From d6289103c1121cdeac1167fe10f07bccd0ac4226 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 42/44] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

From a51f7302844c9a2adcfe05ba0a238748c7fc69cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 15:43:09 -0500
Subject: [PATCH 43/44] thunderbird: Broken with python3.12

---
 srcpkgs/thunderbird/template | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template
index 2400ca23ea8a8..d58aac0b8b2e5 100644
--- a/srcpkgs/thunderbird/template
+++ b/srcpkgs/thunderbird/template
@@ -4,7 +4,7 @@
 #
 pkgname=thunderbird
 version=115.1.0
-revision=2
+revision=3
 build_helper="rust"
 short_desc="Standalone Mail/News reader"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
@@ -29,6 +29,8 @@ depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme libotr"
 build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 
+broken="python3.12: 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'"
+
 case $XBPS_TARGET_MACHINE in
 	armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
 	ppc64*) ;;

From cbaa08aeb49339223f20703acc5580cf97a2bced Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 15:43:12 -0500
Subject: [PATCH 44/44] thunderbird-i18n: Broken with python3.12

---
 srcpkgs/thunderbird-i18n/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/thunderbird-i18n/template b/srcpkgs/thunderbird-i18n/template
index f46f26fa85e9d..b0570b43c2d25 100644
--- a/srcpkgs/thunderbird-i18n/template
+++ b/srcpkgs/thunderbird-i18n/template
@@ -1,7 +1,7 @@
 # Template file for 'thunderbird-i18n'
 pkgname=thunderbird-i18n
 version=115.1.0
-revision=1
+revision=2
 build_style=meta
 short_desc="Thunderbird language packs"
 maintainer="Enno Boland <gottox@voidlinux.org>"

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (100 preceding siblings ...)
  2024-02-01 20:43 ` Calandracas606
@ 2024-02-01 20:58 ` Calandracas606
  2024-02-01 22:52 ` [PR PATCH] [Updated] " Calandracas606
                   ` (16 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-01 20:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1922232039

Comment:
As there's been a lot of changes, I feel a review at this point would be beneficial.

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (101 preceding siblings ...)
  2024-02-01 20:58 ` Calandracas606
@ 2024-02-01 22:52 ` Calandracas606
  2024-02-01 23:03 ` Calandracas606
                   ` (15 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-01 22:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 131871 bytes --]

From 094ac3e66c8eaff8075cdd21d7035e9171aaa9e7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/31] New package: llvm17

---
 common/shlibs                                 |  19 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-analyzer15                      |   1 +
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/clang-tools-extra15                   |   1 +
 srcpkgs/clang15                               |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15                              |   1 +
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15                           |   1 +
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/libomp15                              |   1 +
 srcpkgs/libomp15-devel                        |   1 +
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-devel                            |   1 +
 srcpkgs/llvm-doc                              |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm-libunwind15                      |   1 +
 srcpkgs/llvm-libunwind15-devel                |   1 +
 srcpkgs/llvm-tools                            |   1 +
 srcpkgs/llvm/template                         |  22 +-
 srcpkgs/llvm15/template                       |  75 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 823 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 69 files changed, 1426 insertions(+), 66 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx15
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/libomp15
 create mode 120000 srcpkgs/libomp15-devel
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-devel
 create mode 120000 srcpkgs/llvm-doc
 create mode 120000 srcpkgs/llvm-libunwind15
 create mode 120000 srcpkgs/llvm-libunwind15-devel
 create mode 120000 srcpkgs/llvm-tools
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..389991b3c262a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,20 @@ 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.17 lldb-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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
-libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libLLVM-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm17-17.0.6_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.15 libomp15-15.0.7_4
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15 b/srcpkgs/libcxx15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15 b/srcpkgs/libcxxabi15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp15 b/srcpkgs/libomp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp15-devel b/srcpkgs/libomp15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-devel b/srcpkgs/llvm-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-doc b/srcpkgs/llvm-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15 b/srcpkgs/llvm-libunwind15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15-devel b/srcpkgs/llvm-libunwind15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-tools b/srcpkgs/llvm-tools
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-tools
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..e8854e00f1a78 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,27 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..bdd9b40ef82e7 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -34,8 +34,8 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -68,12 +68,12 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
 esac
 
-subpackages="clang-tools-extra"
+subpackages="clang-tools-extra15"
 
 # must go before clang
 if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
+	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
 	depends+=" libomp>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
@@ -83,17 +83,17 @@ if [ "$_libomp_enable" = "yes" ]; then
 	fi
 fi
 
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm15"
+subpackages+=" clang15 clang-analyzer15 libclang15 libclang-cpp15
+ llvm-libunwind15 llvm-libunwind15-devel libcxx15 libcxx15-devel
+ libcxxabi15 libcxxabi15-devel libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -224,9 +224,9 @@ do_install() {
 		644 usr/include/mach-o
 }
 
-clang-analyzer_package() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +237,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -279,10 +279,10 @@ clang-tools-extra_package() {
 	}
 }
 
-clang_package() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -302,21 +302,21 @@ clang_package() {
 	}
 }
 
-libclang_package() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -329,11 +329,11 @@ lld_package() {
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +341,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +353,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,16 +363,16 @@ lldb-devel_package() {
 	}
 }
 
-llvm-libunwind_package() {
+llvm-libunwind15_package() {
 	short_desc+=" - libunwind"
 	pkg_install() {
 		vmove "usr/lib/libunwind.so.*"
 	}
 }
 
-llvm-libunwind-devel_package() {
+llvm-libunwind15-devel_package() {
 	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
+	depends="llvm-libunwind15>=${version}_${revision}"
 	conflicts="libunwind-devel>=0"
 	pkg_install() {
 		vmove usr/include/mach-o
@@ -383,16 +383,16 @@ llvm-libunwind-devel_package() {
 	}
 }
 
-libcxxabi_package() {
+libcxxabi15_package() {
 	short_desc+=" - low level support for libc++"
 	pkg_install() {
 		vmove "usr/lib/libc++abi.so.*"
 	}
 }
 
-libcxxabi-devel_package() {
+libcxxabi15-devel_package() {
 	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
+	depends="libcxxabi15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/*cxxabi*"
 		vmove "usr/lib/libc++abi.so"
@@ -400,16 +400,16 @@ libcxxabi-devel_package() {
 	}
 }
 
-libcxx_package() {
+libcxx15_package() {
 	short_desc+=" - C++ standard library"
 	pkg_install() {
 		vmove "usr/lib/libc++.so.*"
 	}
 }
 
-libcxx-devel_package() {
+libcxx15-devel_package() {
 	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
+	depends="libcxx15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/c++
 		vmove "usr/lib/libc++.so"
@@ -419,19 +419,16 @@ libcxx-devel_package() {
 	}
 }
 
-libomp_package() {
+libomp15_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() {
+libomp15-devel_package() {
 	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
+	depends="libomp15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/omp*.h"
 		vmove "usr/lib/clang/${version}/include/omp*.h"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..017771fb7626b
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,823 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="llvm-tools>=${version}_${revision} libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang17 libclang-cpp17 clang-analyzer "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm-doc llvm-tools llvm-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+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/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm-tools_package() {
+	pycompile_dirs="usr/share/opt-viewer"
+	short_desc+=" - development tools"
+	pkg_install() {
+		vmove usr/share/opt-viewer
+
+		vmove usr/lib/LLVMgold.so
+
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/bin/llvm-addr2line
+		vmove usr/bin/llvm-bitcode-strip
+		vmove usr/bin/llvm-dlltool
+		vmove usr/bin/llvm-install-name-tool
+		vmove usr/bin/llvm-lib
+		vmove usr/bin/llvm-otool
+		vmove usr/bin/llvm-ranlib
+		vmove usr/bin/llvm-readelf
+		vmove usr/bin/llvm-strip
+		vmove usr/bin/llvm-windres
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
+
+llvm-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 24040b23cced6d0cb64cbdb6361f5a92852bc3f9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 17:09:06 -0500
Subject: [PATCH 02/31] llvm17

---
 srcpkgs/llvm-tools                   |   1 -
 srcpkgs/{llvm-devel => llvm17-devel} |   0
 srcpkgs/llvm17/template              | 163 +--------------------------
 3 files changed, 4 insertions(+), 160 deletions(-)
 delete mode 120000 srcpkgs/llvm-tools
 rename srcpkgs/{llvm-devel => llvm17-devel} (100%)

diff --git a/srcpkgs/llvm-tools b/srcpkgs/llvm-tools
deleted file mode 120000
index 96970d5c02c13..0000000000000
--- a/srcpkgs/llvm-tools
+++ /dev/null
@@ -1 +0,0 @@
-llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-devel b/srcpkgs/llvm17-devel
similarity index 100%
rename from srcpkgs/llvm-devel
rename to srcpkgs/llvm17-devel
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index 017771fb7626b..fbb78b5b4cb39 100644
--- a/srcpkgs/llvm17/template
+++ b/srcpkgs/llvm17/template
@@ -35,7 +35,7 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
  python3-recommonmark python3-sphinx-automodapi git python3-sphinx-markdown-tables python3-yaml pkg-config "
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel "
-depends="llvm-tools>=${version}_${revision} libllvm17>=${version}_${revision}"
+depends="libllvm17>=${version}_${revision}"
 short_desc="LLVM Compiler Infrastructure Project - Version 17"
 maintainer="Daniel Martinez <danielmartinez@cock.li>"
 license="Apache-2.0"
@@ -44,6 +44,7 @@ distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${vers
 checksum=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
 lib32disabled=yes
 python_version=3
+pycompile_dirs="usr/share/scan-view"
 
 build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
 build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
@@ -99,7 +100,7 @@ if [ "$build_option_openmp" ]; then
 	_enabled_projects+="openmp;"
 	subpackages+=" libomp libomp-devel "
 fi
-subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm-doc llvm-tools llvm-devel "
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm-doc llvm17-devel "
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -356,7 +357,6 @@ libclang-cpp17_package() {
 }
 
 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/"
@@ -643,162 +643,7 @@ llvm-doc_package() {
 	}
 }
 
-llvm-tools_package() {
-	pycompile_dirs="usr/share/opt-viewer"
-	short_desc+=" - development tools"
-	pkg_install() {
-		vmove usr/share/opt-viewer
-
-		vmove usr/lib/LLVMgold.so
-
-		vmove usr/bin/FileCheck
-		vmove usr/bin/UnicodeNameMappingGenerator
-		vmove usr/bin/bugpoint
-		vmove usr/bin/count
-		vmove usr/bin/dsymutil
-		vmove usr/bin/intercept-build
-		vmove usr/bin/llc
-		vmove usr/bin/lli
-		vmove usr/bin/lli-child-target
-		vmove usr/bin/not
-		vmove usr/bin/obj2yaml
-		vmove usr/bin/opt
-		vmove usr/bin/sancov
-		vmove usr/bin/sanstats
-		vmove usr/bin/split-file
-		vmove usr/bin/verify-uselistorder
-		vmove usr/bin/yaml-bench
-		vmove usr/bin/yaml2obj
-		vmove usr/bin/llvm-PerfectShuffle
-		vmove usr/bin/llvm-ar
-		vmove usr/bin/llvm-as
-		vmove usr/bin/llvm-bcanalyzer
-		vmove usr/bin/llvm-c-test
-		vmove usr/bin/llvm-cat
-		vmove usr/bin/llvm-cfi-verify
-		vmove usr/bin/llvm-config
-		vmove usr/bin/llvm-cov
-		vmove usr/bin/llvm-cvtres
-		vmove usr/bin/llvm-cxxdump
-		vmove usr/bin/llvm-cxxfilt
-		vmove usr/bin/llvm-cxxmap
-		vmove usr/bin/llvm-debuginfo-analyzer
-		vmove usr/bin/llvm-debuginfod
-		vmove usr/bin/llvm-debuginfod-find
-		vmove usr/bin/llvm-diff
-		vmove usr/bin/llvm-dis
-		vmove usr/bin/llvm-dwarfdump
-		vmove usr/bin/llvm-dwarfutil
-		vmove usr/bin/llvm-dwp
-		vmove usr/bin/llvm-exegesis
-		vmove usr/bin/llvm-extract
-		vmove usr/bin/llvm-gsymutil
-		vmove usr/bin/llvm-ifs
-		vmove usr/bin/llvm-jitlink
-		vmove usr/bin/llvm-jitlink-executor
-		vmove usr/bin/llvm-libtool-darwin
-		vmove usr/bin/llvm-link
-		vmove usr/bin/llvm-lipo
-		vmove usr/bin/llvm-lto
-		vmove usr/bin/llvm-lto2
-		vmove usr/bin/llvm-mc
-		vmove usr/bin/llvm-mca
-		vmove usr/bin/llvm-ml
-		vmove usr/bin/llvm-modextract
-		vmove usr/bin/llvm-mt
-		vmove usr/bin/llvm-nm
-		vmove usr/bin/llvm-objcopy
-		vmove usr/bin/llvm-objdump
-		vmove usr/bin/llvm-opt-report
-		vmove usr/bin/llvm-pdbutil
-		vmove usr/bin/llvm-profdata
-		vmove usr/bin/llvm-profgen
-		vmove usr/bin/llvm-rc
-		vmove usr/bin/llvm-readobj
-		vmove usr/bin/llvm-reduce
-		vmove usr/bin/llvm-remark-size-diff
-		vmove usr/bin/llvm-remarkutil
-		vmove usr/bin/llvm-rtdyld
-		vmove usr/bin/llvm-sim
-		vmove usr/bin/llvm-size
-		vmove usr/bin/llvm-split
-		vmove usr/bin/llvm-stress
-		vmove usr/bin/llvm-strings
-		vmove usr/bin/llvm-symbolizer
-		vmove usr/bin/llvm-tapi-diff
-		vmove usr/bin/llvm-tblgen
-		vmove usr/bin/llvm-tli-checker
-		vmove usr/bin/llvm-undname
-		vmove usr/bin/llvm-xray
-		vmove usr/bin/llvm-addr2line
-		vmove usr/bin/llvm-bitcode-strip
-		vmove usr/bin/llvm-dlltool
-		vmove usr/bin/llvm-install-name-tool
-		vmove usr/bin/llvm-lib
-		vmove usr/bin/llvm-otool
-		vmove usr/bin/llvm-ranlib
-		vmove usr/bin/llvm-readelf
-		vmove usr/bin/llvm-strip
-		vmove usr/bin/llvm-windres
-		vmove usr/share/man/man1/FileCheck.1
-		vmove usr/share/man/man1/bugpoint.1
-		vmove usr/share/man/man1/clang-tblgen.1
-		vmove usr/share/man/man1/dsymutil.1
-		vmove usr/share/man/man1/lit.1
-		vmove usr/share/man/man1/llc.1
-		vmove usr/share/man/man1/lldb-tblgen.1
-		vmove usr/share/man/man1/lli.1
-		vmove usr/share/man/man1/opt.1
-		vmove usr/share/man/man1/tblgen.1
-		vmove usr/share/man/man1/llvm-addr2line.1
-		vmove usr/share/man/man1/llvm-ar.1
-		vmove usr/share/man/man1/llvm-as.1
-		vmove usr/share/man/man1/llvm-bcanalyzer.1
-		vmove usr/share/man/man1/llvm-config.1
-		vmove usr/share/man/man1/llvm-cov.1
-		vmove usr/share/man/man1/llvm-cxxfilt.1
-		vmove usr/share/man/man1/llvm-cxxmap.1
-		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
-		vmove usr/share/man/man1/llvm-diff.1
-		vmove usr/share/man/man1/llvm-dis.1
-		vmove usr/share/man/man1/llvm-dwarfdump.1
-		vmove usr/share/man/man1/llvm-dwarfutil.1
-		vmove usr/share/man/man1/llvm-exegesis.1
-		vmove usr/share/man/man1/llvm-extract.1
-		vmove usr/share/man/man1/llvm-ifs.1
-		vmove usr/share/man/man1/llvm-install-name-tool.1
-		vmove usr/share/man/man1/llvm-lib.1
-		vmove usr/share/man/man1/llvm-libtool-darwin.1
-		vmove usr/share/man/man1/llvm-link.1
-		vmove usr/share/man/man1/llvm-lipo.1
-		vmove usr/share/man/man1/llvm-locstats.1
-		vmove usr/share/man/man1/llvm-mc.1
-		vmove usr/share/man/man1/llvm-mca.1
-		vmove usr/share/man/man1/llvm-nm.1
-		vmove usr/share/man/man1/llvm-objcopy.1
-		vmove usr/share/man/man1/llvm-objdump.1
-		vmove usr/share/man/man1/llvm-opt-report.1
-		vmove usr/share/man/man1/llvm-otool.1
-		vmove usr/share/man/man1/llvm-pdbutil.1
-		vmove usr/share/man/man1/llvm-profdata.1
-		vmove usr/share/man/man1/llvm-profgen.1
-		vmove usr/share/man/man1/llvm-ranlib.1
-		vmove usr/share/man/man1/llvm-readelf.1
-		vmove usr/share/man/man1/llvm-readobj.1
-		vmove usr/share/man/man1/llvm-reduce.1
-		vmove usr/share/man/man1/llvm-remark-size-diff.1
-		vmove usr/share/man/man1/llvm-remarkutil.1
-		vmove usr/share/man/man1/llvm-size.1
-		vmove usr/share/man/man1/llvm-stress.1
-		vmove usr/share/man/man1/llvm-strings.1
-		vmove usr/share/man/man1/llvm-strip.1
-		vmove usr/share/man/man1/llvm-symbolizer.1
-		vmove usr/share/man/man1/llvm-tblgen.1
-		vmove usr/share/man/man1/llvm-tli-checker.1
-	}
-}
-
-llvm-devel_package() {
+llvm17-devel_package() {
 	short_desc+=" - development files"
 	depends="llvm17>=${version}_${revision}"
 	if [ "$build_option_openmp" ]; then

From d4246333220b972f2f59025613f6c50ec204bc7b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 03/31] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From ee9f544c4a665ce9f5c345fe16aeb7eefffdf8d2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 04/31] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 9e8a4f916b2f6634724b7149bff778d0a8c8fab4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 05/31] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 65174a04a1b087eb4e8ae73de6f446998098b97f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 06/31] SPIRV-LLVM-Translator: update to 17.0.0.

---
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 7f3a5009c44e0e6ad8427373d3ebbd85d7cb8c99 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/31] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From bc6b932b400477714cb0fa3f451d51be593e5bfe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/31] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..b7c0394a7f366 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 8b92d369030e50753c807d34921b665f748e339f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/31] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From 1435f6aa5d07881601179b922b504ca7b0a2072d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/31] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From de954d76edcf6155ab4c6f4e38a5e8399a45793c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 11/31] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 2f21dd0ab430194a8cfeed18268f9e9578a1fa85 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 12/31] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 28a24464423d59382800e231010f8cd5671b5b79 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 13/31] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From af5d9aae520abcb1f3974038290fed2bb00ea8b4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 14/31] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 389991b3c262a..fcea763fcb975 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2613,22 +2613,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From e9c081a69eef246eebe57a0d26637470dfe9636e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 15/31] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 73b83be66f81ea837d94f7e763c3ab67c33f2d79 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 16/31] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 629f3b3899c30a4e2df2a1e16c75eb10d7a719de Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 17/31] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 6 +++---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index fcea763fcb975..9d99867914fe3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2148,10 +2148,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..c95ed661f6cff 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
@@ -13,8 +13,8 @@ configure_args="
 conf_files="/etc/ldc2.conf"
 hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
- llvm-libunwind-devel"
-depends="ldc-runtime llvm-libunwind-devel"
+ llvm-libunwind15-devel"
+depends="ldc-runtime llvm-libunwind15-devel"
 checkdepends="python3"
 short_desc="Portable D programming language compiler based on LLVM"
 maintainer="Auri <me@aurieh.me>"

From 77cae20bce81ed747a80dba094963f51de12fc76 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 18/31] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 7df7e7caea2518a3d815984f8e743b3fa33201cd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 19/31] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From a78ed3e3474ea2018323e2ee0b6c235af5e28704 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 20/31] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..80b156e616de8 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 37d2633be93eb3c05afe46e9318dbdf5273745e1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 21/31] zig: Build against old llvm15 packages

---
 srcpkgs/llvm15/template | 2 +-
 srcpkgs/zig/template    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index bdd9b40ef82e7..1253f17cf1c4f 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -75,7 +75,7 @@ if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
 	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
+	depends+=" libomp15>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
 		# Seems to require a full host llvm/clang build
 		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 58846a092b620010bb1cd22484c59724cd1ebc66 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 22/31] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..82b329424fa37 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 0c3edf4b2629d8edf640b92383a787b54461b938 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 23/31] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..5dd4b6e674647 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From daa4e630054089d1ddb7eb341657e382c167d5ac Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 24/31] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From 9db6951212acffce86458e9fe4618524aa5fdd26 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 25/31] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 522c18b96329549a9d6a5aac4cd7cf510a47eedc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 26/31] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From 6bbc76cabf417fd96a701b8e56019adc59d8c178 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 27/31] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..fd9dcd1fa61c7 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From 514f980cfe1143abeafe2c4fb203eec2bde06224 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 28/31] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From d9ba1494c4feff44b3643ec73547a1450348e602 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 29/31] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From f47261e3bbd766f477d4a7dbf2c01d0d9816d25d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 30/31] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

From 07ffbced571c845c6bad37af2dd96e510a027ec1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 15:43:09 -0500
Subject: [PATCH 31/31] thunderbird: Broken with python3.12

---
 srcpkgs/thunderbird/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template
index 2400ca23ea8a8..a745f64947c9e 100644
--- a/srcpkgs/thunderbird/template
+++ b/srcpkgs/thunderbird/template
@@ -29,6 +29,8 @@ depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme libotr"
 build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 
+broken="python3.12: 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'"
+
 case $XBPS_TARGET_MACHINE in
 	armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
 	ppc64*) ;;

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (102 preceding siblings ...)
  2024-02-01 22:52 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-02-01 23:03 ` Calandracas606
  2024-02-02  4:14 ` Calandracas606
                   ` (14 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-01 23:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 131423 bytes --]

From 094ac3e66c8eaff8075cdd21d7035e9171aaa9e7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/31] New package: llvm17

---
 common/shlibs                                 |  19 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-analyzer15                      |   1 +
 srcpkgs/clang-devel                           |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/clang-tools-extra15                   |   1 +
 srcpkgs/clang15                               |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/flang                                 |   1 +
 srcpkgs/flang-devel                           |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15                              |   1 +
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15                           |   1 +
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/libomp15                              |   1 +
 srcpkgs/libomp15-devel                        |   1 +
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-devel                            |   1 +
 srcpkgs/llvm-doc                              |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm-libunwind15                      |   1 +
 srcpkgs/llvm-libunwind15-devel                |   1 +
 srcpkgs/llvm-tools                            |   1 +
 srcpkgs/llvm/template                         |  22 +-
 srcpkgs/llvm15/template                       |  75 +-
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 +
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 823 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir                                  |   1 +
 srcpkgs/mlir-devel                            |   1 +
 69 files changed, 1426 insertions(+), 66 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-devel
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/flang
 create mode 120000 srcpkgs/flang-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx15
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/libomp15
 create mode 120000 srcpkgs/libomp15-devel
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-devel
 create mode 120000 srcpkgs/llvm-doc
 create mode 120000 srcpkgs/llvm-libunwind15
 create mode 120000 srcpkgs/llvm-libunwind15-devel
 create mode 120000 srcpkgs/llvm-tools
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir
 create mode 120000 srcpkgs/mlir-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..389991b3c262a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,20 @@ 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.17 lldb-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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
-libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libLLVM-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm17-17.0.6_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.15 libomp15-15.0.7_4
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-devel b/srcpkgs/clang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang b/srcpkgs/flang
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang-devel b/srcpkgs/flang-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15 b/srcpkgs/libcxx15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15 b/srcpkgs/libcxxabi15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp15 b/srcpkgs/libomp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp15-devel b/srcpkgs/libomp15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libomp15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-devel b/srcpkgs/llvm-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-doc b/srcpkgs/llvm-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15 b/srcpkgs/llvm-libunwind15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind15-devel b/srcpkgs/llvm-libunwind15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/llvm-libunwind15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-tools b/srcpkgs/llvm-tools
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-tools
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..e8854e00f1a78 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,27 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..bdd9b40ef82e7 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -34,8 +34,8 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -68,12 +68,12 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
 esac
 
-subpackages="clang-tools-extra"
+subpackages="clang-tools-extra15"
 
 # must go before clang
 if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
+	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
 	depends+=" libomp>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
@@ -83,17 +83,17 @@ if [ "$_libomp_enable" = "yes" ]; then
 	fi
 fi
 
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm15"
+subpackages+=" clang15 clang-analyzer15 libclang15 libclang-cpp15
+ llvm-libunwind15 llvm-libunwind15-devel libcxx15 libcxx15-devel
+ libcxxabi15 libcxxabi15-devel libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -224,9 +224,9 @@ do_install() {
 		644 usr/include/mach-o
 }
 
-clang-analyzer_package() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +237,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -279,10 +279,10 @@ clang-tools-extra_package() {
 	}
 }
 
-clang_package() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -302,21 +302,21 @@ clang_package() {
 	}
 }
 
-libclang_package() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -329,11 +329,11 @@ lld_package() {
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +341,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +353,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,16 +363,16 @@ lldb-devel_package() {
 	}
 }
 
-llvm-libunwind_package() {
+llvm-libunwind15_package() {
 	short_desc+=" - libunwind"
 	pkg_install() {
 		vmove "usr/lib/libunwind.so.*"
 	}
 }
 
-llvm-libunwind-devel_package() {
+llvm-libunwind15-devel_package() {
 	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
+	depends="llvm-libunwind15>=${version}_${revision}"
 	conflicts="libunwind-devel>=0"
 	pkg_install() {
 		vmove usr/include/mach-o
@@ -383,16 +383,16 @@ llvm-libunwind-devel_package() {
 	}
 }
 
-libcxxabi_package() {
+libcxxabi15_package() {
 	short_desc+=" - low level support for libc++"
 	pkg_install() {
 		vmove "usr/lib/libc++abi.so.*"
 	}
 }
 
-libcxxabi-devel_package() {
+libcxxabi15-devel_package() {
 	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
+	depends="libcxxabi15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/*cxxabi*"
 		vmove "usr/lib/libc++abi.so"
@@ -400,16 +400,16 @@ libcxxabi-devel_package() {
 	}
 }
 
-libcxx_package() {
+libcxx15_package() {
 	short_desc+=" - C++ standard library"
 	pkg_install() {
 		vmove "usr/lib/libc++.so.*"
 	}
 }
 
-libcxx-devel_package() {
+libcxx15-devel_package() {
 	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
+	depends="libcxx15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/c++
 		vmove "usr/lib/libc++.so"
@@ -419,19 +419,16 @@ libcxx-devel_package() {
 	}
 }
 
-libomp_package() {
+libomp15_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() {
+libomp15-devel_package() {
 	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
+	depends="libomp15>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/omp*.h"
 		vmove "usr/lib/clang/${version}/include/omp*.h"
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..017771fb7626b
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,823 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="llvm-tools>=${version}_${revision} libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang clang-devel libclang17 libclang-cpp17 clang-analyzer "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb lldb-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld lld-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir mlir-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang flang-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm-doc llvm-tools llvm-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+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/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+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"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+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"
+	}
+}
+
+mlir_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm-tools_package() {
+	pycompile_dirs="usr/share/opt-viewer"
+	short_desc+=" - development tools"
+	pkg_install() {
+		vmove usr/share/opt-viewer
+
+		vmove usr/lib/LLVMgold.so
+
+		vmove usr/bin/FileCheck
+		vmove usr/bin/UnicodeNameMappingGenerator
+		vmove usr/bin/bugpoint
+		vmove usr/bin/count
+		vmove usr/bin/dsymutil
+		vmove usr/bin/intercept-build
+		vmove usr/bin/llc
+		vmove usr/bin/lli
+		vmove usr/bin/lli-child-target
+		vmove usr/bin/not
+		vmove usr/bin/obj2yaml
+		vmove usr/bin/opt
+		vmove usr/bin/sancov
+		vmove usr/bin/sanstats
+		vmove usr/bin/split-file
+		vmove usr/bin/verify-uselistorder
+		vmove usr/bin/yaml-bench
+		vmove usr/bin/yaml2obj
+		vmove usr/bin/llvm-PerfectShuffle
+		vmove usr/bin/llvm-ar
+		vmove usr/bin/llvm-as
+		vmove usr/bin/llvm-bcanalyzer
+		vmove usr/bin/llvm-c-test
+		vmove usr/bin/llvm-cat
+		vmove usr/bin/llvm-cfi-verify
+		vmove usr/bin/llvm-config
+		vmove usr/bin/llvm-cov
+		vmove usr/bin/llvm-cvtres
+		vmove usr/bin/llvm-cxxdump
+		vmove usr/bin/llvm-cxxfilt
+		vmove usr/bin/llvm-cxxmap
+		vmove usr/bin/llvm-debuginfo-analyzer
+		vmove usr/bin/llvm-debuginfod
+		vmove usr/bin/llvm-debuginfod-find
+		vmove usr/bin/llvm-diff
+		vmove usr/bin/llvm-dis
+		vmove usr/bin/llvm-dwarfdump
+		vmove usr/bin/llvm-dwarfutil
+		vmove usr/bin/llvm-dwp
+		vmove usr/bin/llvm-exegesis
+		vmove usr/bin/llvm-extract
+		vmove usr/bin/llvm-gsymutil
+		vmove usr/bin/llvm-ifs
+		vmove usr/bin/llvm-jitlink
+		vmove usr/bin/llvm-jitlink-executor
+		vmove usr/bin/llvm-libtool-darwin
+		vmove usr/bin/llvm-link
+		vmove usr/bin/llvm-lipo
+		vmove usr/bin/llvm-lto
+		vmove usr/bin/llvm-lto2
+		vmove usr/bin/llvm-mc
+		vmove usr/bin/llvm-mca
+		vmove usr/bin/llvm-ml
+		vmove usr/bin/llvm-modextract
+		vmove usr/bin/llvm-mt
+		vmove usr/bin/llvm-nm
+		vmove usr/bin/llvm-objcopy
+		vmove usr/bin/llvm-objdump
+		vmove usr/bin/llvm-opt-report
+		vmove usr/bin/llvm-pdbutil
+		vmove usr/bin/llvm-profdata
+		vmove usr/bin/llvm-profgen
+		vmove usr/bin/llvm-rc
+		vmove usr/bin/llvm-readobj
+		vmove usr/bin/llvm-reduce
+		vmove usr/bin/llvm-remark-size-diff
+		vmove usr/bin/llvm-remarkutil
+		vmove usr/bin/llvm-rtdyld
+		vmove usr/bin/llvm-sim
+		vmove usr/bin/llvm-size
+		vmove usr/bin/llvm-split
+		vmove usr/bin/llvm-stress
+		vmove usr/bin/llvm-strings
+		vmove usr/bin/llvm-symbolizer
+		vmove usr/bin/llvm-tapi-diff
+		vmove usr/bin/llvm-tblgen
+		vmove usr/bin/llvm-tli-checker
+		vmove usr/bin/llvm-undname
+		vmove usr/bin/llvm-xray
+		vmove usr/bin/llvm-addr2line
+		vmove usr/bin/llvm-bitcode-strip
+		vmove usr/bin/llvm-dlltool
+		vmove usr/bin/llvm-install-name-tool
+		vmove usr/bin/llvm-lib
+		vmove usr/bin/llvm-otool
+		vmove usr/bin/llvm-ranlib
+		vmove usr/bin/llvm-readelf
+		vmove usr/bin/llvm-strip
+		vmove usr/bin/llvm-windres
+		vmove usr/share/man/man1/FileCheck.1
+		vmove usr/share/man/man1/bugpoint.1
+		vmove usr/share/man/man1/clang-tblgen.1
+		vmove usr/share/man/man1/dsymutil.1
+		vmove usr/share/man/man1/lit.1
+		vmove usr/share/man/man1/llc.1
+		vmove usr/share/man/man1/lldb-tblgen.1
+		vmove usr/share/man/man1/lli.1
+		vmove usr/share/man/man1/opt.1
+		vmove usr/share/man/man1/tblgen.1
+		vmove usr/share/man/man1/llvm-addr2line.1
+		vmove usr/share/man/man1/llvm-ar.1
+		vmove usr/share/man/man1/llvm-as.1
+		vmove usr/share/man/man1/llvm-bcanalyzer.1
+		vmove usr/share/man/man1/llvm-config.1
+		vmove usr/share/man/man1/llvm-cov.1
+		vmove usr/share/man/man1/llvm-cxxfilt.1
+		vmove usr/share/man/man1/llvm-cxxmap.1
+		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
+		vmove usr/share/man/man1/llvm-diff.1
+		vmove usr/share/man/man1/llvm-dis.1
+		vmove usr/share/man/man1/llvm-dwarfdump.1
+		vmove usr/share/man/man1/llvm-dwarfutil.1
+		vmove usr/share/man/man1/llvm-exegesis.1
+		vmove usr/share/man/man1/llvm-extract.1
+		vmove usr/share/man/man1/llvm-ifs.1
+		vmove usr/share/man/man1/llvm-install-name-tool.1
+		vmove usr/share/man/man1/llvm-lib.1
+		vmove usr/share/man/man1/llvm-libtool-darwin.1
+		vmove usr/share/man/man1/llvm-link.1
+		vmove usr/share/man/man1/llvm-lipo.1
+		vmove usr/share/man/man1/llvm-locstats.1
+		vmove usr/share/man/man1/llvm-mc.1
+		vmove usr/share/man/man1/llvm-mca.1
+		vmove usr/share/man/man1/llvm-nm.1
+		vmove usr/share/man/man1/llvm-objcopy.1
+		vmove usr/share/man/man1/llvm-objdump.1
+		vmove usr/share/man/man1/llvm-opt-report.1
+		vmove usr/share/man/man1/llvm-otool.1
+		vmove usr/share/man/man1/llvm-pdbutil.1
+		vmove usr/share/man/man1/llvm-profdata.1
+		vmove usr/share/man/man1/llvm-profgen.1
+		vmove usr/share/man/man1/llvm-ranlib.1
+		vmove usr/share/man/man1/llvm-readelf.1
+		vmove usr/share/man/man1/llvm-readobj.1
+		vmove usr/share/man/man1/llvm-reduce.1
+		vmove usr/share/man/man1/llvm-remark-size-diff.1
+		vmove usr/share/man/man1/llvm-remarkutil.1
+		vmove usr/share/man/man1/llvm-size.1
+		vmove usr/share/man/man1/llvm-stress.1
+		vmove usr/share/man/man1/llvm-strings.1
+		vmove usr/share/man/man1/llvm-strip.1
+		vmove usr/share/man/man1/llvm-symbolizer.1
+		vmove usr/share/man/man1/llvm-tblgen.1
+		vmove usr/share/man/man1/llvm-tli-checker.1
+	}
+}
+
+llvm-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir b/srcpkgs/mlir
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir-devel b/srcpkgs/mlir-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 24040b23cced6d0cb64cbdb6361f5a92852bc3f9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 17:09:06 -0500
Subject: [PATCH 02/31] llvm17

---
 srcpkgs/llvm-tools                   |   1 -
 srcpkgs/{llvm-devel => llvm17-devel} |   0
 srcpkgs/llvm17/template              | 163 +--------------------------
 3 files changed, 4 insertions(+), 160 deletions(-)
 delete mode 120000 srcpkgs/llvm-tools
 rename srcpkgs/{llvm-devel => llvm17-devel} (100%)

diff --git a/srcpkgs/llvm-tools b/srcpkgs/llvm-tools
deleted file mode 120000
index 96970d5c02c13..0000000000000
--- a/srcpkgs/llvm-tools
+++ /dev/null
@@ -1 +0,0 @@
-llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-devel b/srcpkgs/llvm17-devel
similarity index 100%
rename from srcpkgs/llvm-devel
rename to srcpkgs/llvm17-devel
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index 017771fb7626b..fbb78b5b4cb39 100644
--- a/srcpkgs/llvm17/template
+++ b/srcpkgs/llvm17/template
@@ -35,7 +35,7 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
  python3-recommonmark python3-sphinx-automodapi git python3-sphinx-markdown-tables python3-yaml pkg-config "
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel "
-depends="llvm-tools>=${version}_${revision} libllvm17>=${version}_${revision}"
+depends="libllvm17>=${version}_${revision}"
 short_desc="LLVM Compiler Infrastructure Project - Version 17"
 maintainer="Daniel Martinez <danielmartinez@cock.li>"
 license="Apache-2.0"
@@ -44,6 +44,7 @@ distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${vers
 checksum=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
 lib32disabled=yes
 python_version=3
+pycompile_dirs="usr/share/scan-view"
 
 build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
 build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
@@ -99,7 +100,7 @@ if [ "$build_option_openmp" ]; then
 	_enabled_projects+="openmp;"
 	subpackages+=" libomp libomp-devel "
 fi
-subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm-doc llvm-tools llvm-devel "
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm-doc llvm17-devel "
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -356,7 +357,6 @@ libclang-cpp17_package() {
 }
 
 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/"
@@ -643,162 +643,7 @@ llvm-doc_package() {
 	}
 }
 
-llvm-tools_package() {
-	pycompile_dirs="usr/share/opt-viewer"
-	short_desc+=" - development tools"
-	pkg_install() {
-		vmove usr/share/opt-viewer
-
-		vmove usr/lib/LLVMgold.so
-
-		vmove usr/bin/FileCheck
-		vmove usr/bin/UnicodeNameMappingGenerator
-		vmove usr/bin/bugpoint
-		vmove usr/bin/count
-		vmove usr/bin/dsymutil
-		vmove usr/bin/intercept-build
-		vmove usr/bin/llc
-		vmove usr/bin/lli
-		vmove usr/bin/lli-child-target
-		vmove usr/bin/not
-		vmove usr/bin/obj2yaml
-		vmove usr/bin/opt
-		vmove usr/bin/sancov
-		vmove usr/bin/sanstats
-		vmove usr/bin/split-file
-		vmove usr/bin/verify-uselistorder
-		vmove usr/bin/yaml-bench
-		vmove usr/bin/yaml2obj
-		vmove usr/bin/llvm-PerfectShuffle
-		vmove usr/bin/llvm-ar
-		vmove usr/bin/llvm-as
-		vmove usr/bin/llvm-bcanalyzer
-		vmove usr/bin/llvm-c-test
-		vmove usr/bin/llvm-cat
-		vmove usr/bin/llvm-cfi-verify
-		vmove usr/bin/llvm-config
-		vmove usr/bin/llvm-cov
-		vmove usr/bin/llvm-cvtres
-		vmove usr/bin/llvm-cxxdump
-		vmove usr/bin/llvm-cxxfilt
-		vmove usr/bin/llvm-cxxmap
-		vmove usr/bin/llvm-debuginfo-analyzer
-		vmove usr/bin/llvm-debuginfod
-		vmove usr/bin/llvm-debuginfod-find
-		vmove usr/bin/llvm-diff
-		vmove usr/bin/llvm-dis
-		vmove usr/bin/llvm-dwarfdump
-		vmove usr/bin/llvm-dwarfutil
-		vmove usr/bin/llvm-dwp
-		vmove usr/bin/llvm-exegesis
-		vmove usr/bin/llvm-extract
-		vmove usr/bin/llvm-gsymutil
-		vmove usr/bin/llvm-ifs
-		vmove usr/bin/llvm-jitlink
-		vmove usr/bin/llvm-jitlink-executor
-		vmove usr/bin/llvm-libtool-darwin
-		vmove usr/bin/llvm-link
-		vmove usr/bin/llvm-lipo
-		vmove usr/bin/llvm-lto
-		vmove usr/bin/llvm-lto2
-		vmove usr/bin/llvm-mc
-		vmove usr/bin/llvm-mca
-		vmove usr/bin/llvm-ml
-		vmove usr/bin/llvm-modextract
-		vmove usr/bin/llvm-mt
-		vmove usr/bin/llvm-nm
-		vmove usr/bin/llvm-objcopy
-		vmove usr/bin/llvm-objdump
-		vmove usr/bin/llvm-opt-report
-		vmove usr/bin/llvm-pdbutil
-		vmove usr/bin/llvm-profdata
-		vmove usr/bin/llvm-profgen
-		vmove usr/bin/llvm-rc
-		vmove usr/bin/llvm-readobj
-		vmove usr/bin/llvm-reduce
-		vmove usr/bin/llvm-remark-size-diff
-		vmove usr/bin/llvm-remarkutil
-		vmove usr/bin/llvm-rtdyld
-		vmove usr/bin/llvm-sim
-		vmove usr/bin/llvm-size
-		vmove usr/bin/llvm-split
-		vmove usr/bin/llvm-stress
-		vmove usr/bin/llvm-strings
-		vmove usr/bin/llvm-symbolizer
-		vmove usr/bin/llvm-tapi-diff
-		vmove usr/bin/llvm-tblgen
-		vmove usr/bin/llvm-tli-checker
-		vmove usr/bin/llvm-undname
-		vmove usr/bin/llvm-xray
-		vmove usr/bin/llvm-addr2line
-		vmove usr/bin/llvm-bitcode-strip
-		vmove usr/bin/llvm-dlltool
-		vmove usr/bin/llvm-install-name-tool
-		vmove usr/bin/llvm-lib
-		vmove usr/bin/llvm-otool
-		vmove usr/bin/llvm-ranlib
-		vmove usr/bin/llvm-readelf
-		vmove usr/bin/llvm-strip
-		vmove usr/bin/llvm-windres
-		vmove usr/share/man/man1/FileCheck.1
-		vmove usr/share/man/man1/bugpoint.1
-		vmove usr/share/man/man1/clang-tblgen.1
-		vmove usr/share/man/man1/dsymutil.1
-		vmove usr/share/man/man1/lit.1
-		vmove usr/share/man/man1/llc.1
-		vmove usr/share/man/man1/lldb-tblgen.1
-		vmove usr/share/man/man1/lli.1
-		vmove usr/share/man/man1/opt.1
-		vmove usr/share/man/man1/tblgen.1
-		vmove usr/share/man/man1/llvm-addr2line.1
-		vmove usr/share/man/man1/llvm-ar.1
-		vmove usr/share/man/man1/llvm-as.1
-		vmove usr/share/man/man1/llvm-bcanalyzer.1
-		vmove usr/share/man/man1/llvm-config.1
-		vmove usr/share/man/man1/llvm-cov.1
-		vmove usr/share/man/man1/llvm-cxxfilt.1
-		vmove usr/share/man/man1/llvm-cxxmap.1
-		vmove usr/share/man/man1/llvm-debuginfo-analyzer.1
-		vmove usr/share/man/man1/llvm-diff.1
-		vmove usr/share/man/man1/llvm-dis.1
-		vmove usr/share/man/man1/llvm-dwarfdump.1
-		vmove usr/share/man/man1/llvm-dwarfutil.1
-		vmove usr/share/man/man1/llvm-exegesis.1
-		vmove usr/share/man/man1/llvm-extract.1
-		vmove usr/share/man/man1/llvm-ifs.1
-		vmove usr/share/man/man1/llvm-install-name-tool.1
-		vmove usr/share/man/man1/llvm-lib.1
-		vmove usr/share/man/man1/llvm-libtool-darwin.1
-		vmove usr/share/man/man1/llvm-link.1
-		vmove usr/share/man/man1/llvm-lipo.1
-		vmove usr/share/man/man1/llvm-locstats.1
-		vmove usr/share/man/man1/llvm-mc.1
-		vmove usr/share/man/man1/llvm-mca.1
-		vmove usr/share/man/man1/llvm-nm.1
-		vmove usr/share/man/man1/llvm-objcopy.1
-		vmove usr/share/man/man1/llvm-objdump.1
-		vmove usr/share/man/man1/llvm-opt-report.1
-		vmove usr/share/man/man1/llvm-otool.1
-		vmove usr/share/man/man1/llvm-pdbutil.1
-		vmove usr/share/man/man1/llvm-profdata.1
-		vmove usr/share/man/man1/llvm-profgen.1
-		vmove usr/share/man/man1/llvm-ranlib.1
-		vmove usr/share/man/man1/llvm-readelf.1
-		vmove usr/share/man/man1/llvm-readobj.1
-		vmove usr/share/man/man1/llvm-reduce.1
-		vmove usr/share/man/man1/llvm-remark-size-diff.1
-		vmove usr/share/man/man1/llvm-remarkutil.1
-		vmove usr/share/man/man1/llvm-size.1
-		vmove usr/share/man/man1/llvm-stress.1
-		vmove usr/share/man/man1/llvm-strings.1
-		vmove usr/share/man/man1/llvm-strip.1
-		vmove usr/share/man/man1/llvm-symbolizer.1
-		vmove usr/share/man/man1/llvm-tblgen.1
-		vmove usr/share/man/man1/llvm-tli-checker.1
-	}
-}
-
-llvm-devel_package() {
+llvm17-devel_package() {
 	short_desc+=" - development files"
 	depends="llvm17>=${version}_${revision}"
 	if [ "$build_option_openmp" ]; then

From d4246333220b972f2f59025613f6c50ec204bc7b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 03/31] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From ee9f544c4a665ce9f5c345fe16aeb7eefffdf8d2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 04/31] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 9e8a4f916b2f6634724b7149bff778d0a8c8fab4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 05/31] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 65174a04a1b087eb4e8ae73de6f446998098b97f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 06/31] SPIRV-LLVM-Translator: update to 17.0.0.

---
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 7f3a5009c44e0e6ad8427373d3ebbd85d7cb8c99 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 07/31] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From bc6b932b400477714cb0fa3f451d51be593e5bfe Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 08/31] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..b7c0394a7f366 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 8b92d369030e50753c807d34921b665f748e339f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 09/31] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From 1435f6aa5d07881601179b922b504ca7b0a2072d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 10/31] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From de954d76edcf6155ab4c6f4e38a5e8399a45793c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 11/31] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 2f21dd0ab430194a8cfeed18268f9e9578a1fa85 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 12/31] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 28a24464423d59382800e231010f8cd5671b5b79 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 13/31] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From af5d9aae520abcb1f3974038290fed2bb00ea8b4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 14/31] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 389991b3c262a..fcea763fcb975 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2613,22 +2613,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From e9c081a69eef246eebe57a0d26637470dfe9636e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 15/31] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 73b83be66f81ea837d94f7e763c3ab67c33f2d79 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 16/31] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 671692cc220c9e21e0dcb332b094e3b84674ff3f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 17/31] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index fcea763fcb975..9d99867914fe3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2148,10 +2148,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From e2ff50e1e4074e9fcfa1b6fa847b32b42bfb9bfc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 18/31] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From eb685506a7d4c5fc8d406cee03515820ee19ee3b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 19/31] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 0aa15b7c8809df8c683598118b5739f70d7d62bc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 20/31] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..80b156e616de8 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From c6ba1bcf3a6357e0586067c86bed1edd62f15caa Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 21/31] zig: Build against old llvm15 packages

---
 srcpkgs/llvm15/template | 2 +-
 srcpkgs/zig/template    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index bdd9b40ef82e7..1253f17cf1c4f 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -75,7 +75,7 @@ if [ "$_libomp_enable" = "yes" ]; then
 	_enabled_projects+=";openmp"
 	subpackages+=" libomp15 libomp15-devel"
 	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
+	depends+=" libomp15>=${version}_${revision}"
 	if [ "$CROSS_BUILD" ]; then
 		# Seems to require a full host llvm/clang build
 		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 1ae635b8a4186ddead2cbbedbb1067efe0172cbf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 22/31] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..82b329424fa37 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From b5032895d0cf908d5a2928e6da2c8085e6285bb8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 23/31] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..5dd4b6e674647 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 772c762a173d94a2ac5ad1728a8d6ae1280e3b0d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 24/31] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From 53a551bddf76bdb14b08d7b3a275ed642e55f094 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 25/31] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 4eee50b3cf1b5051cfb7ab58f01ea7a54886a4b8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 26/31] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From 529035d60b061dcd7913cf948e8da3dc1e59e68b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 27/31] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..fd9dcd1fa61c7 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From c056f11fe0f8b1d01f83a3f01db88f2ba72ce4d5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 28/31] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From 8b09e2dc43870913834d8959a73c3b7a005d4755 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 29/31] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From 5be172c7946da6aa6f1e1a074cd8f8882ebb9b9f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 30/31] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

From eaad92eae23094cb213ac552e5d056c1824deac3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 15:43:09 -0500
Subject: [PATCH 31/31] thunderbird: Broken with python3.12

---
 srcpkgs/thunderbird/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template
index 2400ca23ea8a8..a745f64947c9e 100644
--- a/srcpkgs/thunderbird/template
+++ b/srcpkgs/thunderbird/template
@@ -29,6 +29,8 @@ depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme libotr"
 build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 
+broken="python3.12: 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'"
+
 case $XBPS_TARGET_MACHINE in
 	armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
 	ppc64*) ;;

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (103 preceding siblings ...)
  2024-02-01 23:03 ` Calandracas606
@ 2024-02-02  4:14 ` Calandracas606
  2024-02-02  4:15 ` Calandracas606
                   ` (13 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-02  4:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 121344 bytes --]

From d01be69fb00961c8140da0ff6a5db45daeb5823d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/30] New package: llvm17

---
 common/shlibs                                 |  18 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/{clang-analyzer => clang-analyzer15}  |   0
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/{lld-devel => clang-tools-extra15}    |   0
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/{lldb-devel => clang15}               |   0
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |  42 +-
 srcpkgs/llvm15/template                       | 194 +----
 srcpkgs/llvm17-devel                          |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/llvm                           |   1 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 srcpkgs/removed-packages/template             |   5 +-
 67 files changed, 1275 insertions(+), 196 deletions(-)
 rename srcpkgs/{clang-analyzer => clang-analyzer15} (100%)
 create mode 120000 srcpkgs/clang-analyzer17
 rename srcpkgs/{lld-devel => clang-tools-extra15} (100%)
 create mode 120000 srcpkgs/clang-tools-extra17
 rename srcpkgs/{lldb-devel => clang15} (100%)
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 120000 srcpkgs/llvm17/llvm
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..360a047553f5f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,19 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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
-libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libLLVM-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm17-17.0.6_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer15
similarity index 100%
rename from srcpkgs/clang-analyzer
rename to srcpkgs/clang-analyzer15
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/clang-tools-extra15
similarity index 100%
rename from srcpkgs/lld-devel
rename to srcpkgs/clang-tools-extra15
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/clang15
similarity index 100%
rename from srcpkgs/lldb-devel
rename to srcpkgs/clang15
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..b8967217e0f29 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..6a939bb08fef1 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/llvm b/srcpkgs/llvm17/llvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/llvm17/llvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..0818c12dfaec1
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.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
+ -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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+pycompile_dirs="usr/share/scan-view"
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a862..2fca099c3ad31 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From f3c189ccf78d95f0017a5a12ed9f6171c11a75b0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/30] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From b6a54aecd7d05a5601a700dba245b44831fb5c88 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/30] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From c1d954500b019784d178a77c87334333e8c96db8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/30] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From c760b6654aeb14b468effe2a4cf3568f914083cf Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/30] SPIRV-LLVM-Translator: update to 17.0.0.

---
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 335e0a2564f035ff19dabd8771e8a7761473616b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/30] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 0e6baac02410875d87633de2792fb4440141c49b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/30] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..78917ebf8066e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 0721071f4491dfa57033597d2f40ae6487c7b12f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/30] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From b6a9e96dce35dbf129923ec7302571a328206566 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/30] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 77f6f3b50d6688f5a13ddaff44c2e8ca652b99d9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 10/30] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From beddf4a49344bdfe028d2c1bb9ea94b92bb314a2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 11/30] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From b86b772dcffcf3b1d0551a77f8688b0f06e9ba7a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 12/30] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From 2d85a2585b7ca08a2c36f349402034c0603236bd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 13/30] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 360a047553f5f..dea4f0dc98162 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From ed9bffcec42fbf4851b580d3e615dd96f7bf2355 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 14/30] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From fba822e4540ab624cb6c4425d05ca7e72ac784b9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 15/30] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From e2a21f6ba1a47ba6b92bb97030cbee20da13fa4d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 16/30] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index dea4f0dc98162..0344301de99ec 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From a2a2ae217a13d92a608baaadd1372cd8023a53ec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 17/30] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 7b084160cd86ff159aefa672e38b33d175712154 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 18/30] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 097b9bfeb982e27c46ea08c8c0ef6a866589bfd4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 19/30] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..d0a38c63d9eef 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 0e691210d54f9226065ac340518e8d69263211c6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 20/30] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 11f711180a1a7d58d60be563bb13ccffec903c9b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 21/30] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..82b329424fa37 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 704f5d5b1a7bbeb8ae7f9e2ce540b99e932ff896 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 22/30] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 srcpkgs/llvm17-doc      | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/llvm17-doc

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..fa0807f9ace69 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 1f542520280c95884175898541ff61fc12851fd3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 23/30] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From 01ab5a2a3a11bd783bb5e712c126fb438ac6089e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 24/30] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From dda8e9b628f08ca1fd68ac5127d6a3c5348c6c12 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 25/30] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From ea69e0cf21e2ae78a27c7e4af1017e152ca24eca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 26/30] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..fd9dcd1fa61c7 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From 136f2670e7f5a71372c77d841a75c3e52d31ee42 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 27/30] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From baa2932225e0bf1f3a518da4f80b10e3aec76010 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 28/30] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From e8cbc08154ca8f3519f217e88e1dbc34756b8f3c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 29/30] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

From 4a38cd434b24e297c5242df5004f22eadc9472d9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 15:43:09 -0500
Subject: [PATCH 30/30] thunderbird: Broken with python3.12

---
 srcpkgs/thunderbird/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template
index 2400ca23ea8a8..a745f64947c9e 100644
--- a/srcpkgs/thunderbird/template
+++ b/srcpkgs/thunderbird/template
@@ -29,6 +29,8 @@ depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme libotr"
 build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 
+broken="python3.12: 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'"
+
 case $XBPS_TARGET_MACHINE in
 	armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
 	ppc64*) ;;

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (104 preceding siblings ...)
  2024-02-02  4:14 ` Calandracas606
@ 2024-02-02  4:15 ` Calandracas606
  2024-02-02  5:00 ` [PR PATCH] [Updated] " Calandracas606
                   ` (12 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-02  4:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1922785085

Comment:
Made changes based on discussions with @Duncaen on IRC

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (105 preceding siblings ...)
  2024-02-02  4:15 ` Calandracas606
@ 2024-02-02  5:00 ` Calandracas606
  2024-02-03 19:42 ` Calandracas606
                   ` (11 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-02  5:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 121344 bytes --]

From 48cee88161cddf2f52f7faa958d6af25d60a3041 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/30] New package: llvm17

---
 common/shlibs                                 |  18 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/{clang-analyzer => clang-analyzer15}  |   0
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/{lld-devel => clang-tools-extra15}    |   0
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/{lldb-devel => clang15}               |   0
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |  42 +-
 srcpkgs/llvm15/template                       | 194 +----
 srcpkgs/llvm17-devel                          |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/llvm                           |   1 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 srcpkgs/removed-packages/template             |   5 +-
 67 files changed, 1275 insertions(+), 196 deletions(-)
 rename srcpkgs/{clang-analyzer => clang-analyzer15} (100%)
 create mode 120000 srcpkgs/clang-analyzer17
 rename srcpkgs/{lld-devel => clang-tools-extra15} (100%)
 create mode 120000 srcpkgs/clang-tools-extra17
 rename srcpkgs/{lldb-devel => clang15} (100%)
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 120000 srcpkgs/llvm17/llvm
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..360a047553f5f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,19 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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
-libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libLLVM-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm17-17.0.6_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer15
similarity index 100%
rename from srcpkgs/clang-analyzer
rename to srcpkgs/clang-analyzer15
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/clang-tools-extra15
similarity index 100%
rename from srcpkgs/lld-devel
rename to srcpkgs/clang-tools-extra15
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/clang15
similarity index 100%
rename from srcpkgs/lldb-devel
rename to srcpkgs/clang15
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..b8967217e0f29 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..6a939bb08fef1 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/llvm b/srcpkgs/llvm17/llvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/llvm17/llvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..7bc22ec50272e
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+pycompile_dirs="usr/share/scan-view"
+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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a862..2fca099c3ad31 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From f5a00e48eedbbacdb563a16fc9707b243b0d9550 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/30] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 69b71ad3b47c4ac15a5f90d892bec6761a5701f0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/30] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 510fef88b7aeec32fc8e80ba2fc8024f62e93ae9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/30] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 82fc756ffc0b6bd549cae9b542d627f6c1e93662 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/30] SPIRV-LLVM-Translator: update to 17.0.0.

---
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 7c88cd6d560200bdcccb0f9775443640ef3e0074 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/30] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 013efe1b138ba12da56b376e3f6d53dc153c94f8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/30] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..78917ebf8066e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From cacefd4c5893180e3473df36b65abffdb90131cd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/30] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From da8c9f81279b1702ed7b39a768764a7f84b13aec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/30] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 2cde42b212cd258bacef0a35313cc0532330a6ba Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 10/30] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 0f853290f163479e01e8b0350a6c4455f8329421 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 11/30] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 7e590088a4ae102c9a5329286629ae2385b49cb0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 12/30] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From f831f22bd8d95fa27615806728fef2b05ca87f24 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 13/30] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 360a047553f5f..dea4f0dc98162 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From e627f23eb652765d358f837c45b67784ba4f2b15 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 14/30] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 683c90469ded1fbb7eefe4aee9bb0ed60deaec0a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 15/30] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From bc2c93230f0b41d43b3895682ddd87de2c2b8503 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 16/30] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index dea4f0dc98162..0344301de99ec 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From ea56d790777cad25c7e8df4faa81cd49f1e86f49 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 17/30] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 7bc8d43eea4fd8dc17a70a36103bcf3afdd2351d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 18/30] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 38ef8e9806ea31e63fa56faf393d6871ee372ee0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 19/30] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..d0a38c63d9eef 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 625d202d149845f4d785235d14f9a8029c5b5314 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 20/30] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 27df7201fda2b42008dfd5a4698e56b89a29e4cd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 21/30] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..82b329424fa37 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 6298dce576337fefcaf6d70358f4dfd857f3b91d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 22/30] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 srcpkgs/llvm17-doc      | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/llvm17-doc

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..fa0807f9ace69 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From cfaa9f95fd4b4be9537168f3d1165158146189b3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 23/30] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From e5207c64329862a5be24d8d896138abf46866779 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 24/30] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From b507d1e6ef52ac5509908fbea37914c35495cb63 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 25/30] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From 13f0beb6a6fc778978ed6ebb663ca5b8602dd220 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 26/30] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..fd9dcd1fa61c7 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From e7e5ce080c13d0da67a8d581dc4369024b089605 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 27/30] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From eebfe44dbca07277cece18719eec83d60c91ef35 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 28/30] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From cb319619b9b6440151a2f41751154c37b6dd2df9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 29/30] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

From b9b230d06d9b140fc32eaf2e30fb353b60b685c8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 15:43:09 -0500
Subject: [PATCH 30/30] thunderbird: Broken with python3.12

---
 srcpkgs/thunderbird/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template
index 2400ca23ea8a8..a745f64947c9e 100644
--- a/srcpkgs/thunderbird/template
+++ b/srcpkgs/thunderbird/template
@@ -29,6 +29,8 @@ depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme libotr"
 build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 
+broken="python3.12: 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'"
+
 case $XBPS_TARGET_MACHINE in
 	armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
 	ppc64*) ;;

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (106 preceding siblings ...)
  2024-02-02  5:00 ` [PR PATCH] [Updated] " Calandracas606
@ 2024-02-03 19:42 ` Calandracas606
  2024-02-03 19:45 ` Calandracas606
                   ` (10 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-03 19:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 122037 bytes --]

From 48cee88161cddf2f52f7faa958d6af25d60a3041 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/31] New package: llvm17

---
 common/shlibs                                 |  18 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/{clang-analyzer => clang-analyzer15}  |   0
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/{lld-devel => clang-tools-extra15}    |   0
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/{lldb-devel => clang15}               |   0
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |  42 +-
 srcpkgs/llvm15/template                       | 194 +----
 srcpkgs/llvm17-devel                          |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/llvm                           |   1 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 srcpkgs/removed-packages/template             |   5 +-
 67 files changed, 1275 insertions(+), 196 deletions(-)
 rename srcpkgs/{clang-analyzer => clang-analyzer15} (100%)
 create mode 120000 srcpkgs/clang-analyzer17
 rename srcpkgs/{lld-devel => clang-tools-extra15} (100%)
 create mode 120000 srcpkgs/clang-tools-extra17
 rename srcpkgs/{lldb-devel => clang15} (100%)
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 120000 srcpkgs/llvm17/llvm
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c61..360a047553f5fc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,19 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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
-libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libLLVM-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm17-17.0.6_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9cf..0d68131b9b3088 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer15
similarity index 100%
rename from srcpkgs/clang-analyzer
rename to srcpkgs/clang-analyzer15
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9cf..0d68131b9b3088 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/clang-tools-extra15
similarity index 100%
rename from srcpkgs/lld-devel
rename to srcpkgs/clang-tools-extra15
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/clang15
similarity index 100%
rename from srcpkgs/lldb-devel
rename to srcpkgs/clang15
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9cf..0d68131b9b3088 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9cf..0d68131b9b3088 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 00000000000000..ad57a969b9f9cf
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 00000000000000..ad57a969b9f9cf
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9cf..96970d5c02c13a 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9cf..96970d5c02c13a 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 00000000000000..ad57a969b9f9cf
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9cf..96970d5c02c13a 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9cf..96970d5c02c13a 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 00000000000000..ad57a969b9f9cf
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 00000000000000..0d68131b9b3088
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9cf..96970d5c02c13a 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9cf..96970d5c02c13a 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9cf..0d68131b9b3088 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 00000000000000..ad57a969b9f9cf
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 00000000000000..ad57a969b9f9cf
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9cf..0d68131b9b3088 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 00000000000000..ad57a969b9f9cf
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 00000000000000..ad57a969b9f9cf
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9cf..96970d5c02c13a 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9cf..96970d5c02c13a 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd2..b8967217e0f294 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa57..6a939bb08fef1c 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 00000000000000..2fa08c9be69621
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/llvm b/srcpkgs/llvm17/llvm
new file mode 120000
index 00000000000000..0d68131b9b3088
--- /dev/null
+++ b/srcpkgs/llvm17/llvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 00000000000000..ac10d306c4346d
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 00000000000000..e4eaa7783e7a6c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 00000000000000..0ef4c7e75d6b58
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 00000000000000..4ad6412d1e6c63
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 00000000000000..b6d385c1d1814c
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 00000000000000..c9b9286ac37b31
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 00000000000000..700ab134790452
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 00000000000000..fb0ea3da4d057b
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 00000000000000..70292beb2fcdbd
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 00000000000000..3a15f9db8c981e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 00000000000000..9a622cd9254c2e
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 00000000000000..b6efd02a5698f1
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 00000000000000..51d0e4b31b32c3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 00000000000000..d332687b9d9295
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 00000000000000..192b4824b8695c
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 00000000000000..7bc22ec50272ed
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+pycompile_dirs="usr/share/scan-view"
+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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 00000000000000..e95cf26b3586b7
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a8621..2fca099c3ad319 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From f5a00e48eedbbacdb563a16fc9707b243b0d9550 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/31] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c2..d8cb7aaaf8cf33 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 69b71ad3b47c4ac15a5f90d892bec6761a5701f0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/31] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc078..bbd738df63d571 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 510fef88b7aeec32fc8e80ba2fc8024f62e93ae9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/31] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504e..5aba11a4a431ff 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 82fc756ffc0b6bd549cae9b542d627f6c1e93662 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/31] SPIRV-LLVM-Translator: update to 17.0.0.

---
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26f..6f1cf2bd6e4849 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 7c88cd6d560200bdcccb0f9775443640ef3e0074 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/31] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe4..6527729b3980b3 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 013efe1b138ba12da56b376e3f6d53dc153c94f8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/31] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a96..78917ebf8066e0 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From cacefd4c5893180e3473df36b65abffdb90131cd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/31] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372d..3e7bff1265377c 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From da8c9f81279b1702ed7b39a768764a7f84b13aec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/31] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 00000000000000..a5759060c112d3
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 00000000000000..910ab426070d91
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f3..fdab8dda0b89b1 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 2cde42b212cd258bacef0a35313cc0532330a6ba Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 10/31] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0dc..5061969cb4c197 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 0f853290f163479e01e8b0350a6c4455f8329421 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 11/31] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db3..ee12c0ee51d88b 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 7e590088a4ae102c9a5329286629ae2385b49cb0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 12/31] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb46446638003..94c8a7e7cfbcd7 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From f831f22bd8d95fa27615806728fef2b05ca87f24 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 13/31] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 360a047553f5fc..dea4f0dc98162f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151ac..4b8f41f90bb03e 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From e627f23eb652765d358f837c45b67784ba4f2b15 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 14/31] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d788454..4f3bafe2356d0e 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 683c90469ded1fbb7eefe4aee9bb0ed60deaec0a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 15/31] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec06712..e3d86278ffe634 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From bc2c93230f0b41d43b3895682ddd87de2c2b8503 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 16/31] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index dea4f0dc98162f..0344301de99ec4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985b..533d6c70d37589 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

From ea56d790777cad25c7e8df4faa81cd49f1e86f49 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 17/31] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68af..358f58a282a76b 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 7bc8d43eea4fd8dc17a70a36103bcf3afdd2351d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 18/31] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d7674..baa6f8c54f69fd 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 38ef8e9806ea31e63fa56faf393d6871ee372ee0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 19/31] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d8687..d0a38c63d9eefa 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 625d202d149845f4d785235d14f9a8029c5b5314 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 20/31] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d38..52cda7e8e0cee7 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 27df7201fda2b42008dfd5a4698e56b89a29e4cd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 21/31] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad39..82b329424fa37d 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 6298dce576337fefcaf6d70358f4dfd857f3b91d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 22/31] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 srcpkgs/llvm17-doc      | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/llvm17-doc

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca7..fa0807f9ace697 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From cfaa9f95fd4b4be9537168f3d1165158146189b3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 23/31] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412bc..dd7b342439838c 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From e5207c64329862a5be24d8d896138abf46866779 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 24/31] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c8..579d276874ad21 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From b507d1e6ef52ac5509908fbea37914c35495cb63 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 25/31] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41de..9c748a6506debd 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From 13f0beb6a6fc778978ed6ebb663ca5b8602dd220 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 26/31] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa38138221..fd9dcd1fa61c7c 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From e7e5ce080c13d0da67a8d581dc4369024b089605 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 27/31] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d55..1f52ca7b438ec1 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From eebfe44dbca07277cece18719eec83d60c91ef35 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 28/31] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 00000000000000..b2358719a41689
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67ee..dca3779bab40ea 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e887..53534571f71184 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From cb319619b9b6440151a2f41751154c37b6dd2df9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 29/31] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11f..72af581ce9d128 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

From b9b230d06d9b140fc32eaf2e30fb353b60b685c8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 15:43:09 -0500
Subject: [PATCH 30/31] thunderbird: Broken with python3.12

---
 srcpkgs/thunderbird/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template
index 2400ca23ea8a8b..a745f64947c9e4 100644
--- a/srcpkgs/thunderbird/template
+++ b/srcpkgs/thunderbird/template
@@ -29,6 +29,8 @@ depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme libotr"
 build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 
+broken="python3.12: 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'"
+
 case $XBPS_TARGET_MACHINE in
 	armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
 	ppc64*) ;;

From 7ba993d9e2a45ea39d5c145addee253105018bba Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 3 Feb 2024 14:41:24 -0500
Subject: [PATCH 31/31] llvm

---
 srcpkgs/llvm17/llvm | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/llvm17/llvm

diff --git a/srcpkgs/llvm17/llvm b/srcpkgs/llvm17/llvm
deleted file mode 120000
index 0d68131b9b3088..00000000000000
--- a/srcpkgs/llvm17/llvm
+++ /dev/null
@@ -1 +0,0 @@
-llvm
\ No newline at end of file

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (107 preceding siblings ...)
  2024-02-03 19:42 ` Calandracas606
@ 2024-02-03 19:45 ` Calandracas606
  2024-02-05 23:33 ` Calandracas606
                   ` (9 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-03 19:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 121050 bytes --]

From 137b53e8048d6f9a8ad0137f391198fde9701220 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/30] New package: llvm17

---
 common/shlibs                                 |  18 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/{clang-analyzer => clang-analyzer15}  |   0
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/{lld-devel => clang-tools-extra15}    |   0
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/{lldb-devel => clang15}               |   0
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |  42 +-
 srcpkgs/llvm15/template                       | 194 +----
 srcpkgs/llvm17-devel                          |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 srcpkgs/removed-packages/template             |   5 +-
 66 files changed, 1274 insertions(+), 196 deletions(-)
 rename srcpkgs/{clang-analyzer => clang-analyzer15} (100%)
 create mode 120000 srcpkgs/clang-analyzer17
 rename srcpkgs/{lld-devel => clang-tools-extra15} (100%)
 create mode 120000 srcpkgs/clang-tools-extra17
 rename srcpkgs/{lldb-devel => clang15} (100%)
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..360a047553f5f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,19 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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
-libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libLLVM-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm17-17.0.6_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer15
similarity index 100%
rename from srcpkgs/clang-analyzer
rename to srcpkgs/clang-analyzer15
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/clang-tools-extra15
similarity index 100%
rename from srcpkgs/lld-devel
rename to srcpkgs/clang-tools-extra15
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/clang15
similarity index 100%
rename from srcpkgs/lldb-devel
rename to srcpkgs/clang15
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..b8967217e0f29 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..6a939bb08fef1 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..7bc22ec50272e
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+pycompile_dirs="usr/share/scan-view"
+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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a862..2fca099c3ad31 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From e7af69490f05171e0daff05a3b8dd889b4c8788c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/30] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 49453b54e31c2309af9f61b8128c77e61b07c78e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/30] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 219b92abf0cba82c43295a8959df3170d3128912 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/30] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 52fda60db9dc889bfa3ecdae5a2f54d811f9252a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/30] SPIRV-LLVM-Translator: update to 17.0.0.

---
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 3d10a6befabad77b3dd6dfe4b03c0712d04f89f4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/30] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From d38a095e1f2d4223efbc3b253501117591815d8b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/30] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..78917ebf8066e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 2afd97b637bdd2060383d6cd02fc66d179c52fc4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/30] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From a4a4c5e8ef157247ee1c276523d80c5d483d6cd1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/30] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From a4b01ad06d29cebd432035c3fc174b40a4457e26 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 10/30] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 1346a7bb3b157198bbd4147ba964996d7728c770 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 11/30] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 27d274b9c8eba98e884db93f09605879c8a692a1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 12/30] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From a643e0ffefc1940401af17db48bcaad318a882c8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 13/30] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 360a047553f5f..dea4f0dc98162 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 1a7e6184f3c1dea182dce0f6288f25a272dc8d50 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 14/30] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 32c8269d87d04882683d9d089b8b143eb603f803 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 15/30] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From f74dad822f78fe00f402ae492e59da1bbf4466a3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 16/30] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index dea4f0dc98162..0344301de99ec 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From cea50f0d54c6748f474e8b5161015e774880c269 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 17/30] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 1016a7edbf99d222160afca3872e7def122421e5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 18/30] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 951980bb59b379722956db627e0d1f207cd816ec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 19/30] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..d0a38c63d9eef 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From bc1d4ceedfcebfb3e50bd5bc3199279e44140e01 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 20/30] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 998aadd6f2cb620f292a9a5133304b1da5c1bb2a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 21/30] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..82b329424fa37 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 2a9c29f078d7a49d55d199ba2ec5e96d649244b5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 22/30] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 srcpkgs/llvm17-doc      | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/llvm17-doc

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..fa0807f9ace69 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 0799f8a3a6122707e84ee3b26495ac9c59f0ce83 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 23/30] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From 7c1a61ab64fdab9ef70ed217f999456659e8da16 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 24/30] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 349abd8aa95d4849e786be7d6b1ca974d09d9076 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 25/30] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From 2bc026ab1388e49b8fd4a6d0456820f48513823a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 26/30] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..fd9dcd1fa61c7 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From a3b914b3ba260c60fb38df8995c4fbc67b2c3f75 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 27/30] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From 60a83c476a2dafc7162dc4a12db1a2571c2df25d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 28/30] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From f6a69599dede18153e9cfc964e26cdb611005e78 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 29/30] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

From 90368fdefe7185225f0d7519a42e182f63a6a4af Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 15:43:09 -0500
Subject: [PATCH 30/30] thunderbird: Broken with python3.12

---
 srcpkgs/thunderbird/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template
index 2400ca23ea8a8..a745f64947c9e 100644
--- a/srcpkgs/thunderbird/template
+++ b/srcpkgs/thunderbird/template
@@ -29,6 +29,8 @@ depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme libotr"
 build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 
+broken="python3.12: 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'"
+
 case $XBPS_TARGET_MACHINE in
 	armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
 	ppc64*) ;;

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (108 preceding siblings ...)
  2024-02-03 19:45 ` Calandracas606
@ 2024-02-05 23:33 ` Calandracas606
  2024-02-07 15:38 ` Calandracas606
                   ` (8 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-05 23:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 121050 bytes --]

From 63303a4db7f27d5427049c99ec8f78e2a52865a6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/30] New package: llvm17

---
 common/shlibs                                 |  18 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/{clang-analyzer => clang-analyzer15}  |   0
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/{lld-devel => clang-tools-extra15}    |   0
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/{lldb-devel => clang15}               |   0
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |  42 +-
 srcpkgs/llvm15/template                       | 194 +----
 srcpkgs/llvm17-devel                          |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 srcpkgs/removed-packages/template             |   5 +-
 66 files changed, 1274 insertions(+), 196 deletions(-)
 rename srcpkgs/{clang-analyzer => clang-analyzer15} (100%)
 create mode 120000 srcpkgs/clang-analyzer17
 rename srcpkgs/{lld-devel => clang-tools-extra15} (100%)
 create mode 120000 srcpkgs/clang-tools-extra17
 rename srcpkgs/{lldb-devel => clang15} (100%)
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index a897105f16940..70396568ccd6d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,19 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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
-libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libLLVM-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm17-17.0.6_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer15
similarity index 100%
rename from srcpkgs/clang-analyzer
rename to srcpkgs/clang-analyzer15
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/clang-tools-extra15
similarity index 100%
rename from srcpkgs/lld-devel
rename to srcpkgs/clang-tools-extra15
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/clang15
similarity index 100%
rename from srcpkgs/lldb-devel
rename to srcpkgs/clang15
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..b8967217e0f29 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..6a939bb08fef1 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..7bc22ec50272e
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+pycompile_dirs="usr/share/scan-view"
+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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a862..2fca099c3ad31 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From 2be11ace33caa5f1849cca17a0e04006ff25ad9b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/30] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 9fdaa684b872d75989fda26bbd921f3ad471db6d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/30] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 6695463d9d9303bab24c48db7e7d1d9c1a5ba8bc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/30] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 38f9b97421ee8213c8fe6d48ec043e557a5cb393 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/30] SPIRV-LLVM-Translator: update to 17.0.0.

---
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 2893cfc8d87b2b6e28ce851d24fae8fc7636e326 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/30] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 5182d70cadcc2271b9c40630e6df62a481999186 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/30] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..78917ebf8066e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 12189ead0fb63b3d2faf6b3f699bcd22bdce84c8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/30] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From c283054e15580f8eeba313c17020ba0607246451 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/30] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 9421f6b69a35c01371f9f84aa49949813b147bd5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 10/30] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 609fb4cc0d487821a2727f98521c500dc95586b9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 11/30] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 9c6412100df6f66e1492843dde8c7a1053363939 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 12/30] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From 9f08df1c340e142be893aff8e3c0bcd2f7e09c9a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 13/30] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 70396568ccd6d..9d528af709d5b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 2a8c5a4e2d14a6b274a9d605d218ea029a206fab Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 14/30] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From fa02321587532aca0e153c0ffa2b59e6d870e567 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 15/30] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From c8bb9dec543a0473487f43756177f6b71cbd3445 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 16/30] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 9d528af709d5b..e523a67db5fe9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From d25569a3dac949aa927cf03d3563b10917df0e0c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 17/30] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 340934d3bb3a578540bf0ca228893622fe482ae2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 18/30] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 10476b7ed96cb7faf93f341ae34ed7b97d2197ca Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 19/30] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..d0a38c63d9eef 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 396faf4e733f46d1971b0a5d75cc0a9a760e7def Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 20/30] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 0ee48bad1af9d666cdbf4bea737f49a67fe5eab5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 21/30] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..82b329424fa37 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From ccda91ae2ba8a042c613ab3abb2c73bc4d3f4c45 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 22/30] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 srcpkgs/llvm17-doc      | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/llvm17-doc

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..fa0807f9ace69 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From 13061823bd08b6615ed8f4b45a5cdf9cb273e1ab Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 23/30] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From 546265e1315aa01bb41f74743e008d2dc4455dfd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 24/30] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 6c0a0e2fc85e7bca3914877cc0f50066c60fe12c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 25/30] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From 1c67d2e815b8f00b6895bc4e68bb012c026560cd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 26/30] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..fd9dcd1fa61c7 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From 8457fcd195bcc0765db243643c860451dd76fef2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 27/30] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From 32f3a9e5e87918a912d3204738260c0170ecd97d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 28/30] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From 38ab09687f853d5a874ef3e0185c248664858065 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 29/30] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

From 2f1ba0459cc9f6a6db44f43cde406e2979004bea Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 15:43:09 -0500
Subject: [PATCH 30/30] thunderbird: Broken with python3.12

---
 srcpkgs/thunderbird/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template
index 2400ca23ea8a8..a745f64947c9e 100644
--- a/srcpkgs/thunderbird/template
+++ b/srcpkgs/thunderbird/template
@@ -29,6 +29,8 @@ depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme libotr"
 build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland"
 
+broken="python3.12: 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'"
+
 case $XBPS_TARGET_MACHINE in
 	armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
 	ppc64*) ;;

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (109 preceding siblings ...)
  2024-02-05 23:33 ` Calandracas606
@ 2024-02-07 15:38 ` Calandracas606
  2024-02-07 23:54 ` Calandracas606
                   ` (7 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-07 15:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 120116 bytes --]

From 172acf1778f43a91c2e6d80ef79707acc4a78109 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 2 Nov 2023 23:10:07 -0400
Subject: [PATCH 01/29] New package: llvm17

---
 common/shlibs                                 |  18 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/{clang-analyzer => clang-analyzer15}  |   0
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/{lld-devel => clang-tools-extra15}    |   0
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/{lldb-devel => clang15}               |   0
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libclang-cpp15                        |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang15                            |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxx15-devel                        |   1 +
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libcxxabi15-devel                     |   1 +
 srcpkgs/libllvm                               |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld15                                 |   1 +
 srcpkgs/lld15-devel                           |   1 +
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb15                                |   1 +
 srcpkgs/lldb15-devel                          |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt                             |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |  42 +-
 srcpkgs/llvm15/template                       | 194 +----
 srcpkgs/llvm17-devel                          |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 srcpkgs/removed-packages/template             |   5 +-
 66 files changed, 1274 insertions(+), 196 deletions(-)
 rename srcpkgs/{clang-analyzer => clang-analyzer15} (100%)
 create mode 120000 srcpkgs/clang-analyzer17
 rename srcpkgs/{lld-devel => clang-tools-extra15} (100%)
 create mode 120000 srcpkgs/clang-tools-extra17
 rename srcpkgs/{lldb-devel => clang15} (100%)
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx15-devel
 create mode 120000 srcpkgs/libcxxabi15-devel
 create mode 120000 srcpkgs/libllvm
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index 61e838157b2ab..e2e94ee5a86fc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,19 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
+libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
+libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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
-libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libLLVM-15.so libllvm15-15.0.7_4
+libLLVM-17.so libllvm17-17.0.6_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer15
similarity index 100%
rename from srcpkgs/clang-analyzer
rename to srcpkgs/clang-analyzer15
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/clang-tools-extra15
similarity index 100%
rename from srcpkgs/lld-devel
rename to srcpkgs/clang-tools-extra15
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/clang15
similarity index 100%
rename from srcpkgs/lldb-devel
rename to srcpkgs/clang15
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx15-devel b/srcpkgs/libcxx15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxx15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi15-devel b/srcpkgs/libcxxabi15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libcxxabi15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt b/srcpkgs/llvm-bolt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..b8967217e0f29 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..6a939bb08fef1 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..7bc22ec50272e
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+pycompile_dirs="usr/share/scan-view"
+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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a862..2fca099c3ad31 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From a57a78fae43be7e3a945da57932b9aba2287ccfd Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 02/29] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 96818724080fb5d64cedf38f13403ef87e9771d8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 03/29] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From 2fa1c1dc434588db418fd2d342d77d831c903336 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 04/29] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From 4560e9349da47c337d40e1a15e8d7c932c6491ee Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 05/29] SPIRV-LLVM-Translator: update to 17.0.0.

---
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From cda67f08163482b1877e041e382d482c3e19662b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 06/29] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From 66a4f051cd08605c17c5f1c03712a052bc3f68d4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 07/29] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..78917ebf8066e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 4355b263e0f97dcd5a8888e868d20bc308e6df5b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 08/29] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From e1f981024712a2724618e257a9df557d8b8a13a0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 09/29] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 02771524251b37f5b7e84a2ea17bc6fa0ebbf127 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 10/29] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 87977580a3f930a4ef4ab695a722d876f6c902f7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 11/29] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 247ecb12b11165e1acb76dd63682e717849a2887 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 12/29] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From 07d8e9d7bb222f90d11f42c04cf9483f7bd55633 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 13/29] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e2e94ee5a86fc..9940702fbc2e1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From c2f82cd585e6a4499a430eb6f40351a7b85ad578 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 14/29] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From d30a07e5d3c8d65772c9e646febed2b71103a413 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 15/29] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 273968f182183d9041a6dd8cf9ae0f19189b00fb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 16/29] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 9940702fbc2e1..98b830eea0285 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From c8ea65823493b9367c0ef6b67274746995b506fb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 17/29] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From c62ce4ded8e9e58b157f0ead68de0b1acae164b1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 18/29] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 19aaf94d3214e474c8f488c72f62adefb42e4d51 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 19/29] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..d0a38c63d9eef 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From b7d970549ede07a3b73d11672a783140dad84b2a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 20/29] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From bd97f697c82956742f4d19bdfa841ce84bc6b016 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 21/29] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..82b329424fa37 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 01261f6635cdc2dc7f6bd265fce5c5fffbc7bce4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 22/29] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 srcpkgs/llvm17-doc      | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/llvm17-doc

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..fa0807f9ace69 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From aa02f84ae4db9df1ccc5e796df887349a78fafd1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 23/29] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From d5169dac04bd90d617f6105d1869ad14ea88f5c0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 24/29] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 9651bd88a511c21a9ba644a958dcef237a134bd5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 25/29] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From 2db895df1cb302de9669559eae0d2a607e8f4a4b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:22 -0500
Subject: [PATCH 26/29] chromium: Rebuild against llvm17

---
 srcpkgs/chromium/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 5613fa3813822..fd9dcd1fa61c7 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -2,10 +2,10 @@
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
 version=120.0.6099.129
-revision=1
+revision=2
 archs="i686* x86_64* aarch64* armv7l*"
 hostmakedepends="
- $(vopt_if clang "clang lld llvm15")
+ $(vopt_if clang "clang lld llvm")
  bison git gperf hwids ninja nodejs perl pkg-config python3
  libepoxy-devel libevent-devel libglib-devel"
 makedepends="

From a5d072913fa363abb7dd291a73558f646efcec8e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 27/29] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From 7413aa6bfa5356c9c8d71cc7a92851b43397498c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 28/29] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From 2bba099679562a2abfe09a57ee853b4518cbbe05 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 29/29] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (110 preceding siblings ...)
  2024-02-07 15:38 ` Calandracas606
@ 2024-02-07 23:54 ` Calandracas606
  2024-02-08  0:02 ` Calandracas606
                   ` (6 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-07 23:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 123427 bytes --]

From 06bde8378158a4b1b27d69a6e689a85c079e1917 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:36:33 -0500
Subject: [PATCH 01/33] New package: llvm17-17.0.6

---
 common/shlibs                                 |   8 +-
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm17-devel                          |   1 +
 srcpkgs/llvm17-doc                            |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...s-set-a-larger-stack-size-explicitly.patch |  37 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 46 files changed, 1225 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer17
 create mode 120000 srcpkgs/clang-tools-extra17
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 120000 srcpkgs/llvm17-doc
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index 61e838157b2ab..d206f5dd597ec 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,12 +985,16 @@ 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.17 lldb17-17.0.6_1
+libclang.so.17 libclang17-17.0.6_1
+libclang-cpp.so.17 libclang-cpp17-17.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.7_1
+libLLVM-17.so libllvm17-17.0.6_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
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch b/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
new file mode 100644
index 0000000000000..cb17121dea202
--- /dev/null
+++ b/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
@@ -0,0 +1,37 @@
+From 2354350bcc890c13016d67f4c060b32cb1cd693c Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 4 Nov 2023 08:44:01 +0100
+Subject: [PATCH 01/25] llvm: always set a larger stack size explicitly
+
+---
+ llvm/lib/Support/Threading.cpp | 14 --------------
+ 1 file changed, 14 deletions(-)
+
+diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp
+index 7cc7ba44c..b91b8f4bb 100644
+--- a/llvm/lib/Support/Threading.cpp
++++ b/llvm/lib/Support/Threading.cpp
+@@ -77,21 +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;
+-#elif defined(_AIX)
+-  // On AIX, the default pthread stack size limit is ~192k for 64-bit programs.
+-  // This limit is easily reached when doing link-time thinLTO. AIX library
+-  // developers have used 4MB, so we'll do the same.
+-const std::optional<unsigned> llvm::thread::DefaultStackSize = 4 * 1024 * 1024;
+-#else
+-const std::optional<unsigned> llvm::thread::DefaultStackSize;
+-#endif
+-
+ 
+ #endif
+ 
+-- 
+2.42.0
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..7bc22ec50272e
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+pycompile_dirs="usr/share/scan-view"
+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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From de54734b5ed9031d56acfcb8bfc29963243b447e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:38:29 -0500
Subject: [PATCH 02/33] llvm15: update to 15.0.7.

---
 common/shlibs               |   8 +-
 srcpkgs/clang-analyzer15    |   1 +
 srcpkgs/clang-tools-extra15 |   1 +
 srcpkgs/clang15             |   1 +
 srcpkgs/libclang-cpp15      |   1 +
 srcpkgs/libclang15          |   1 +
 srcpkgs/lld15               |   1 +
 srcpkgs/lld15-devel         |   1 +
 srcpkgs/lldb15              |   1 +
 srcpkgs/lldb15-devel        |   1 +
 srcpkgs/llvm15/template     | 194 +++++-------------------------------
 11 files changed, 36 insertions(+), 175 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel

diff --git a/common/shlibs b/common/shlibs
index d206f5dd597ec..c38bbfbbb5eaa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,15 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
 libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
 libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm17-17.0.6_1
 libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-17.0.6_1
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..6a939bb08fef1 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {

From 2924e1bec4ed5edbcfee331b423eb98e5d25b7c2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:38:50 -0500
Subject: [PATCH 03/33] llvm: update to 17.

---
 srcpkgs/clang                     |  2 +-
 srcpkgs/clang-tools-extra         |  2 +-
 srcpkgs/libclang                  |  2 +-
 srcpkgs/libclang-cpp              |  2 +-
 srcpkgs/libllvm                   |  1 +
 srcpkgs/lld                       |  2 +-
 srcpkgs/lldb                      |  2 +-
 srcpkgs/llvm/template             | 42 ++++++++++++++++++++++++++++---
 srcpkgs/removed-packages/template |  5 +++-
 9 files changed, 50 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/libllvm

diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..b8967217e0f29 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a862..2fca099c3ad31 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From 79248a0d1603e9e40e0cf1f7b2b5227caf5a21ac Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:42:35 -0500
Subject: [PATCH 04/33] clang-analyzer: remove unversioned package

---
 srcpkgs/clang-analyzer | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/clang-analyzer

diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/clang-analyzer
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 1abeefae5171def8dbf57ba2724c8aafd95b8bc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:42:59 -0500
Subject: [PATCH 05/33] lld-devel: remove unversioned package

---
 srcpkgs/lld-devel | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/lld-devel

diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/lld-devel
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 8e57c4a9ecfd8d42be01581d8a0a22337650c80f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:43:17 -0500
Subject: [PATCH 06/33] lldb-devel: remove unversioned package

---
 srcpkgs/lldb-devel | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/lldb-devel

diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/lldb-devel
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 716e91a9354deddd84eb4a59ba78b4930038a9c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 07/33] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From f7ffb9aefa4b47dbac5fc07bcbb16265aaa71ec4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 08/33] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From a903ce2d4b9ad24685a95c997479a16badfd9c2b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 09/33] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From f9e349682f40d6da8013acb852b40c49bbd07702 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 10/33] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index c38bbfbbb5eaa..e2e94ee5a86fc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm17-17.0.6_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-17.0.6_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 572efd61a099da2cf62368948b3018e448707911 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 11/33] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From e840f1a1e2808f1ae0d6b3609665ce22647108c6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 12/33] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..78917ebf8066e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 970a5b508712e4b26352dc9e4174f8b46edfc544 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 13/33] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From 0203db12ba7fd404c8e7862360e576b207f08fda Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 14/33] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 6882f0077a8caf79d2653728ee4c984b1b249df6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 15/33] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 826470e152d9410cdb58420d02bc84b7e688bda2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 16/33] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 61baf5bde4ffe86ee0dc73856c293b38af36e77f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 17/33] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From 69a073eb120aa7aa6d912d50e95cf336833f6096 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 18/33] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e2e94ee5a86fc..9940702fbc2e1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 0b206a6006858593cf2815a2c810fc79ac7e540c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 19/33] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 5d1b673ff4946dfd1133d318f0ae0bb5960defe9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 20/33] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 0f3eab75604433c1e965ec02c1ba2393748d681b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 21/33] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 9940702fbc2e1..98b830eea0285 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From bff88911fed2923cb7ce842d6da86ed70e7f2422 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 22/33] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 39f1b2aff026d32de768af2229bd3c41d639bf44 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 23/33] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 08045d74cb289dd9ea01bfaf1e3e7a47bea662c5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 24/33] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..d0a38c63d9eef 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 09e398601b466b441a1ce80afba8e18cc0c1d1cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 25/33] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 5032126983681df44c8494dfe64ba80472237186 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 3 Dec 2023 13:40:46 -0500
Subject: [PATCH 26/33] rust: Rebuild against llvm17

---
 srcpkgs/rust/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..82b329424fa37 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -11,7 +11,7 @@ pkgname=rust
 version=1.75.0
 revision=2
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From dd9f319b815c757189e0574fc3db9a6fd6ccd596 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 27/33] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..fa0807f9ace69 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 8780f1d274885f377fe4c8792eca7b4c630f83a4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 28/33] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From 4789c14f5e0c8f3c3d2cdc765e4067d3fea630ce Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 29/33] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 039adad9ee5666206296e6a6f282c6b984e79ce6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 30/33] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From 9abea353051e82bd7762757186dafb3f36457769 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 31/33] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From cbfcae78a5bff6d228203cbc4349fdef8dc53050 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 32/33] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From a8169e1156897d5b878dd177693e2d265146af0a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 33/33] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (111 preceding siblings ...)
  2024-02-07 23:54 ` Calandracas606
@ 2024-02-08  0:02 ` Calandracas606
  2024-02-08  0:05 ` Calandracas606
                   ` (5 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-08  0:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 122257 bytes --]

From 06bde8378158a4b1b27d69a6e689a85c079e1917 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:36:33 -0500
Subject: [PATCH 01/32] New package: llvm17-17.0.6

---
 common/shlibs                                 |   8 +-
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm17-devel                          |   1 +
 srcpkgs/llvm17-doc                            |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...s-set-a-larger-stack-size-explicitly.patch |  37 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 46 files changed, 1225 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer17
 create mode 120000 srcpkgs/clang-tools-extra17
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 120000 srcpkgs/llvm17-doc
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index 61e838157b2ab..d206f5dd597ec 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,12 +985,16 @@ 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.17 lldb17-17.0.6_1
+libclang.so.17 libclang17-17.0.6_1
+libclang-cpp.so.17 libclang-cpp17-17.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.7_1
+libLLVM-17.so libllvm17-17.0.6_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
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch b/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
new file mode 100644
index 0000000000000..cb17121dea202
--- /dev/null
+++ b/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
@@ -0,0 +1,37 @@
+From 2354350bcc890c13016d67f4c060b32cb1cd693c Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 4 Nov 2023 08:44:01 +0100
+Subject: [PATCH 01/25] llvm: always set a larger stack size explicitly
+
+---
+ llvm/lib/Support/Threading.cpp | 14 --------------
+ 1 file changed, 14 deletions(-)
+
+diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp
+index 7cc7ba44c..b91b8f4bb 100644
+--- a/llvm/lib/Support/Threading.cpp
++++ b/llvm/lib/Support/Threading.cpp
+@@ -77,21 +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;
+-#elif defined(_AIX)
+-  // On AIX, the default pthread stack size limit is ~192k for 64-bit programs.
+-  // This limit is easily reached when doing link-time thinLTO. AIX library
+-  // developers have used 4MB, so we'll do the same.
+-const std::optional<unsigned> llvm::thread::DefaultStackSize = 4 * 1024 * 1024;
+-#else
+-const std::optional<unsigned> llvm::thread::DefaultStackSize;
+-#endif
+-
+ 
+ #endif
+ 
+-- 
+2.42.0
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..7bc22ec50272e
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+pycompile_dirs="usr/share/scan-view"
+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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From de54734b5ed9031d56acfcb8bfc29963243b447e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:38:29 -0500
Subject: [PATCH 02/32] llvm15: update to 15.0.7.

---
 common/shlibs               |   8 +-
 srcpkgs/clang-analyzer15    |   1 +
 srcpkgs/clang-tools-extra15 |   1 +
 srcpkgs/clang15             |   1 +
 srcpkgs/libclang-cpp15      |   1 +
 srcpkgs/libclang15          |   1 +
 srcpkgs/lld15               |   1 +
 srcpkgs/lld15-devel         |   1 +
 srcpkgs/lldb15              |   1 +
 srcpkgs/lldb15-devel        |   1 +
 srcpkgs/llvm15/template     | 194 +++++-------------------------------
 11 files changed, 36 insertions(+), 175 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel

diff --git a/common/shlibs b/common/shlibs
index d206f5dd597ec..c38bbfbbb5eaa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,15 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
 libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
 libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm17-17.0.6_1
 libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-17.0.6_1
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..6a939bb08fef1 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {

From 2924e1bec4ed5edbcfee331b423eb98e5d25b7c2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:38:50 -0500
Subject: [PATCH 03/32] llvm: update to 17.

---
 srcpkgs/clang                     |  2 +-
 srcpkgs/clang-tools-extra         |  2 +-
 srcpkgs/libclang                  |  2 +-
 srcpkgs/libclang-cpp              |  2 +-
 srcpkgs/libllvm                   |  1 +
 srcpkgs/lld                       |  2 +-
 srcpkgs/lldb                      |  2 +-
 srcpkgs/llvm/template             | 42 ++++++++++++++++++++++++++++---
 srcpkgs/removed-packages/template |  5 +++-
 9 files changed, 50 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/libllvm

diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..b8967217e0f29 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a862..2fca099c3ad31 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From 79248a0d1603e9e40e0cf1f7b2b5227caf5a21ac Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:42:35 -0500
Subject: [PATCH 04/32] clang-analyzer: remove unversioned package

---
 srcpkgs/clang-analyzer | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/clang-analyzer

diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/clang-analyzer
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 1abeefae5171def8dbf57ba2724c8aafd95b8bc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:42:59 -0500
Subject: [PATCH 05/32] lld-devel: remove unversioned package

---
 srcpkgs/lld-devel | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/lld-devel

diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/lld-devel
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 8e57c4a9ecfd8d42be01581d8a0a22337650c80f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:43:17 -0500
Subject: [PATCH 06/32] lldb-devel: remove unversioned package

---
 srcpkgs/lldb-devel | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/lldb-devel

diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/lldb-devel
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 716e91a9354deddd84eb4a59ba78b4930038a9c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 07/32] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From f7ffb9aefa4b47dbac5fc07bcbb16265aaa71ec4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 08/32] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From a903ce2d4b9ad24685a95c997479a16badfd9c2b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 09/32] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From f9e349682f40d6da8013acb852b40c49bbd07702 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 10/32] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index c38bbfbbb5eaa..e2e94ee5a86fc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm17-17.0.6_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-17.0.6_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 572efd61a099da2cf62368948b3018e448707911 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 11/32] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From e840f1a1e2808f1ae0d6b3609665ce22647108c6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 12/32] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..78917ebf8066e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 970a5b508712e4b26352dc9e4174f8b46edfc544 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 13/32] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From 0203db12ba7fd404c8e7862360e576b207f08fda Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 14/32] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 6882f0077a8caf79d2653728ee4c984b1b249df6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 15/32] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 826470e152d9410cdb58420d02bc84b7e688bda2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 16/32] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 61baf5bde4ffe86ee0dc73856c293b38af36e77f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 17/32] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From 69a073eb120aa7aa6d912d50e95cf336833f6096 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 18/32] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e2e94ee5a86fc..9940702fbc2e1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 0b206a6006858593cf2815a2c810fc79ac7e540c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 19/32] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 5d1b673ff4946dfd1133d318f0ae0bb5960defe9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 20/32] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 0f3eab75604433c1e965ec02c1ba2393748d681b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 21/32] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 9940702fbc2e1..98b830eea0285 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From bff88911fed2923cb7ce842d6da86ed70e7f2422 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 22/32] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 39f1b2aff026d32de768af2229bd3c41d639bf44 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 23/32] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 08045d74cb289dd9ea01bfaf1e3e7a47bea662c5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 24/32] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..d0a38c63d9eef 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 09e398601b466b441a1ce80afba8e18cc0c1d1cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 25/32] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 50c39216ac2dc9cfb694dac6f929b0185e0864f4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 26/32] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..fa0807f9ace69 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 07b855d4a5d0feddec5db3943f69d60f670314a4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 27/32] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From f392e2fe6ce6b407f7bb073fb53fc09944eb4323 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 28/32] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 6ba087d6eae9cb174256695b103ad54efb217209 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 29/32] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From b16695eeac0b4c806481153c7dfef9a6938d7b7e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 30/32] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From faa908427d054d1bcf6b1b01c9001d5504575d33 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 31/32] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From 34aeacf6c78bc8f0ea0ae2f2a5711032b3ba66ec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 32/32] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (112 preceding siblings ...)
  2024-02-08  0:02 ` Calandracas606
@ 2024-02-08  0:05 ` Calandracas606
  2024-02-08  0:17 ` Calandracas606
                   ` (4 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-08  0:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- i686
- armv6l-musl

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 123439 bytes --]

From 06bde8378158a4b1b27d69a6e689a85c079e1917 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:36:33 -0500
Subject: [PATCH 01/33] New package: llvm17-17.0.6

---
 common/shlibs                                 |   8 +-
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm17-devel                          |   1 +
 srcpkgs/llvm17-doc                            |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...s-set-a-larger-stack-size-explicitly.patch |  37 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 46 files changed, 1225 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer17
 create mode 120000 srcpkgs/clang-tools-extra17
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 120000 srcpkgs/llvm17-doc
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index 61e838157b2ab..d206f5dd597ec 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,12 +985,16 @@ 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.17 lldb17-17.0.6_1
+libclang.so.17 libclang17-17.0.6_1
+libclang-cpp.so.17 libclang-cpp17-17.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.7_1
+libLLVM-17.so libllvm17-17.0.6_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
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch b/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
new file mode 100644
index 0000000000000..cb17121dea202
--- /dev/null
+++ b/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
@@ -0,0 +1,37 @@
+From 2354350bcc890c13016d67f4c060b32cb1cd693c Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 4 Nov 2023 08:44:01 +0100
+Subject: [PATCH 01/25] llvm: always set a larger stack size explicitly
+
+---
+ llvm/lib/Support/Threading.cpp | 14 --------------
+ 1 file changed, 14 deletions(-)
+
+diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp
+index 7cc7ba44c..b91b8f4bb 100644
+--- a/llvm/lib/Support/Threading.cpp
++++ b/llvm/lib/Support/Threading.cpp
+@@ -77,21 +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;
+-#elif defined(_AIX)
+-  // On AIX, the default pthread stack size limit is ~192k for 64-bit programs.
+-  // This limit is easily reached when doing link-time thinLTO. AIX library
+-  // developers have used 4MB, so we'll do the same.
+-const std::optional<unsigned> llvm::thread::DefaultStackSize = 4 * 1024 * 1024;
+-#else
+-const std::optional<unsigned> llvm::thread::DefaultStackSize;
+-#endif
+-
+ 
+ #endif
+ 
+-- 
+2.42.0
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..7bc22ec50272e
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+pycompile_dirs="usr/share/scan-view"
+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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From de54734b5ed9031d56acfcb8bfc29963243b447e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:38:29 -0500
Subject: [PATCH 02/33] llvm15: update to 15.0.7.

---
 common/shlibs               |   8 +-
 srcpkgs/clang-analyzer15    |   1 +
 srcpkgs/clang-tools-extra15 |   1 +
 srcpkgs/clang15             |   1 +
 srcpkgs/libclang-cpp15      |   1 +
 srcpkgs/libclang15          |   1 +
 srcpkgs/lld15               |   1 +
 srcpkgs/lld15-devel         |   1 +
 srcpkgs/lldb15              |   1 +
 srcpkgs/lldb15-devel        |   1 +
 srcpkgs/llvm15/template     | 194 +++++-------------------------------
 11 files changed, 36 insertions(+), 175 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel

diff --git a/common/shlibs b/common/shlibs
index d206f5dd597ec..c38bbfbbb5eaa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,15 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
 libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
 libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm17-17.0.6_1
 libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-17.0.6_1
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..6a939bb08fef1 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {

From 2924e1bec4ed5edbcfee331b423eb98e5d25b7c2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:38:50 -0500
Subject: [PATCH 03/33] llvm: update to 17.

---
 srcpkgs/clang                     |  2 +-
 srcpkgs/clang-tools-extra         |  2 +-
 srcpkgs/libclang                  |  2 +-
 srcpkgs/libclang-cpp              |  2 +-
 srcpkgs/libllvm                   |  1 +
 srcpkgs/lld                       |  2 +-
 srcpkgs/lldb                      |  2 +-
 srcpkgs/llvm/template             | 42 ++++++++++++++++++++++++++++---
 srcpkgs/removed-packages/template |  5 +++-
 9 files changed, 50 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/libllvm

diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..b8967217e0f29 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a862..2fca099c3ad31 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From 79248a0d1603e9e40e0cf1f7b2b5227caf5a21ac Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:42:35 -0500
Subject: [PATCH 04/33] clang-analyzer: remove unversioned package

---
 srcpkgs/clang-analyzer | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/clang-analyzer

diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/clang-analyzer
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 1abeefae5171def8dbf57ba2724c8aafd95b8bc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:42:59 -0500
Subject: [PATCH 05/33] lld-devel: remove unversioned package

---
 srcpkgs/lld-devel | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/lld-devel

diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/lld-devel
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 8e57c4a9ecfd8d42be01581d8a0a22337650c80f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:43:17 -0500
Subject: [PATCH 06/33] lldb-devel: remove unversioned package

---
 srcpkgs/lldb-devel | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/lldb-devel

diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/lldb-devel
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 716e91a9354deddd84eb4a59ba78b4930038a9c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 07/33] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From f7ffb9aefa4b47dbac5fc07bcbb16265aaa71ec4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 08/33] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From a903ce2d4b9ad24685a95c997479a16badfd9c2b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 09/33] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From f9e349682f40d6da8013acb852b40c49bbd07702 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 10/33] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index c38bbfbbb5eaa..e2e94ee5a86fc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm17-17.0.6_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-17.0.6_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 572efd61a099da2cf62368948b3018e448707911 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 11/33] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From e840f1a1e2808f1ae0d6b3609665ce22647108c6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 12/33] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..78917ebf8066e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 970a5b508712e4b26352dc9e4174f8b46edfc544 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 13/33] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From 0203db12ba7fd404c8e7862360e576b207f08fda Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 14/33] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 6882f0077a8caf79d2653728ee4c984b1b249df6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 15/33] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 826470e152d9410cdb58420d02bc84b7e688bda2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 16/33] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 61baf5bde4ffe86ee0dc73856c293b38af36e77f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 17/33] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From 69a073eb120aa7aa6d912d50e95cf336833f6096 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 18/33] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e2e94ee5a86fc..9940702fbc2e1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 0b206a6006858593cf2815a2c810fc79ac7e540c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 19/33] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 5d1b673ff4946dfd1133d318f0ae0bb5960defe9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 20/33] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 0f3eab75604433c1e965ec02c1ba2393748d681b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 21/33] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 9940702fbc2e1..98b830eea0285 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From bff88911fed2923cb7ce842d6da86ed70e7f2422 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 22/33] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 39f1b2aff026d32de768af2229bd3c41d639bf44 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 23/33] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 08045d74cb289dd9ea01bfaf1e3e7a47bea662c5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 24/33] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..d0a38c63d9eef 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 09e398601b466b441a1ce80afba8e18cc0c1d1cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 25/33] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 50c39216ac2dc9cfb694dac6f929b0185e0864f4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 26/33] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..fa0807f9ace69 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 07b855d4a5d0feddec5db3943f69d60f670314a4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 27/33] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From f392e2fe6ce6b407f7bb073fb53fc09944eb4323 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 28/33] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 6ba087d6eae9cb174256695b103ad54efb217209 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 29/33] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From b16695eeac0b4c806481153c7dfef9a6938d7b7e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 30/33] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From faa908427d054d1bcf6b1b01c9001d5504575d33 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 31/33] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From 34aeacf6c78bc8f0ea0ae2f2a5711032b3ba66ec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 32/33] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

From 448214e800687ff4ef1186582396fb543c417b1c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 19:04:54 -0500
Subject: [PATCH 33/33] rust: rebuild for llvm17

---
 srcpkgs/rust/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index d33e713857ad3..5a09d870ad501 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.75.0
-revision=2
+revision=3
 hostmakedepends="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 llvm17-devel"
 depends="rust-std gcc"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm17-devel"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Updated] New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (113 preceding siblings ...)
  2024-02-08  0:05 ` Calandracas606
@ 2024-02-08  0:17 ` Calandracas606
  2024-02-08 21:40 ` dkwo
                   ` (3 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-08  0:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17
https://github.com/void-linux/void-packages/pull/46935

New package: llvm17
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- aarch64 (cross)
- i686
- armv6l-musl (cross)

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46935.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-46935.patch --]
[-- Type: text/x-diff, Size: 122257 bytes --]

From 06bde8378158a4b1b27d69a6e689a85c079e1917 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:36:33 -0500
Subject: [PATCH 01/32] New package: llvm17-17.0.6

---
 common/shlibs                                 |   8 +-
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/clang17-devel                         |   1 +
 srcpkgs/flang17                               |   1 +
 srcpkgs/flang17-devel                         |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-bolt17                           |   1 +
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm17-devel                          |   1 +
 srcpkgs/llvm17-doc                            |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/SmallVector.patch      |  13 +
 ...s-set-a-larger-stack-size-explicitly.patch |  37 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  37 +
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  35 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  27 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  36 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  24 +
 srcpkgs/llvm17/template                       | 668 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 srcpkgs/mlir17                                |   1 +
 srcpkgs/mlir17-devel                          |   1 +
 46 files changed, 1225 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer17
 create mode 120000 srcpkgs/clang-tools-extra17
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/clang17-devel
 create mode 120000 srcpkgs/flang17
 create mode 120000 srcpkgs/flang17-devel
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-bolt17
 create mode 120000 srcpkgs/llvm17-devel
 create mode 120000 srcpkgs/llvm17-doc
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/SmallVector.patch
 create mode 100644 srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update
 create mode 120000 srcpkgs/mlir17
 create mode 120000 srcpkgs/mlir17-devel

diff --git a/common/shlibs b/common/shlibs
index 61e838157b2ab..d206f5dd597ec 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,12 +985,16 @@ 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.17 lldb17-17.0.6_1
+libclang.so.17 libclang17-17.0.6_1
+libclang-cpp.so.17 libclang-cpp17-17.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.7_1
+libLLVM-17.so libllvm17-17.0.6_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
+libomp.so.5 libomp-17.0.6_1
+libomptarget.so.17 libomp-17.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
diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17-devel b/srcpkgs/clang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17 b/srcpkgs/flang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/flang17-devel b/srcpkgs/flang17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/flang17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-bolt17 b/srcpkgs/llvm-bolt17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-bolt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9c..96970d5c02c13 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17-devel b/srcpkgs/llvm17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17-doc b/srcpkgs/llvm17-doc
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-doc
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/SmallVector.patch b/srcpkgs/llvm17/patches/SmallVector.patch
new file mode 100644
index 0000000000000..ac10d306c4346
--- /dev/null
+++ b/srcpkgs/llvm17/patches/SmallVector.patch
@@ -0,0 +1,13 @@
+diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
+index 2e6d2dc6ce90..be2cf6cc1fee 100644
+--- a/llvm/include/llvm/ADT/SmallVector.h
++++ b/llvm/include/llvm/ADT/SmallVector.h
+@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+   // happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
+   // 64-bit host, is expected to be very rare.
+   static_assert(
+-      sizeof(T) <= 256,
++      sizeof(T) <= 288,
+       "You are trying to use a default number of inlined elements for "
+       "`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
+       "explicit number of inlined elements with `SmallVector<T, N>` to make "
diff --git a/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch b/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
new file mode 100644
index 0000000000000..cb17121dea202
--- /dev/null
+++ b/srcpkgs/llvm17/patches/always-set-a-larger-stack-size-explicitly.patch
@@ -0,0 +1,37 @@
+From 2354350bcc890c13016d67f4c060b32cb1cd693c Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sat, 4 Nov 2023 08:44:01 +0100
+Subject: [PATCH 01/25] llvm: always set a larger stack size explicitly
+
+---
+ llvm/lib/Support/Threading.cpp | 14 --------------
+ 1 file changed, 14 deletions(-)
+
+diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp
+index 7cc7ba44c..b91b8f4bb 100644
+--- a/llvm/lib/Support/Threading.cpp
++++ b/llvm/lib/Support/Threading.cpp
+@@ -77,21 +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;
+-#elif defined(_AIX)
+-  // On AIX, the default pthread stack size limit is ~192k for 64-bit programs.
+-  // This limit is easily reached when doing link-time thinLTO. AIX library
+-  // developers have used 4MB, so we'll do the same.
+-const std::optional<unsigned> llvm::thread::DefaultStackSize = 4 * 1024 * 1024;
+-#else
+-const std::optional<unsigned> llvm::thread::DefaultStackSize;
+-#endif
+-
+ 
+ #endif
+ 
+-- 
+2.42.0
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..e4eaa7783e7a6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..0ef4c7e75d6b5
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..4ad6412d1e6c6
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..b6d385c1d1814
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,37 @@
+--- 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__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || defined(__loongarch__) ||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_LOONGARCH64) && \
+-     !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) ||SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++     !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..700ab13479045
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,35 @@
+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]':
+
+diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
+index b8ac536588d3..65e5a1365634 100644
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -308,6 +308,8 @@ endif()
+ option(LIBCXX_HERMETIC_STATIC_LIBRARY
+   "Do not export any symbols from the static library." ${LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT})
+ 
++option(LIBCXX_VOID_GCC_BUG_109180_WORKAROUND OFF)
++
+ #===============================================================================
+ # Check option configurations
+ #===============================================================================
+diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
+index 35b466527096..5b0efa171616 100644
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,10 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++if (LIBCXX_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/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..fb0ea3da4d057
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,27 @@
+--- 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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..70292beb2fcdb
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libcxxabi-dl.patch b/srcpkgs/llvm17/patches/libcxxabi-dl.patch
new file mode 100644
index 0000000000000..3a15f9db8c981
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..9a622cd9254c2
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..b6efd02a5698f
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..51d0e4b31b32c
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..d332687b9d929
--- /dev/null
+++ b/srcpkgs/llvm17/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/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..192b4824b8695
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,24 @@
+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__)
++#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
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..7bc22ec50272e
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,668 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+pycompile_dirs="usr/share/scan-view"
+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
+ -DCLANG_LINK_CLANG_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_ENABLE_RUNTIMES=all
+ -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 git python3-sphinx-markdown-tables python3-yaml pkg-config "
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel "
+depends="libllvm17>=${version}_${revision}"
+short_desc="LLVM Compiler Infrastructure Project - Version 17"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+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=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+lib32disabled=yes
+python_version=3
+
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
+esac
+
+if [ "$XBPS_CCACHE" ]; then
+	configure_args+=" -DLLVM_CCACHE_BUILD=YES "
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+if [ "$build_option_clang" ]; then
+	_enabled_projects+="clang;"
+	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+fi
+if [ "$build_option_clang_tools_extra" ]; then
+	_enabled_projects+="clang-tools-extra;"
+	subpackages+=" clang-tools-extra17 "
+fi
+if [ "$build_option_bolt" ]; then
+	_enabled_projects+="bolt;"
+	subpackages+=" llvm-bolt17 "
+fi
+if [ "$build_option_polly" ]; then
+	_enabled_projects+="polly;"
+fi
+if [ "$build_option_lldb" ]; then
+	_enabled_projects+="lldb;"
+	subpackages+=" lldb17 lldb17-devel "
+fi
+if [ "$build_option_lld" ]; then
+	_enabled_projects+="lld;"
+	subpackages+=" lld17 lld17-devel "
+fi
+if [ "$build_option_libclc" ]; then
+	_enabled_projects+="libclc;"
+fi
+if [ "$build_option_mlir" ]; then
+	_enabled_projects+="mlir;"
+	subpackages+=" mlir17 mlir17-devel "
+fi
+if [ "$build_option_flang" ]; then
+	_enabled_projects+="flang;"
+	subpackages+=" flang17 flang17-devel "
+fi
+if [ "$build_option_openmp" ]; then
+	_enabled_projects+="openmp;"
+	subpackages+=" libomp libomp-devel "
+fi
+subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+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
+
+
+# For OCaml bindings and lldb lua scripting
+if [ -z "$CROSS_BUILD" ]; then
+	# OCaml cross build is broken
+	hostmakedepends+=" ocaml ocaml-findlib "
+	# lldb cross build fails with lua
+	makedepends+=" lua53-devel "
+fi
+
+post_patch() {
+	if [ "$build_option_lldb" ]; 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+=" -DLIBCXX_VOID_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
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+
+		make ${makejobs} -C tools/clang/utils/TableGen
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+
+		make ${makejobs} -C tools/mlir/tools/mlir-pdll
+		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
+
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+
+		make ${makejobs} -C tools/llvm-config
+		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
+
+		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
+		configure_args+=" -DLLDB_TABLEGEN_EXE=${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}"
+}
+
+post_build() {
+
+	mkdir -p ${wrksrc}/${build_wrksrc}/runtimes-doc
+	cmake -G Ninja ${wrksrc}/runtimes -B ${wrksrc}/${build_wrksrc}/runtimes-doc \
+		-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+		-DLLVM_ENABLE_SPHINX=ON \
+		-DSPHINX_WARNINGS_AS_ERRORS=OFF
+
+	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+}
+
+post_install() {
+
+	# 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
+
+	rm -rf ${DESTDIR}/usr/share/gdb
+
+	# 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
+
+	# Install libcxx and libunwind docs
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/cmake_install.cmake
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/cmake_install.cmake
+
+	# Can this be disabled some other way?
+	rm -rf ${DESTDIR}/usr/lib64
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision} "
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/clang-17
+		vmove usr/bin/clang
+		vmove usr/bin/clang++
+		vmove usr/bin/clang-cl
+		vmove usr/bin/clang-cpp
+		vmove usr/bin/clang-check
+		vmove usr/bin/clang-extdef-mapping
+		vmove usr/bin/clang-format
+		vmove usr/bin/clang-linker-wrapper
+		vmove usr/bin/clang-offload-bundler
+		vmove usr/bin/clang-offload-packager
+		vmove usr/bin/clang-refactor
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-repl
+		vmove usr/bin/clang-scan-deps
+		vmove usr/bin/clang-tblgen
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/bin/amdgpu-arch
+		vmove usr/bin/nvptx-arch
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+		if [ "$build_option_polly" ]; then
+			vmove usr/lib/LLVMPolly.so
+			vmove usr/share/man/man1/polly.1
+		fi
+	}
+}
+
+clang17-devel_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend - development Files"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/libear
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/bin/hmaptool
+		vmove usr/bin/git-clang-format
+		if [ "$build_option_clang_tools_extra" ]; then
+			vmove usr/include/clang-tidy
+			vmove usr/lib/libfindAllSymbols.a
+		fi
+		if [ "$build_option_polly" ]; then
+			vmove usr/include/polly
+			vmove usr/lib/cmake/polly
+			vmove "usr/lib/libPolly*.a"
+		fi
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+clang-analyzer17_package() {
+	depends="clang17-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/scan-view
+		vmove usr/share/scan-build
+		vmove usr/lib/libscanbuild
+		vmove usr/libexec/analyze-c++
+		vmove usr/libexec/analyze-cc
+		vmove usr/libexec/intercept-c++
+		vmove usr/libexec/intercept-cc
+		vmove usr/libexec/c++-analyzer
+		vmove usr/libexec/ccc-analyzer
+		vmove usr/share/man/man1/scan-build.1
+		vmove usr/bin/analyze-build
+		vmove usr/bin/scan-build
+		vmove usr/bin/scan-build-py
+		vmove usr/bin/scan-view
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${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-cleaner
+		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/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/run-clang-tidy
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+# "bolt" package name is already used
+llvm-bolt17_package() {
+	lib32disabled=yes
+	short_desc+=" - post-link optimizer"
+	homepage="https://github.com/llvm/llvm-project/tree/main/bolt"
+	depends="clang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-bolt
+		vmove usr/bin/perf2bolt
+		vmove usr/bin/llvm-boltdiff
+		vmove usr/bin/merge-fdata
+		vmove usr/bin/llvm-bolt-heatmap
+		case "$XBPS_TARGET_MACHINE" in
+			x86_64*) vmove usr/lib/libbolt_rt_instr.a
+				 vmove usr/lib/libbolt_rt_hugify.a
+				;;
+		esac
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/lldb
+		vmove usr/bin/lldb-argdumper
+		vmove usr/bin/lldb-instr
+		vmove usr/bin/lldb-server
+		vmove usr/bin/lldb-vscode
+		vmove "usr/lib/liblldb*.so.*"
+		vmove "usr/lib/python${py3_ver}/site-packages/lldb"
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove /usr/lib/lua/5.3/lldb.so
+		fi
+	}
+}
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld
+		vmove usr/bin/lld-link
+		vmove usr/bin/ld.lld
+		vmove usr/bin/ld64.lld
+		vmove usr/bin/wasm-ld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*.a"
+	}
+}
+
+mlir17_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove "usr/lib/libMLIR*.so.*"
+		vmove "usr/lib/libmlir*.so.*"
+	}
+}
+
+mlir17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - multi-level IR compiler framework - development files"
+	homepage="https://mlir.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/mlir-cpu-runner
+		vmove usr/bin/mlir-linalg-ods-yaml-gen
+		vmove usr/bin/mlir-lsp-server
+		vmove usr/bin/mlir-opt
+		vmove usr/bin/mlir-pdll
+		vmove usr/bin/mlir-pdll-lsp-server
+		vmove usr/bin/mlir-reduce
+		vmove usr/bin/mlir-tblgen
+		vmove usr/bin/mlir-translate
+		vmove usr/bin/tblgen-lsp-server
+		vmove usr/include/mlir
+		vmove usr/include/mlir-c
+		vmove usr/lib/cmake/mlir
+		vmove "usr/lib/libMLIR*"
+		vmove "usr/lib/objects-Release/obj.MLIR*"
+		vmove "usr/lib/libmlir*"
+		vmove usr/share/man/man1/mlir-tblgen.1
+	}
+}
+
+flang17_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend"
+	homepage="https://flang.llvm.org/"
+	depends="mlir17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/flang-new
+		vmove usr/bin/flang-to-external-fc
+	}
+}
+
+flang17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - Fortran language frontend - development files"
+	homepage="https://flang.llvm.org/"
+	depends="flang17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/bbc
+		vmove usr/bin/f18-parse-demo
+		vmove usr/bin/fir-opt
+		vmove usr/bin/tco
+		vmove usr/include/flang
+		vmove usr/lib/cmake/flang
+		vmove "usr/lib/libflang*.a"
+		vmove "usr/lib/libFIR*.a"
+		vmove "usr/lib/libHLFIR*.a"
+		vmove "usr/lib/libFortran*.a"
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-omp-device-info
+		vmove usr/bin/llvm-omp-kernel-replay
+		vmove "usr/lib/libarcher*.so"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove "usr/lib/libomptarget*.bc"
+			vmove "usr/lib/libarcher*.a"
+			vmove "usr/lib/libomp*.a"
+		fi
+	}
+}
+
+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"
+
+		LIBUNWIND_DOCS=usr/share/doc/LLVM/libunwind
+		vmkdir ${LIBUNWIND_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libunwind/docs/html ${LIBUNWIND_DOCS}
+	}
+}
+
+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"
+
+		LIBCXX_DOCS=usr/share/doc/LLVM/libcxx
+		vmkdir ${LIBCXX_DOCS}
+		vcopy ${wrksrc}/${build_wrksrc}/runtimes-doc/libcxx/docs/html ${LIBCXX_DOCS}
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
+
+llvm17-doc_package() {
+	short_desc+=" - documentation "
+	pkg_install() {
+		vmove usr/share/doc
+	}
+}
+
+llvm17-devel_package() {
+	short_desc+=" - development files"
+	depends="llvm17>=${version}_${revision}"
+	if [ "$build_option_openmp" ]; then
+		depends+=" libomp-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_mlir" ]; then
+		depends+=" mlir17-devel>={$version}_${revision} "
+	fi
+	if [ "$build_option_clang" ]; then
+		depends+=" clang17-devel>={$version}_${revision} "
+	fi
+	pkg_install() {
+		vmove usr/lib/libLLVM.so
+		vmove usr/lib/libLTO.so
+		vmove usr/lib/libRemarks.so
+		vmove usr/include/llvm
+		vmove usr/include/llvm-c
+		vmove "usr/lib/libLLVM*.a"
+		vmove usr/lib/cmake/llvm
+
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"
diff --git a/srcpkgs/mlir17 b/srcpkgs/mlir17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/mlir17-devel b/srcpkgs/mlir17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/mlir17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file

From de54734b5ed9031d56acfcb8bfc29963243b447e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:38:29 -0500
Subject: [PATCH 02/32] llvm15: update to 15.0.7.

---
 common/shlibs               |   8 +-
 srcpkgs/clang-analyzer15    |   1 +
 srcpkgs/clang-tools-extra15 |   1 +
 srcpkgs/clang15             |   1 +
 srcpkgs/libclang-cpp15      |   1 +
 srcpkgs/libclang15          |   1 +
 srcpkgs/lld15               |   1 +
 srcpkgs/lld15-devel         |   1 +
 srcpkgs/lldb15              |   1 +
 srcpkgs/lldb15-devel        |   1 +
 srcpkgs/llvm15/template     | 194 +++++-------------------------------
 11 files changed, 36 insertions(+), 175 deletions(-)
 create mode 120000 srcpkgs/clang-analyzer15
 create mode 120000 srcpkgs/clang-tools-extra15
 create mode 120000 srcpkgs/clang15
 create mode 120000 srcpkgs/libclang-cpp15
 create mode 120000 srcpkgs/libclang15
 create mode 120000 srcpkgs/lld15
 create mode 120000 srcpkgs/lld15-devel
 create mode 120000 srcpkgs/lldb15
 create mode 120000 srcpkgs/lldb15-devel

diff --git a/common/shlibs b/common/shlibs
index d206f5dd597ec..c38bbfbbb5eaa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,15 +982,15 @@ 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.17 lldb17-17.0.6_1
+liblldb.so.15 lldb15-15.0.7_4
 libclang.so.17 libclang17-17.0.6_1
+libclang.so.15 libclang15-15.0.7_4
 libclang-cpp.so.17 libclang-cpp17-17.0.6_1
+libclang-cpp.so.15 libclang-cpp15-15.0.7_4
 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-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm17-17.0.6_1
 libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-17.0.6_1
diff --git a/srcpkgs/clang-analyzer15 b/srcpkgs/clang-analyzer15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-analyzer15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra15 b/srcpkgs/clang-tools-extra15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang-tools-extra15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang15 b/srcpkgs/clang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/clang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp15 b/srcpkgs/libclang-cpp15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang-cpp15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang15 b/srcpkgs/libclang15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/libclang15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15 b/srcpkgs/lld15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld15-devel b/srcpkgs/lld15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lld15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15 b/srcpkgs/lldb15
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb15-devel b/srcpkgs/lldb15-devel
new file mode 120000
index 0000000000000..ad57a969b9f9c
--- /dev/null
+++ b/srcpkgs/lldb15-devel
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..6a939bb08fef1 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm15'
 pkgname=llvm15
 version=15.0.7
-revision=3
+revision=4
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -9,15 +9,6 @@ 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
@@ -29,13 +20,12 @@ configure_args="
  -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"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel"
 depends="libllvm15>=${version}_${revision}"
-short_desc="Low Level Virtual Machine"
-maintainer="Orphaned <orphan@voidlinux.org>"
+short_desc="LLVM Compiler Infrastructure Project - Version 15"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
 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"
@@ -54,46 +44,26 @@ 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"
+_enabled_projects="clang;clang-tools-extra;compiler-rt;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"
+subpackages="clang-tools-extra15 clang15 clang-analyzer15 libclang15 libclang-cpp15
+ libllvm15"
 
 if [ "$_lldb_enable" = "yes" ]; then
 	# XXX fails to cross compile due to python
 	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
+	subpackages+=" lldb15 lldb15-devel"
 fi
 
-subpackages+=" lld lld-devel"
+subpackages+=" lld15 lld15-devel"
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 
@@ -103,32 +73,11 @@ post_patch() {
 			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() {
@@ -211,22 +160,11 @@ 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() {
+clang-analyzer15_package() {
 	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
+	depends="clang15-${version}_${revision} python3 perl"
 	short_desc+=" - A source code analysis framework"
 	homepage="https://clang-analyzer.llvm.org/"
 	pkg_install() {
@@ -237,9 +175,9 @@ clang-analyzer_package() {
 	}
 }
 
-clang-tools-extra_package() {
+clang-tools-extra15_package() {
 	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
+	depends="clang15-${version}_${revision} python3"
 	short_desc+=" - Extra Clang tools"
 	homepage="https://clang.llvm.org/extra/"
 	pkg_install() {
@@ -274,15 +212,13 @@ clang-tools-extra_package() {
 		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() {
+clang15_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
+	 libclang15-${version}_${revision}"
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -296,27 +232,24 @@ clang_package() {
 		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() {
+libclang15_package() {
 	short_desc+=" - C frontend runtime library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
-libclang-cpp_package() {
+libclang-cpp15_package() {
 	short_desc+=" - C frontend runtime library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
 }
 
-lld_package() {
+lld15_package() {
 	lib32disabled=yes
 	short_desc+=" - linker"
 	homepage="https://lld.llvm.org"
@@ -325,15 +258,14 @@ lld_package() {
 		vmove "usr/bin/ld64.lld*"
 		vmove "usr/bin/lld*"
 		vmove usr/bin/wasm-ld
-		vmove usr/share/doc/LLVM/lld
 	}
 }
 
-lld-devel_package() {
+lld15-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
+	depends="lld15>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -341,7 +273,7 @@ lld-devel_package() {
 	}
 }
 
-lldb_package() {
+lldb15_package() {
 	lib32disabled=yes
 	depends+=" python3-six"
 	short_desc+=" - LLDB debugger"
@@ -353,9 +285,9 @@ lldb_package() {
 	}
 }
 
-lldb-devel_package() {
+lldb15-devel_package() {
 	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
+	depends="lldb15>=${version}_${revision}"
 	short_desc+=" - LLDB debugger - development files"
 	pkg_install() {
 		vmove usr/include/lldb
@@ -363,86 +295,6 @@ lldb-devel_package() {
 	}
 }
 
-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() {

From 2924e1bec4ed5edbcfee331b423eb98e5d25b7c2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:38:50 -0500
Subject: [PATCH 03/32] llvm: update to 17.

---
 srcpkgs/clang                     |  2 +-
 srcpkgs/clang-tools-extra         |  2 +-
 srcpkgs/libclang                  |  2 +-
 srcpkgs/libclang-cpp              |  2 +-
 srcpkgs/libllvm                   |  1 +
 srcpkgs/lld                       |  2 +-
 srcpkgs/lldb                      |  2 +-
 srcpkgs/llvm/template             | 42 ++++++++++++++++++++++++++++---
 srcpkgs/removed-packages/template |  5 +++-
 9 files changed, 50 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/libllvm

diff --git a/srcpkgs/clang b/srcpkgs/clang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/libllvm b/srcpkgs/libllvm
new file mode 120000
index 0000000000000..0d68131b9b308
--- /dev/null
+++ b/srcpkgs/libllvm
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9c..0d68131b9b308 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26fd..b8967217e0f29 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,47 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=17
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm17"
 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"
+replaces="llvm15>=0 llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+
+libclang_package() {
+	build_style=meta
+	depends="libclang${version}>=0"
+	short_desc+=" - libclang"
+}
+libclang-cpp_package() {
+	build_style=meta
+	depends="libclang-cpp${version}>=0"
+	short_desc+=" - libclang-cpp"
+}
+libllvm_package() {
+	build_style=meta
+	depends="libllvm${version}>=0"
+	short_desc+=" - libllvm"
+}
+clang_package() {
+	build_style=meta
+	depends="clang${version}>=0"
+	short_desc+=" - clang"
+}
+clang-tools-extra_package() {
+	build_style=meta
+	depends="clang-tools-extra${version}>=0"
+	short_desc+=" - clang-tools-extra"
+}
+lld_package() {
+	build_style=meta
+	depends="lld${version}>=0"
+	short_desc+=" - lld"
+}
+lldb_package() {
+	build_style=meta
+	depends="lldb${version}>=0"
+	short_desc+=" - lldb"
+}
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 94feb99c0a862..2fca099c3ad31 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,6 +1,6 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
-version=0.1.20240105
+version=0.1.20240201
 revision=1
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
@@ -721,6 +721,9 @@ replaces="
  zou<=0.2.0_7
  zuluplay-devel<=1.1_1
  zuluplay<=1.1_1
+ lldb-devel<=15.0.7_3
+ lld-devel<=15.0.7_3
+ llvm-libunwind-devel<=15.0.7_3
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

From 79248a0d1603e9e40e0cf1f7b2b5227caf5a21ac Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:42:35 -0500
Subject: [PATCH 04/32] clang-analyzer: remove unversioned package

---
 srcpkgs/clang-analyzer | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/clang-analyzer

diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/clang-analyzer
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 1abeefae5171def8dbf57ba2724c8aafd95b8bc7 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:42:59 -0500
Subject: [PATCH 05/32] lld-devel: remove unversioned package

---
 srcpkgs/lld-devel | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/lld-devel

diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/lld-devel
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 8e57c4a9ecfd8d42be01581d8a0a22337650c80f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 7 Feb 2024 18:43:17 -0500
Subject: [PATCH 06/32] lldb-devel: remove unversioned package

---
 srcpkgs/lldb-devel | 1 -
 1 file changed, 1 deletion(-)
 delete mode 120000 srcpkgs/lldb-devel

diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
deleted file mode 120000
index ad57a969b9f9c..0000000000000
--- a/srcpkgs/lldb-devel
+++ /dev/null
@@ -1 +0,0 @@
-llvm15
\ No newline at end of file

From 716e91a9354deddd84eb4a59ba78b4930038a9c3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:35 -0400
Subject: [PATCH 07/32] CastXML: update to 0.6.2.

---
 srcpkgs/CastXML/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4c..d8cb7aaaf8cf3 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,11 +1,11 @@
 # Template file for 'CastXML'
 pkgname=CastXML
-version=0.5.1
-revision=2
+version=0.6.2
+revision=1
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm17-devel"
 depends="clang"
 checkdepends="libxml2"
 short_desc="C-family abstract syntax tree XML output tool"
@@ -13,7 +13,7 @@ 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/refs/tags/v${version}.tar.gz"
-checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
+checksum=9bb108de1b3348a257be5b08a9f8418f89fdcd4af2e6ee271d68b0203ac75d5e
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From f7ffb9aefa4b47dbac5fc07bcbb16265aaa71ec4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:07:50 -0400
Subject: [PATCH 08/32] bpftrace: rebuild for llvm17

---
 srcpkgs/bpftrace/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 6b2d4ac25fc07..bbd738df63d57 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,12 +1,12 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.20.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
 hostmakedepends="flex pkg-config ruby-asciidoctor"
-makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm"
+makedepends="bcc-devel cereal clang clang-tools-extra elfutils-devel libbpf-devel libxml2-devel llvm17-devel"
 short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filter"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"

From a903ce2d4b9ad24685a95c997479a16badfd9c2b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:28:31 -0400
Subject: [PATCH 09/32] SPIRV-Tools: rebuild for llvm17

---
 srcpkgs/SPIRV-Tools/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 09a96c61ca504..5aba11a4a431f 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.5
 revision=1
 build_style=cmake
 configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
@@ -12,8 +12,8 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+distfiles="https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tarball/vulkan-sdk-1.3.268.0>${version}.tar.gz"
+checksum=eb560857e21876561e9e738ae8c9d6f42038366f90b2564be067cf020627e722
 LDFLAGS="-Wl,--no-undefined"
 
 SPIRV-Tools-devel_package() {

From f9e349682f40d6da8013acb852b40c49bbd07702 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:16 -0400
Subject: [PATCH 10/32] SPIRV-LLVM-Translator: update to 17.0.0.

---
 common/shlibs                          | 2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index c38bbfbbb5eaa..e2e94ee5a86fc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_4
 libLLVM-17.so libllvm17-17.0.6_1
-libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVMSPIRVLib.so.17 SPIRV-LLVM-Translator-17.0.0_1
 libomp.so.5 libomp-17.0.6_1
 libomptarget.so.17 libomp-17.0.3_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb26..6f1cf2bd6e484 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,6 +1,6 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=17.0.0
 revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
@@ -8,13 +8,13 @@ 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"
+makedepends="clang-tools-extra llvm17-devel 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=eba381e1dd99b4ff6c672a28f52755d1adf2d810a97b51e6074ad4fa67937fb2
 
 post_install() {
 	vlicense LICENSE.TXT

From 572efd61a099da2cf62368948b3018e448707911 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 11:50:23 -0400
Subject: [PATCH 11/32] SPIRV-Headers: update to 1.3.268.0.

---
 srcpkgs/SPIRV-Headers/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 2457d5411aebe..6527729b3980b 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,15 +1,15 @@
 # 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.268.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
-distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
+checksum=1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4
 
 post_install() {
 	vlicense LICENSE

From e840f1a1e2808f1ae0d6b3609665ce22647108c6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 14:49:45 -0400
Subject: [PATCH 12/32] mesa: rebuild for llvm17

---
 srcpkgs/mesa/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 05a35dce0d1a9..78917ebf8066e 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,19 +1,19 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=23.3.2
-revision=1
+revision=2
 build_style=meson
 #Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
 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++17"
-hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
+hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm17-devel
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
  libXxf86vm-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel zlib-devel
- $(vopt_if wayland 'wayland-devel wayland-protocols') llvm libsensors-devel
+ $(vopt_if wayland 'wayland-devel wayland-protocols') llvm17-devel libsensors-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"

From 970a5b508712e4b26352dc9e4174f8b46edfc544 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 16:51:08 -0400
Subject: [PATCH 13/32] ccls: rebuild for llvm17

---
 srcpkgs/ccls/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 9c1338c267372..3e7bff1265377 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,11 +1,11 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20230717
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DUSE_SYSTEM_RAPIDJSON=ON"
 hostmakedepends="clang-tools-extra"
-makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"
+makedepends="clang-tools-extra libxml2-devel llvm17-devel ncurses-devel rapidjson zlib-devel"
 short_desc="C/C++/ObjC language server"
 maintainer="André Cerqueira <acerqueira021@gmail.com>"
 license="Apache-2.0"

From 0203db12ba7fd404c8e7862360e576b207f08fda Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 17:49:25 -0400
Subject: [PATCH 14/32] clazy: rebuild for llvm17

---
 srcpkgs/clazy/patches/llvm16.patch | 83 ++++++++++++++++++++++++++++++
 srcpkgs/clazy/patches/llvm17.patch | 28 ++++++++++
 srcpkgs/clazy/template             |  4 +-
 3 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/clazy/patches/llvm16.patch
 create mode 100644 srcpkgs/clazy/patches/llvm17.patch

diff --git a/srcpkgs/clazy/patches/llvm16.patch b/srcpkgs/clazy/patches/llvm16.patch
new file mode 100644
index 0000000000000..a5759060c112d
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h        | 17 ++++++++++++-----
+ src/checkbase.h                         |  1 +
+ src/checks/level0/lambda-in-connect.cpp |  2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ 
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++    auto buffer = sm.getBufferOrNone(id);
++    *invalid = !buffer.has_value();
++    return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+     auto buffer = sm.getBufferOrNone(id);
+     *invalid = !buffer.hasValue();
+     return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+                             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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+ 
+     for (auto capture : captures) {
+         if (capture.getCaptureKind() == clang::LCK_ByRef) {
+-            VarDecl *declForCapture = capture.getCapturedVar();
++            auto *declForCapture = capture.getCapturedVar();
+             if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+                 emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+         }
+-- 
+GitLab
+
diff --git a/srcpkgs/clazy/patches/llvm17.patch b/srcpkgs/clazy/patches/llvm17.patch
new file mode 100644
index 0000000000000..910ab426070d9
--- /dev/null
+++ b/srcpkgs/clazy/patches/llvm17.patch
@@ -0,0 +1,28 @@
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2022-01-20 18:18:47.000000000 -0500
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp	2023-11-03 17:12:24.669027622 -0400
+@@ -61,8 +61,13 @@
+     if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+         return true;
+ 
++#if LLVM_VERSION_MAJOR >= 17
++    if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++        return true;
++#else
+     if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+         return true;
++#endif
+ 
+     if (clazy::contains_lower(en->getName(), "mask"))
+         return true;
+@@ -158,7 +163,11 @@
+ 
+     for (EnumConstantDecl* enumerator : enumerators) {
+         const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++        if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+         if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+             if (isIntentionallyNotPowerOf2(enumerator))
+                 continue;
+             const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836f..fdab8dda0b89b 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,11 +1,11 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"
-makedepends="clang llvm clang-tools-extra"
+makedepends="clang llvm17-devel clang-tools-extra"
 depends="clang"
 short_desc="Qt oriented code checker based on clang framework"
 maintainer="John <me@johnnynator.dev>"

From 6882f0077a8caf79d2653728ee4c984b1b249df6 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 18:59:45 -0400
Subject: [PATCH 15/32] gnome-builder: rebuild for llvm17

---
 srcpkgs/gnome-builder/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gnome-builder/template b/srcpkgs/gnome-builder/template
index a85de84f5dd0d..5061969cb4c19 100644
--- a/srcpkgs/gnome-builder/template
+++ b/srcpkgs/gnome-builder/template
@@ -1,13 +1,13 @@
 # Template file for 'gnome-builder'
 pkgname=gnome-builder
 version=44.1
-revision=5
+revision=6
 build_style=meson
 build_helper=qemu
 configure_args="-Dhelp=true -Dnetwork_tests=false"
 hostmakedepends="pkg-config appstream-glib desktop-file-utils flex gobject-introspection
- llvm mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
-makedepends="cairo-devel clang enchant2-devel flatpak-devel
+ mm-common vala python3-Sphinx python3-sphinx_rtd_theme gettext"
+makedepends="llvm17-devel cairo-devel clang enchant2-devel flatpak-devel
  gtksourceview5-devel gtk4-devel json-glib-devel jsonrpc-glib-devel
  libgit2-glib-devel libglib-devel libostree-devel libpeas-devel
  libxml2-devel template-glib-devel vala-devel vte3-gtk4-devel libwebkitgtk60-devel

From 826470e152d9410cdb58420d02bc84b7e688bda2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:03:19 -0400
Subject: [PATCH 16/32] include-what-you-use: update to 0.20.

---
 srcpkgs/include-what-you-use/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2db..ee12c0ee51d88 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,17 +1,17 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.19
+version=0.20
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"
-makedepends="clang clang-tools-extra llvm ncurses-devel zlib-devel"
+makedepends="clang clang-tools-extra llvm17-devel ncurses-devel zlib-devel"
 short_desc="Analyze #includes in C and C++ source files"
 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=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
+checksum=75fce1e6485f280f8f13f4c2d090b11d2fd2102b50857507c8413a919b7af899
 python_version=3
 
 post_install() {

From 61baf5bde4ffe86ee0dc73856c293b38af36e77f Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 19:05:52 -0400
Subject: [PATCH 17/32] juCi++: rebuild for llvm17

---
 srcpkgs/juCi++/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index 4cb4644663800..94c8a7e7cfbcd 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,13 +1,13 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=6
+revision=7
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes
 build_style=cmake
 hostmakedepends="pkg-config"
-makedepends="aspell-devel clang boost-devel gtksourceviewmm-devel libgit2-devel"
+makedepends="aspell-devel clang-devel boost-devel gtksourceviewmm-devel libgit2-devel"
 depends="ctags"
 short_desc="Lightweight IDE supporting the most recent C++ standards"
 maintainer="rc-05 <rc23@email.it>"

From 69a073eb120aa7aa6d912d50e95cf336833f6096 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:27:29 -0400
Subject: [PATCH 18/32] kdevelop: update to 23.08.4.

---
 common/shlibs             | 32 ++++++++++++++++----------------
 srcpkgs/kdevelop/template | 12 ++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e2e94ee5a86fc..9940702fbc2e1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2612,22 +2612,22 @@ libvidstab.so.1.1 libvidstab-1.1.0_1
 libxdo.so.3 xdotool-3.20150503.1_1
 libabigail.so.3 libabigail-2.4_1
 libgnome-games-support-1.so.3 libgnome-games-support-1.4.0_1
-libKDevCMakeCommon.so.510 kdevelop-22.12.1_1
-libKDevClangPrivate.so.510 kdevelop-22.12.1_1
-libKDevCompileAnalyzerCommon.so.510 kdevelop-22.12.1_1
-libKDevelopSessionsWatch.so.510 kdevelop-22.12.1_1
-libKDevPlatformDebugger.so.510 kdevelop-22.12.1_1
-libKDevPlatformDocumentation.so.510 kdevelop-22.12.1_1
-libKDevPlatformInterfaces.so.510 kdevelop-22.12.1_1
-libKDevPlatformLanguage.so.510 kdevelop-22.12.1_1
-libKDevPlatformOutputView.so.510 kdevelop-22.12.1_1
-libKDevPlatformProject.so.510 kdevelop-22.12.1_1
-libKDevPlatformSerialization.so.510 kdevelop-22.12.1_1
-libKDevPlatformShell.so.510 kdevelop-22.12.1_1
-libKDevPlatformSublime.so.510 kdevelop-22.12.1_1
-libKDevPlatformTests.so.510 kdevelop-22.12.1_1
-libKDevPlatformUtil.so.510 kdevelop-22.12.1_1
-libKDevPlatformVcs.so.510 kdevelop-22.12.1_1
+libKDevCMakeCommon.so.512 kdevelop-23.08.2_1
+libKDevClangPrivate.so.512 kdevelop-23.08.2_1
+libKDevCompileAnalyzerCommon.so.512 kdevelop-23.08.2_1
+libKDevelopSessionsWatch.so.512 kdevelop-23.08.2_1
+libKDevPlatformDebugger.so.512 kdevelop-23.08.2_1
+libKDevPlatformDocumentation.so.512 kdevelop-23.08.2_1
+libKDevPlatformInterfaces.so.512 kdevelop-23.08.2_1
+libKDevPlatformLanguage.so.512 kdevelop-23.08.2_1
+libKDevPlatformOutputView.so.512 kdevelop-23.08.2_1
+libKDevPlatformProject.so.512 kdevelop-23.08.2_1
+libKDevPlatformSerialization.so.512 kdevelop-23.08.2_1
+libKDevPlatformShell.so.512 kdevelop-23.08.2_1
+libKDevPlatformSublime.so.512 kdevelop-23.08.2_1
+libKDevPlatformTests.so.512 kdevelop-23.08.2_1
+libKDevPlatformUtil.so.512 kdevelop-23.08.2_1
+libKDevPlatformVcs.so.512 kdevelop-23.08.2_1
 libts.so.0 tslib-1.6_1
 libobs.so.0 obs-0.14.1_2
 libobsglad.so.1 obs-28.0.1_1
diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index b2c63eb78151a..4b8f41f90bb03 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,15 +1,15 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools
- kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext llvm tar which"
-makedepends="apr-util-devel clang grantlee5-devel kcmutils-devel kdevelop-pg-qt
+ kcmutils kcoreaddons kdevelop-pg-qt plasma-framework gettext tar which"
+makedepends="apr-util-devel llvm17-devel grantlee5-devel kcmutils-devel kdevelop-pg-qt
  kitemmodels-devel knewstuff-devel knotifyconfig-devel krunner-devel
  ktexteditor-devel libkomparediff2-devel libksysguard-devel okteta-devel
- purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel
+ purpose-devel qt5-location-devel qt5-webchannel-devel subversion-devel clang-tools-extra
  qt5-devel $(vopt_if webengine 'qt5-webengine-devel' 'qt5-webkit-devel')"
 # khelpcenter is required to display documentation
 depends="khelpcenter"
@@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdevelop"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdevelop-${version}.tar.xz"
-checksum=57f85e5eb1be0ae71d3440304c985fff2be03aab02de367535568ccef7c25ec9
+checksum=91d02b2bce8f29113054ccc548e6416d94065cf79919c54075bad19599357af0
 
 build_options="webengine"
 desc_option_webengine="Use Qt5 WebEngine for documentation"

From 0b206a6006858593cf2815a2c810fc79ac7e540c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:35:06 -0400
Subject: [PATCH 19/32] kdevelop-php: update to 23.08.4.

---
 srcpkgs/kdevelop-php/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/kdevelop-php/template b/srcpkgs/kdevelop-php/template
index 7df97b8d78845..4f3bafe2356d0 100644
--- a/srcpkgs/kdevelop-php/template
+++ b/srcpkgs/kdevelop-php/template
@@ -1,6 +1,6 @@
 # Template file for 'kdevelop-php'
 pkgname=kdevelop-php
-version=22.12.2
+version=23.08.4
 revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
@@ -15,4 +15,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-php"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-php-${version}.tar.xz"
-checksum=0df5bdebfffe72cc4ae5bc842418ac30908fbaa4ae5c8762a9c4ad361c3e42b7
+checksum=20c097ff322db3d69a57d45980161ed1d72020a95fc52feb46d3fc38ba340fd0

From 5d1b673ff4946dfd1133d318f0ae0bb5960defe9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:36:53 -0400
Subject: [PATCH 20/32] kdevelop-python: update to 23.08.4.

---
 srcpkgs/kdevelop-python/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kdevelop-python/template b/srcpkgs/kdevelop-python/template
index 0f0b8a6ec0671..e3d86278ffe63 100644
--- a/srcpkgs/kdevelop-python/template
+++ b/srcpkgs/kdevelop-python/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop-python'
 pkgname=kdevelop-python
-version=22.12.2
-revision=2
+version=23.08.4
+revision=1
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 pycompile_dirs="usr/share/kdevpythonsupport"
@@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://www.kdevelop.org/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdev-python"
 distfiles="${KDE_SITE}/release-service/${version}/src/kdev-python-${version}.tar.xz"
-checksum=2521f2f2a7174dfb2bf1d962c460d40addc3bb486e9823c2b2707ced33456430
+checksum=a36ec94c241714c0c1f5787bafa2381c5d4ec20a3e3696bed70d13b1bd49b293
 python_version=3
 
 post_install() {

From 0f3eab75604433c1e965ec02c1ba2393748d681b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 20:56:42 -0400
Subject: [PATCH 21/32] ldc: Rebuild with old llvm15

---
 common/shlibs        | 4 ----
 srcpkgs/ldc/template | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 9940702fbc2e1..98b830eea0285 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2147,10 +2147,6 @@ libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
 libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libFcitx5Qt6DBusAddons.so.1 fcitx5-qt6-5.1.4_1
 libFcitx5Qt6WidgetsAddons.so.2 fcitx5-qt6-5.1.4_1
-libdruntime-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libphobos2-ldc-shared.so.105 ldc-runtime-1.35.0_1
-libdruntime-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.0_1
-libphobos2-ldc-debug-shared.so.105 ldc-runtime-debug-1.35.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/template b/srcpkgs/ldc/template
index f6d8b7ffbe985..533d6c70d3758 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

From bff88911fed2923cb7ce842d6da86ed70e7f2422 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:06:14 -0400
Subject: [PATCH 22/32] qt6-tools: rebuild for llvm17

---
 srcpkgs/qt6-tools/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index 3f430540ed68a..358f58a282a76 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,19 +1,19 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.6.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON
  -DQT_FEATURE_pixeltool=ON
  -DQT_FEATURE_distancefieldgenerator=ON"
-hostmakedepends="qt6-base perl qt6-plugin-sqlite clang llvm clang-tools-extra
+hostmakedepends="qt6-base perl qt6-plugin-sqlite clang clang-tools-extra
  qt6-declarative-host-tools"
 makedepends="qt6-base-devel qt6-plugin-sqlite qt6-declarative-devel
- gumbo-parser-devel icu-devel llvm clang-tools-extra"
+ gumbo-parser-devel icu-devel llvm17-devel clang-tools-extra"
 short_desc="Cross-platform application and UI framework (QT6) - qt6-tools component"
 maintainer="John <me@johnnynator.dev>"
-license="GPL-3.0-only with Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
+license="custom:GPL-3.0-only-with-Qt-GPL-exception-1.0, LGPL-3.0-only, GPL-2.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz"
 checksum=4e9feebc142bbb6e453e1dc3277e09ec45c8ef081b5ee2a029e6684b5905ba99
@@ -28,6 +28,10 @@ if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DQT_BUILD_TESTS=ON"
 fi
 
+post_install() {
+	vlicense LICENSES/Qt-GPL-exception-1.0.txt
+}
+
 #post_build() {
 #	ninja -C build ${makejobs} lib/qt6/libexec/qhelpgenerator
 #}

From 39f1b2aff026d32de768af2229bd3c41d639bf44 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:08:10 -0400
Subject: [PATCH 23/32] rtags: rebuild for llvm17

---
 srcpkgs/rtags/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index 9b161e690d767..baa6f8c54f69f 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,12 +1,12 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=6
+revision=7
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"
 hostmakedepends="pkg-config clang"
-makedepends="llvm openssl-devel zlib-devel"
+makedepends="llvm17-devel openssl-devel zlib-devel"
 checkdepends="perl python3-PyHamcrest python3-nose"
 short_desc="C/C++ indexer with integration for Emacs based on clang"
 maintainer="Alexander Egorenkov <egorenar-dev@posteo.net>"

From 08045d74cb289dd9ea01bfaf1e3e7a47bea662c5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 21:11:23 -0400
Subject: [PATCH 24/32] shiboken2: rebuild for llvm17

---
 srcpkgs/shiboken2/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 883d6a084d868..d0a38c63d9eef 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,12 +1,12 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
 version=5.15.10
-revision=1
+revision=2
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
 hostmakedepends="python3-devel python3-setuptools"
-makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang libxml2-devel
+makedepends="python3-devel qt5-devel qt5-xmlpatterns-devel clang17-devel libxml2-devel
  libxslt-devel python3-numpy"
 depends="clang"
 short_desc="Python binding generator of Qt5 C++ API"

From 09e398601b466b441a1ce80afba8e18cc0c1d1cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 Nov 2023 22:04:24 -0400
Subject: [PATCH 25/32] zig: Build against old llvm15 packages

---
 srcpkgs/zig/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index ca201c50131d3..52cda7e8e0cee 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,14 +1,14 @@
 # Template file for 'zig'
 pkgname=zig
 version=0.10.1
-revision=2
+revision=3
 archs="x86_64* aarch64*"
 build_style=cmake
 configure_args="-DZIG_TARGET_MCPU=baseline"
 make_cmd=make
 # 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"
+makedepends="clang15 llvm15 lld15-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"

From 50c39216ac2dc9cfb694dac6f929b0185e0864f4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 9 Jan 2024 00:03:41 -0500
Subject: [PATCH 26/32] libclc: update to 17.0.6.

---
 srcpkgs/libclc/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 2fc397a56f2ca..fa0807f9ace69 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,19 +1,20 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=15.0.7
+version=17.0.6
 revision=1
 build_style=cmake
 # 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="clang llvm python3 libedit-devel libffi-devel
+hostmakedepends="clang17 llvm17-devel python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
+makedepends="llvm17-devel"
 short_desc="Open implementation of the OpenCL C programming language"
 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=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
+checksum=122f641d94d5dfbb3c37534f2b76612fa59d15c36c2a4917369a85eaaca32148
 replaces="libclc-git>=0"
 
 do_configure() {

From 07b855d4a5d0feddec5db3943f69d60f670314a4 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 10 Jan 2024 14:50:49 -0500
Subject: [PATCH 27/32] qtcreator: update to 12.0.1.

---
 srcpkgs/qtcreator/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index c9ff18781412b..dd7b342439838 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,16 +1,16 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
-version=12.0.0
+version=12.0.1
 revision=1
 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
+hostmakedepends="clang perl pkg-config python3 which
  qt6-base qt6-tools qtchooser qt6-shadertools qt6-declarative-host-tools"
 makedepends="qt6-declarative-devel
  qt6-quick3d-devel qt6-svg-devel qt6-plugin-odbc qt6-plugin-sqlite
  qt6-plugin-pgsql qt6-plugin-mysql qt6-qt5compat-devel
  qt6-serialport-devel
- clang llvm clang-tools-extra"
+ clang llvm17-devel clang-tools-extra"
 depends="qt6-plugin-sqlite mesa-dri"
 short_desc="Cross-platform IDE for Qt developers"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -18,7 +18,7 @@ license="LGPL-3.0-or-later, custom:QtCompany-GPL-Exception-1.0"
 homepage="https://wiki.qt.io/Category:Tools::QtCreator"
 changelog="https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changelog/changes-${version}.md"
 distfiles="https://download.qt.io/official_releases/qtcreator/${version%.*}/${version}/qt-creator-opensource-src-${version}.tar.xz"
-checksum=399ae0dcefa3bd9e01a3f068b93dabe8b39f9b56466c389d1446e5c84c8f7b9f
+checksum=66fb92c2ced092829e3321c5a0911e2de98309d0310e7ab949a39a50238e03f3
 replaces="qtcreator-data>=0"
 python_version=3
 

From f392e2fe6ce6b407f7bb073fb53fc09944eb4323 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:34 -0500
Subject: [PATCH 28/32] bcc: Rebuild against llvm17

---
 srcpkgs/bcc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 644eb378abe7c..579d276874ad2 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,11 +1,11 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.29.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"
-makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm
+makedepends="clang clang-tools-extra elfutils-devel flex lld-devel llvm17-devel
  ncurses-devel python3-devel zlib-devel"
 short_desc="BPF-based Linux IO analysis, networking, monitoring, and more"
 maintainer="Leah Neukirchen <leah@vuxu.org>"

From 6ba087d6eae9cb174256695b103ad54efb217209 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 31 Jan 2024 22:40:55 -0500
Subject: [PATCH 29/32] ispc: Rebuild against llvm17

---
 srcpkgs/ispc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index aab387ad2c41d..9c748a6506deb 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,12 +1,12 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.22.0
-revision=1
+revision=2
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-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"
+hostmakedepends="clang clang-tools-extra python3 m4 bison flex"
+makedepends="llvm17-devel 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"

From b16695eeac0b4c806481153c7dfef9a6938d7b7e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:36:38 -0500
Subject: [PATCH 30/32] ghc: Rebuild against llvm17

---
 srcpkgs/ghc/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/ghc/template b/srcpkgs/ghc/template
index 189d4131c50d5..1f52ca7b438ec 100644
--- a/srcpkgs/ghc/template
+++ b/srcpkgs/ghc/template
@@ -2,7 +2,7 @@
 pkgname=ghc
 # Keep this synchronized with http://www.stackage.org/lts
 version=9.0.2
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake docbook-xsl ghc-bin libxslt libnuma-devel
  ncurses-devel python3-Sphinx python3-setuptools"
@@ -56,8 +56,8 @@ fi
 case "$XBPS_TARGET_MACHINE" in
 aarch64*)
 	# GHC uses LLVM to generate code on aarch64
-	hostmakedepends+=" llvm"
-	depends+=" llvm"
+	hostmakedepends+=" llvm17-devel"
+	depends+=" llvm17-devel"
 	;;
 esac
 

From faa908427d054d1bcf6b1b01c9001d5504575d33 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 07:51:51 -0500
Subject: [PATCH 31/32] faust: update to 2.70.3.

---
 srcpkgs/faust/patches/cstdint.patch                  | 12 ++++++++++++
 .../patches/faust-voidlinux-lib_and_arch_paths.patch |  4 ++--
 srcpkgs/faust/template                               |  6 +++---
 3 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/faust/patches/cstdint.patch

diff --git a/srcpkgs/faust/patches/cstdint.patch b/srcpkgs/faust/patches/cstdint.patch
new file mode 100644
index 0000000000000..b2358719a4168
--- /dev/null
+++ b/srcpkgs/faust/patches/cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/generator/Text.hh b/compiler/generator/Text.hh
+index 47ca2a7be..8fad938ea 100644
+--- a/compiler/generator/Text.hh
++++ b/compiler/generator/Text.hh
+@@ -31,6 +31,7 @@
+ #include <string>
+ #include <vector>
+ #include <cmath>
++#include <cstdint>
+ 
+ std::string subst(const std::string& m, const std::string& a0);
+ std::string subst(const std::string& m, const std::vector<std::string>& vargs);
diff --git a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
index 3587fc639e67e..dca3779bab40e 100644
--- a/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
+++ b/srcpkgs/faust/patches/faust-voidlinux-lib_and_arch_paths.patch
@@ -1,11 +1,11 @@
 --- a/compiler/global.cpp-orig	2023-09-09 10:38:02.642030383 +0000
 +++ b/compiler/global.cpp	2023-09-09 10:41:55.199049192 +0000
-@@ -1679,6 +1679,7 @@ void global::initDirectories(int argc, c
+@@ -1711,6 +1711,7 @@ void global::initDirectories(int argc, const char* argv[])
      gImportDirList.push_back(exepath::dirup(gFaustExeDir) + "/share/faust");
      gImportDirList.push_back("/usr/local/share/faust");
      gImportDirList.push_back("/usr/share/faust");
 +    gImportDirList.push_back("/usr/lib/faust");
-     
+ 
      //-------------------------------------------------------------------------------------
      // init gArchitectureDirList : a list of path where to search architectures files
 @@ -1697,6 +1698,7 @@ void global::initDirectories(int argc, c
diff --git a/srcpkgs/faust/template b/srcpkgs/faust/template
index 8ac95644e5e88..53534571f7118 100644
--- a/srcpkgs/faust/template
+++ b/srcpkgs/faust/template
@@ -1,16 +1,16 @@
 # Template file for 'faust'
 pkgname=faust
-version=2.60.3
+version=2.70.3
 revision=1
 build_style=gnu-makefile
-hostmakedepends="cmake pkg-config llvm which"
+hostmakedepends="cmake pkg-config which"
 makedepends="libmicrohttpd-devel llvm-libunwind-devel"
 short_desc="Functional Programming Language for Real Time Signal Processing"
 maintainer="mag <mag-one@autistici.org>"
 license="GPL-2.0-or-later"
 homepage="https://faust.grame.fr/"
 distfiles="https://github.com/grame-cncm/faust/releases/download/${version}/faust-${version}.tar.gz"
-checksum="1088b31ad2a6175ff27807afc33c5929c33e97a7d09a1995e126bdda9940fc1e"
+checksum=3ac3aab87d60257b3fff03ffeb42e190480fb9828266fa1c35574b6cbf6a13bb
 
 # Android stuffs, used by the 'faust2android' script.
 nostrip_files="libsndfile.so libsndfile.a "

From 34aeacf6c78bc8f0ea0ae2f2a5711032b3ba66ec Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 1 Feb 2024 14:13:59 -0500
Subject: [PATCH 32/32] imhex: Build with llvm15

---
 srcpkgs/imhex/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/imhex/template b/srcpkgs/imhex/template
index 3a9ad2d42be11..72af581ce9d12 100644
--- a/srcpkgs/imhex/template
+++ b/srcpkgs/imhex/template
@@ -1,7 +1,7 @@
 # Template file for 'imhex'
 pkgname=imhex
 version=1.30.1
-revision=2
+revision=3
 build_wrksrc="ImHex"
 build_style=cmake
 build_helper=qemu
@@ -9,7 +9,7 @@ configure_args="-DIMHEX_OFFLINE_BUILD=ON -DIMHEX_STRIP_RELEASE=OFF
  -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_LLVM=ON -DUSE_SYSTEM_CAPSTONE=ON
  -DUSE_SYSTEM_YARA=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON -DIMHEX_DISABLE_UPDATE_CHECK=ON"
 hostmakedepends="pkg-config clang-tools-extra"
-makedepends="libcurl-devel fmt-devel llvm jansson-devel yara-devel json-c++
+makedepends="libcurl-devel fmt-devel llvm15 jansson-devel yara-devel json-c++
  freetype-devel glfw-devel gtk+3-devel python3-devel file-devel mbedtls-devel
  clang-tools-extra capstone-devel"
 short_desc="Hex editor for reverse engineers and programmers"

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (114 preceding siblings ...)
  2024-02-08  0:17 ` Calandracas606
@ 2024-02-08 21:40 ` dkwo
  2024-02-08 21:47 ` dkwo
                   ` (2 subsequent siblings)
  118 siblings, 0 replies; 120+ messages in thread
From: dkwo @ 2024-02-08 21:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1934976450

Comment:
@Duncaen could you double check this shlibs?
`libclang-cpp.so.15 libclang-cpp-15.0.7_1`
it seems the builders are rebuilding llvm twice (from aarch64_builder):
```
> llvm-17_1: running post-pkg hook: 00-register-pkg ...
=> Registering new packages to /host/binpkgs
Inconsistent shlibs:
  libclang-cpp.so.15 (provided by: libclang-cpp; used by: CastXML, bcc, ccls, clazy, include-what-you-use, mesa-opencl, qt6-tools)
```
and then
```
=> SPIRV-LLVM-Translator-17.0.0_1: building with [cmake] for armv6l-musl...
   [host] clang-17_1: not found
   [host] llvm-17_1: not found
```

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (115 preceding siblings ...)
  2024-02-08 21:40 ` dkwo
@ 2024-02-08 21:47 ` dkwo
  2024-02-12  3:49 ` Calandracas606
  2024-02-12 13:13 ` [PR PATCH] [Closed]: " leahneukirchen
  118 siblings, 0 replies; 120+ messages in thread
From: dkwo @ 2024-02-08 21:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1934985376

Comment:
nevermind, it's due to crosscompilation.

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (116 preceding siblings ...)
  2024-02-08 21:47 ` dkwo
@ 2024-02-12  3:49 ` Calandracas606
  2024-02-12 13:13 ` [PR PATCH] [Closed]: " leahneukirchen
  118 siblings, 0 replies; 120+ messages in thread
From: Calandracas606 @ 2024-02-12  3:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/46935#issuecomment-1938031018

Comment:
I think this is completed and can be closed

^ permalink raw reply	[flat|nested] 120+ messages in thread

* Re: [PR PATCH] [Closed]: New package: llvm17
  2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
                   ` (117 preceding siblings ...)
  2024-02-12  3:49 ` Calandracas606
@ 2024-02-12 13:13 ` leahneukirchen
  118 siblings, 0 replies; 120+ messages in thread
From: leahneukirchen @ 2024-02-12 13:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

There's a closed pull request on the void-packages repository

New package: llvm17
https://github.com/void-linux/void-packages/pull/46935

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
Additional builds:
- x86_64
- aarch64-musl (cross)
- aarch64 (cross)
- i686
- armv6l-musl (cross)

[ci skip]

^ permalink raw reply	[flat|nested] 120+ messages in thread

end of thread, other threads:[~2024-02-12 13:13 UTC | newest]

Thread overview: 120+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-28  1:03 [PR PATCH] WIP: New package: llvm17 Calandracas606
2023-10-28  1:20 ` [PR PATCH] [Updated] " Calandracas606
2023-10-28  1:29 ` [PR REVIEW] " Calandracas606
2023-10-28  1:29 ` Calandracas606
2023-10-28  1:29 ` Calandracas606
2023-10-28  1:29 ` Calandracas606
2023-10-28  1:29 ` Calandracas606
2023-10-28  1:29 ` Calandracas606
2023-10-28 17:34 ` [WIP] " Calandracas606
2023-10-28 22:20 ` [PR REVIEW] " mhmdanas
2023-10-29 14:50 ` sh1r4s3
2023-10-29 14:53 ` sh1r4s3
2023-10-29 14:56 ` [PR PATCH] [Updated] " Calandracas606
2023-10-29 14:57 ` [PR REVIEW] " Calandracas606
2023-10-29 15:00 ` Calandracas606
2023-10-29 15:05 ` Calandracas606
2023-10-29 17:47 ` Calandracas606
2023-10-31  3:33 ` [PR PATCH] [Updated] " Calandracas606
2023-10-31 14:48 ` Calandracas606
2023-10-31 14:49 ` Calandracas606
2023-10-31 14:50 ` [PR PATCH] [Updated] " Calandracas606
2023-10-31 14:52 ` [PR REVIEW] " Calandracas606
2023-10-31 14:52 ` Calandracas606
2023-10-31 19:17 ` [PR PATCH] [Updated] " Calandracas606
2023-10-31 20:09 ` [PR REVIEW] " Calandracas606
2023-10-31 20:09 ` Calandracas606
2023-10-31 20:09 ` Calandracas606
2023-11-02 15:37 ` [PR PATCH] [Updated] " Calandracas606
2023-11-03  2:53 ` Calandracas606
2023-11-03  2:59 ` [PR REVIEW] " Calandracas606
2023-11-03  3:14 ` [PR PATCH] [Updated] " Calandracas606
2023-11-03  3:18 ` Calandracas606
2023-11-03 13:03 ` Calandracas606
2023-11-03 15:11 ` Calandracas606
2023-11-03 19:18 ` [PR REVIEW] " Calandracas606
2023-11-03 19:18 ` Calandracas606
2023-11-03 20:48 ` [PR PATCH] [Updated] " Calandracas606
2023-11-03 21:49 ` Calandracas606
2023-11-03 22:51 ` Calandracas606
2023-11-04  2:04 ` Calandracas606
2023-11-04  2:20 ` [PR REVIEW] " Calandracas606
2023-11-04  2:23 ` Calandracas606
2023-11-05  2:47 ` Calandracas606
2023-11-05 15:49 ` Calandracas606
2023-11-07 18:33 ` [PR PATCH] [Updated] " Calandracas606
2023-11-07 18:37 ` [PR REVIEW] " Calandracas606
2023-11-07 20:45 ` [PR PATCH] [Updated] " Calandracas606
2023-11-16 13:34 ` [PR REVIEW] " ahesford
2023-11-16 16:33 ` Calandracas606
2023-11-16 20:52 ` tranzystorekk
2023-12-02 23:43 ` [PR PATCH] [Updated] " Calandracas606
2023-12-03  1:49 ` sbromberger
2023-12-03 13:36 ` sbromberger
2023-12-03 13:37 ` sbromberger
2023-12-03 18:45 ` [PR PATCH] [Updated] " Calandracas606
2023-12-06  3:38 ` Calandracas606
2023-12-06 18:38 ` Calandracas606
2023-12-07  0:48 ` Calandracas606
2023-12-08  4:12 ` Calandracas606
2023-12-12 17:29 ` Calandracas606
2023-12-16 19:01 ` Calandracas606
2023-12-16 19:39 ` Calandracas606
2023-12-17  0:29 ` Calandracas606
2023-12-26 16:34 ` Calandracas606
2023-12-31  3:58 ` Calandracas606
2024-01-03 21:22 ` Calandracas606
2024-01-03 21:24 ` Calandracas606
2024-01-08 13:37 ` [PR PATCH] [Updated] " Calandracas606
2024-01-09  5:08 ` Calandracas606
2024-01-09  5:14 ` sbromberger
2024-01-09  5:59 ` Calandracas606
2024-01-09  6:00 ` Calandracas606
2024-01-10  3:31 ` [PR PATCH] [Updated] " Calandracas606
2024-01-10 19:51 ` Calandracas606
2024-01-11 12:27 ` Luciogi
2024-01-11 12:39 ` [PR PATCH] [Updated] " Calandracas606
2024-01-11 12:40 ` Calandracas606
2024-01-11 13:02 ` Calandracas606
2024-01-12 13:07 ` Luciogi
2024-01-12 13:07 ` Luciogi
2024-01-12 13:23 ` Calandracas606
2024-01-16 19:43 ` [PR REVIEW] " Calandracas606
2024-01-17 16:30 ` Luciogi
2024-01-17 16:30 ` Luciogi
2024-01-17 17:09 ` Calandracas606
2024-01-26  0:03 ` [PR PATCH] [Updated] " Calandracas606
2024-01-26  0:06 ` Calandracas606
2024-01-30 13:23 ` [PR PATCH] [Updated] " Calandracas606
2024-01-30 13:26 ` Calandracas606
2024-01-30 22:17 ` Calandracas606
2024-01-30 22:18 ` Calandracas606
2024-01-31  2:35 ` [PR PATCH] [Updated] " Calandracas606
2024-01-31  3:01 ` Calandracas606
2024-01-31  4:50 ` [PR PATCH] [Updated] " Calandracas606
2024-01-31 17:38 ` Calandracas606
2024-01-31 20:58 ` Calandracas606
2024-01-31 21:42 ` Calandracas606
2024-02-01  3:41 ` Calandracas606
2024-02-01  4:01 ` Calandracas606
2024-02-01 17:39 ` [PR PATCH] [Updated] " Calandracas606
2024-02-01 17:49 ` Calandracas606
2024-02-01 20:43 ` Calandracas606
2024-02-01 20:58 ` Calandracas606
2024-02-01 22:52 ` [PR PATCH] [Updated] " Calandracas606
2024-02-01 23:03 ` Calandracas606
2024-02-02  4:14 ` Calandracas606
2024-02-02  4:15 ` Calandracas606
2024-02-02  5:00 ` [PR PATCH] [Updated] " Calandracas606
2024-02-03 19:42 ` Calandracas606
2024-02-03 19:45 ` Calandracas606
2024-02-05 23:33 ` Calandracas606
2024-02-07 15:38 ` Calandracas606
2024-02-07 23:54 ` Calandracas606
2024-02-08  0:02 ` Calandracas606
2024-02-08  0:05 ` Calandracas606
2024-02-08  0:17 ` Calandracas606
2024-02-08 21:40 ` dkwo
2024-02-08 21:47 ` dkwo
2024-02-12  3:49 ` Calandracas606
2024-02-12 13:13 ` [PR PATCH] [Closed]: " leahneukirchen

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).