Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] Rust 1.67
@ 2023-02-07 14:55 tranzystorek-io
  2023-02-07 14:58 ` tranzystorek-io
                   ` (30 more replies)
  0 siblings, 31 replies; 32+ messages in thread
From: tranzystorek-io @ 2023-02-07 14:55 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages rust
https://github.com/void-linux/void-packages/pull/42130

[WIP] Rust 1.67
[ci skip]

TODO:

- [ ] Generate boostrap packages for ppc

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

<!-- 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, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

From 34d7c81e1cfc10e4d106ca997b8b25dc9f284e5a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/23] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From d7e40e38e90b7f69c1a2820063e74f834e109146 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/23] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From f59eb3db469084ec15e196ddf4fab1ed746fa4c1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 5 Feb 2023 14:04:51 +0100
Subject: [PATCH 18/23] rust-bootstrap: update to 1.67.0

---
 srcpkgs/rust-bootstrap/template | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/srcpkgs/rust-bootstrap/template b/srcpkgs/rust-bootstrap/template
index 539a4097ef3c..98126556d74e 100644
--- a/srcpkgs/rust-bootstrap/template
+++ b/srcpkgs/rust-bootstrap/template
@@ -1,8 +1,7 @@
 # Template file for 'rust-bootstrap'
 pkgname=rust-bootstrap
-version=1.64.0
+version=1.67.0
 revision=1
-create_wrksrc=yes
 short_desc="Rust programming language bootstrap toolchain"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, Apache-2.0"
@@ -32,32 +31,32 @@ case "$XBPS_TARGET_MACHINE" in
 		 ${_bootstrap_url}/rustc-${version}-i686-unknown-linux-gnu.tar.xz
 		 ${_bootstrap_url}/rust-std-${version}-i686-unknown-linux-gnu.tar.xz"
 		checksum="
-		 3d604e150c469461a64c17b6d26f96a5a3d6975246c92cd13ee9bc6e4df0aaeb
-		 c80c57df63517d6171c061e6c095b794593172a3abefa9b4202992706bda12e5"
+		 3ddb41e82dbae4aee0a60c9595bd93ca74a94747dc57d439357f2a8ea1a78483
+		 080ce3fa7f5b84d900be5842a52053345a40d6dd77b20bcac016eb2083a9a59d"
 		;;
 	x86_64)
 		distfiles="
 		 ${_bootstrap_url}/rustc-${version}-x86_64-unknown-linux-gnu.tar.xz
 		 ${_bootstrap_url}/rust-std-${version}-x86_64-unknown-linux-gnu.tar.xz"
 		checksum="
-		 1f5756a03119853b53358018c5b1592940a2354c3c9f84ee7faf684e3478f8f0
-		 6ace34bcbba9557aa2fc3a0515c3da4a83ca24d7d45506c5e1b32f589fa38a8b"
+		 7a9c5890f8b573cd0c584b590b86eb02c38c00b9c3ba74b21917ba97d1fa3d12
+		 8f03b271bba56b0245833f2cb08044865068ce8721d6a736d3ef7056aa109daa"
 		;;
 	x86_64-musl)
 		distfiles="
 		 ${_bootstrap_url}/rustc-${version}-x86_64-unknown-linux-musl.tar.xz
 		 ${_bootstrap_url}/rust-std-${version}-x86_64-unknown-linux-musl.tar.xz"
 		checksum="
-		 5177d749b5dcc74596e314b73c5f3f3eabed8b3e207f812f229fbf0682c162ae
-		 29af13a882abbe797fadd43afcb75bce2e2304438db9e21a3e64a2e9100501fb"
+		 0d138515e48d504df9c08d62a25851f053601a7bcc870fda65b5c9db7407d185
+		 33f320dc4ae075f720f541564868e494c17dea97ea853507225f89f8b0c57363"
 		;;
 	ppc64le)
 		distfiles="
 		 ${_bootstrap_url}/rustc-${version}-powerpc64le-unknown-linux-gnu.tar.xz
 		 ${_bootstrap_url}/rust-std-${version}-powerpc64le-unknown-linux-gnu.tar.xz"
 		checksum="
-		 11630fc51fffe722e52f649357b5948c24b5305cfb61a8114527234e054451c4
-		 ef697469b2a3ea8897f49b70e3be0c7aaca3f26fd3234812113e2e85cafac738"
+		 9f2d0820761533159ca72d319d8331692112e72fc009a7275ad8d7ab99aa3d24
+		 ec92fa64616c67785039bebabc213e6bae6ffc2744ef052b79c7960df60b257f"
 		;;
 	ppc64le-musl)
 		distfiles="
@@ -80,8 +79,8 @@ case "$XBPS_TARGET_MACHINE" in
 		 ${_bootstrap_url}/rustc-${version}-powerpc-unknown-linux-gnu.tar.xz
 		 ${_bootstrap_url}/rust-std-${version}-powerpc-unknown-linux-gnu.tar.xz"
 		checksum="
-		 5f4de96bff2937fc0a64a216604c7af765af94460a1f283330eddc610d91271b
-		 6b29ebec4cd705760db634717cf6df68a9a377d52c25def30f5a2e2641a83279"
+		 8b315ba9b0a41472893ad69cdfcafd1bd48b20d74a85b3fe00a809bf0c2c44e9
+		 44b700068e9e40a01418e537b5c0f4ee279995b55ee6d6266409f057ead1c6de"
 		;;
 	*) broken="rust bootstrap binaries unavailable for ${XBPS_TARGET_MACHINE}";;
 esac

From 17565e0a21c515fe8b00d774d51d0a41c26e1be2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 5 Feb 2023 14:06:47 +0100
Subject: [PATCH 19/23] cargo-bootstrap: update to 1.67.0

---
 srcpkgs/cargo-bootstrap/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/cargo-bootstrap/template b/srcpkgs/cargo-bootstrap/template
index 9da646a63ade..22a87c3c16ba 100644
--- a/srcpkgs/cargo-bootstrap/template
+++ b/srcpkgs/cargo-bootstrap/template
@@ -1,6 +1,6 @@
 # Template file for 'cargo-bootstrap'
 pkgname=cargo-bootstrap
-version=1.64.0
+version=1.67.0
 revision=1
 short_desc="Bootstrap binaries of Rust package manager"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -28,19 +28,19 @@ esac
 case "$XBPS_TARGET_MACHINE" in
 	i686)
 		distfiles="${_bootstrap_url}/cargo-${version}-i686-unknown-linux-gnu.tar.xz"
-		checksum="e2e20a16f5db52cd6b773c94225b03880743544ff2f317dd857cf0dceac6ab57"
+		checksum="9fb7194424c2c1e64b6ae2045e65472dcd098c522cc454de9b3f77a86961d715"
 		;;
 	x86_64)
 		distfiles="${_bootstrap_url}/cargo-${version}-x86_64-unknown-linux-gnu.tar.xz"
-		checksum="21434d83a30ad3fa4e4831487c5574a20b07dd57d213b26e1246290c57d4ec41"
+		checksum="7ddc4f7027653b4366037206ef438c704513c1565ce6eb2422d9d47146782c3b"
 		;;
 	x86_64-musl)
 		distfiles="${_bootstrap_url}/cargo-${version}-x86_64-unknown-linux-musl.tar.xz"
-		checksum="01d06176fd894b9299ed4f5b78e87d78a9a25b9ba803d3f8c50b7a4ea21d8807"
+		checksum="3e9e53ee6d377d4c1250b9aa7be8dbb185a3a9ddbc7e8381d456fbb19cc85fa1"
 		;;
 	ppc64le)
 		distfiles="${_bootstrap_url}/cargo-${version}-powerpc64le-unknown-linux-gnu.tar.xz"
-		checksum="ba7188b2c7890e61bf58d3aa9e94c323fec375f67cf03841bbcc0f6c800fe6ad"
+		checksum="cd477026ba03f678eb909bb678509ab18cb01583d69efd3b6ef146b6949aac4b"
 		;;
 	ppc64le-musl)
 		distfiles="${_bootstrap_url}/cargo-${version}-powerpc64le-unknown-linux-musl.tar.xz"

From 9ebab86bde3274325c37d30d7ce42bc7ae5e27f8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 5 Feb 2023 14:11:22 +0100
Subject: [PATCH 20/23] rust: update to 1.67.0

---
 ...dlib-and-musl_root-from-musl-targets.patch | 93 +++++++------------
 ...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 41 +-------
 ...le-initial-exec-TLS-model-on-powerpc.patch | 19 +---
 ...tch => 0015-initial-ppcle-port.patch.skip} |  0
 .../0016-bootstrap-fix-unsoundness.patch      | 38 ++++++++
 srcpkgs/rust/template                         |  8 +-
 6 files changed, 82 insertions(+), 117 deletions(-)
 rename srcpkgs/rust/patches/{0015-initial-ppcle-port.patch => 0015-initial-ppcle-port.patch.skip} (100%)
 create mode 100644 srcpkgs/rust/patches/0016-bootstrap-fix-unsoundness.patch

diff --git a/srcpkgs/rust/patches/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch b/srcpkgs/rust/patches/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch
index c156945b8111..c84c1c4f483d 100644
--- a/srcpkgs/rust/patches/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch
+++ b/srcpkgs/rust/patches/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch
@@ -1,30 +1,12 @@
-From 7219ba1c9accbad9b530d312fd9a9f69330c93da Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel@sholland.org>
-Date: Sun, 3 May 2020 17:53:33 +0200
-Subject: [PATCH 02/15] Remove -nostdlib and musl_root from musl targets
-
-extended by various void contributors to match our musl setup
----
- compiler/rustc_target/src/spec/crt_objects.rs | 22 ----------
- .../rustc_target/src/spec/linux_musl_base.rs  |  7 ---
- config.toml.example                           |  8 ----
- src/bootstrap/cc_detect.rs                    | 25 +----------
- src/bootstrap/compile.rs                      | 43 +------------------
- src/bootstrap/config.rs                       |  9 ----
- src/bootstrap/configure.py                    | 28 ------------
- src/bootstrap/lib.rs                          | 19 --------
- src/bootstrap/sanity.rs                       | 23 ----------
- 9 files changed, 3 insertions(+), 181 deletions(-)
-
 diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
-index 52ac3622e..f35e5b9d8 100644
+index c126390f5..7aef73d3b 100644
 --- a/compiler/rustc_target/src/spec/crt_objects.rs
 +++ b/compiler/rustc_target/src/spec/crt_objects.rs
 @@ -63,28 +63,6 @@ pub(super) fn all(obj: &'static str) -> CrtObjects {
      ])
  }
  
--pub(super) fn pre_musl_fallback() -> CrtObjects {
+-pub(super) fn pre_musl_self_contained() -> CrtObjects {
 -    new(&[
 -        (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
 -        (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o", "crtbeginS.o"]),
@@ -35,7 +17,7 @@ index 52ac3622e..f35e5b9d8 100644
 -    ])
 -}
 -
--pub(super) fn post_musl_fallback() -> CrtObjects {
+-pub(super) fn post_musl_self_contained() -> CrtObjects {
 -    new(&[
 -        (LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]),
 -        (LinkOutputKind::DynamicPicExe, &["crtendS.o", "crtn.o"]),
@@ -46,24 +28,24 @@ index 52ac3622e..f35e5b9d8 100644
 -    ])
 -}
 -
- pub(super) fn pre_mingw_fallback() -> CrtObjects {
+ pub(super) fn pre_mingw_self_contained() -> CrtObjects {
      new(&[
          (LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]),
 diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs
-index 207a87ab0..88f807a58 100644
+index 61553e71b..88f807a58 100644
 --- a/compiler/rustc_target/src/spec/linux_musl_base.rs
 +++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
 @@ -1,16 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
+-use crate::spec::crt_objects::{self, LinkSelfContainedDefault};
  use crate::spec::TargetOptions;
  
  pub fn opts() -> TargetOptions {
      let mut base = super::linux_base::opts();
  
      base.env = "musl".into();
--    base.pre_link_objects_fallback = crt_objects::pre_musl_fallback();
--    base.post_link_objects_fallback = crt_objects::post_musl_fallback();
--    base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
+-    base.pre_link_objects_self_contained = crt_objects::pre_musl_self_contained();
+-    base.post_link_objects_self_contained = crt_objects::post_musl_self_contained();
+-    base.link_self_contained = LinkSelfContainedDefault::Musl;
 -
 -    // These targets statically link libc by default
 -    base.crt_static_default = true;
@@ -71,11 +53,11 @@ index 207a87ab0..88f807a58 100644
      base
  }
 diff --git a/config.toml.example b/config.toml.example
-index b3284050f..62ac07f87 100644
+index ca54cbd2d..beec9bb04 100644
 --- a/config.toml.example
 +++ b/config.toml.example
-@@ -523,14 +523,6 @@ changelog-seen = 2
- # supplementary build information, like distro-specific package versions.
+@@ -540,14 +540,6 @@ changelog-seen = 2
+ # behavior -- this may lead to miscompilations or other bugs.
  #description = <none> (string)
  
 -# The root location of the musl installation directory. The library directory
@@ -90,10 +72,10 @@ index b3284050f..62ac07f87 100644
  # platforms to ensure that the compiler is usable by default from the build
  # directory (as it links to a number of dynamic libraries). This may not be
 diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs
-index dca782c29..8eb35ea43 100644
+index 7128d542a..668245f3c 100644
 --- a/src/bootstrap/cc_detect.rs
 +++ b/src/bootstrap/cc_detect.rs
-@@ -97,7 +97,7 @@ pub fn find(build: &mut Build) {
+@@ -101,7 +101,7 @@ pub fn find(build: &mut Build) {
          if let Some(cc) = config.and_then(|c| c.cc.as_ref()) {
              cfg.compiler(cc);
          } else {
@@ -102,7 +84,7 @@ index dca782c29..8eb35ea43 100644
          }
  
          let compiler = cfg.get_compiler();
-@@ -125,7 +125,7 @@ pub fn find(build: &mut Build) {
+@@ -122,7 +122,7 @@ pub fn find(build: &mut Build) {
              cfg.compiler(cxx);
              true
          } else if build.hosts.contains(&target) || build.build == target {
@@ -111,7 +93,7 @@ index dca782c29..8eb35ea43 100644
              true
          } else {
              // Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars).
-@@ -161,7 +161,6 @@ fn set_compiler(
+@@ -158,7 +158,6 @@ fn set_compiler(
      compiler: Language,
      target: TargetSelection,
      config: Option<&Target>,
@@ -119,7 +101,7 @@ index dca782c29..8eb35ea43 100644
  ) {
      match &*target.triple {
          // When compiling for android we may have the NDK configured in the
-@@ -204,26 +203,6 @@ fn set_compiler(
+@@ -194,26 +193,6 @@ fn set_compiler(
              }
          }
  
@@ -147,10 +129,10 @@ index dca782c29..8eb35ea43 100644
      }
  }
 diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
-index b4807d1ab..ce483bf6b 100644
+index 0deed3f99..0bddac5d1 100644
 --- a/src/bootstrap/compile.rs
 +++ b/src/bootstrap/compile.rs
-@@ -200,39 +200,7 @@ fn copy_self_contained_objects(
+@@ -228,39 +228,7 @@ fn copy_self_contained_objects(
      let mut target_deps = vec![];
  
      // Copies the libc and CRT objects.
@@ -191,7 +173,7 @@ index b4807d1ab..ce483bf6b 100644
          let srcdir = builder
              .wasi_root(target)
              .unwrap_or_else(|| {
-@@ -316,15 +284,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
+@@ -344,15 +312,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
              .arg("--manifest-path")
              .arg(builder.src.join("library/test/Cargo.toml"));
  
@@ -208,10 +190,10 @@ index b4807d1ab..ce483bf6b 100644
              if let Some(p) = builder.wasi_root(target) {
                  let root = format!("native={}/lib/wasm32-wasi", p.to_str().unwrap());
 diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
-index 146077419..18a764689 100644
+index d8c15c76e..53f95e49b 100644
 --- a/src/bootstrap/config.rs
 +++ b/src/bootstrap/config.rs
-@@ -186,7 +186,6 @@ pub struct Config {
+@@ -200,7 +200,6 @@ pub struct Config {
      pub missing_tools: bool,
  
      // Fallback musl-root for all targets
@@ -219,7 +201,7 @@ index 146077419..18a764689 100644
      pub prefix: Option<PathBuf>,
      pub sysconfdir: Option<PathBuf>,
      pub datadir: Option<PathBuf>,
-@@ -400,8 +399,6 @@ pub struct Target {
+@@ -440,8 +439,6 @@ pub struct Target {
      pub sanitizers: Option<bool>,
      pub profiler: Option<bool>,
      pub crt_static: Option<bool>,
@@ -228,7 +210,7 @@ index 146077419..18a764689 100644
      pub wasi_root: Option<PathBuf>,
      pub qemu_rootfs: Option<PathBuf>,
      pub no_std: bool,
-@@ -689,7 +686,6 @@ define_config! {
+@@ -734,7 +731,6 @@ define_config! {
          default_linker: Option<String> = "default-linker",
          channel: Option<String> = "channel",
          description: Option<String> = "description",
@@ -236,7 +218,7 @@ index 146077419..18a764689 100644
          rpath: Option<bool> = "rpath",
          verbose_tests: Option<bool> = "verbose-tests",
          optimize_tests: Option<bool> = "optimize-tests",
-@@ -734,8 +730,6 @@ define_config! {
+@@ -781,8 +777,6 @@ define_config! {
          sanitizers: Option<bool> = "sanitizers",
          profiler: Option<bool> = "profiler",
          crt_static: Option<bool> = "crt-static",
@@ -245,7 +227,7 @@ index 146077419..18a764689 100644
          wasi_root: Option<String> = "wasi-root",
          qemu_rootfs: Option<String> = "qemu-rootfs",
          no_std: Option<bool> = "no-std",
-@@ -1107,7 +1101,6 @@ impl Config {
+@@ -1187,7 +1181,6 @@ impl Config {
              set(&mut config.llvm_tools_enabled, rust.llvm_tools);
              config.rustc_parallel = rust.parallel_compiler.unwrap_or(false);
              config.rustc_default_linker = rust.default_linker;
@@ -253,7 +235,7 @@ index 146077419..18a764689 100644
              config.save_toolstates = rust.save_toolstates.map(PathBuf::from);
              set(&mut config.deny_warnings, flags.deny_warnings.or(rust.deny_warnings));
              set(&mut config.backtrace_on_ice, rust.backtrace_on_ice);
-@@ -1164,8 +1157,6 @@ impl Config {
+@@ -1251,8 +1244,6 @@ impl Config {
                  target.ranlib = cfg.ranlib.map(PathBuf::from);
                  target.linker = cfg.linker.map(PathBuf::from);
                  target.crt_static = cfg.crt_static;
@@ -263,10 +245,10 @@ index 146077419..18a764689 100644
                  target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from);
                  target.sanitizers = cfg.sanitizers;
 diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
-index 2fc036082..91737e0ea 100755
+index 6b139decb..a2e19b8f4 100755
 --- a/src/bootstrap/configure.py
 +++ b/src/bootstrap/configure.py
-@@ -114,34 +114,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
+@@ -112,34 +112,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
    "aarch64-linux-android NDK standalone path")
  v("x86_64-linux-android-ndk", "target.x86_64-linux-android.android-ndk",
    "x86_64-linux-android NDK standalone path")
@@ -302,10 +284,10 @@ index 2fc036082..91737e0ea 100755
    "rootfs in qemu testing, you probably don't want to use this")
  v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs",
 diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
-index b603ae90a..0a7012dbd 100644
+index 3ed534523..c7c7a75f0 100644
 --- a/src/bootstrap/lib.rs
 +++ b/src/bootstrap/lib.rs
-@@ -1153,25 +1153,6 @@ impl Build {
+@@ -1181,25 +1181,6 @@ impl Build {
          }
      }
  
@@ -332,7 +314,7 @@ index b603ae90a..0a7012dbd 100644
      fn wasi_root(&self, target: TargetSelection) -> Option<&Path> {
          self.config.target_config.get(&target).and_then(|t| t.wasi_root.as_ref()).map(|p| &**p)
 diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
-index 64c5dd7ae..b8f9104ea 100644
+index 8a40b0f64..59e11d304 100644
 --- a/src/bootstrap/sanity.rs
 +++ b/src/bootstrap/sanity.rs
 @@ -11,7 +11,6 @@
@@ -343,7 +325,7 @@ index 64c5dd7ae..b8f9104ea 100644
  use std::path::PathBuf;
  use std::process::Command;
  
-@@ -190,28 +189,6 @@ than building it.
+@@ -205,28 +204,6 @@ than building it.
              }
          }
  
@@ -369,9 +351,6 @@ index 64c5dd7ae..b8f9104ea 100644
 -            }
 -        }
 -
-         if need_cmake && target.contains("msvc") {
-             // There are three builds of cmake on windows: MSVC, MinGW, and
-             // Cygwin. The Cygwin build does not have generators for Visual
--- 
-2.37.2
-
+         // Some environments don't want or need these tools, such as when testing Miri.
+         // FIXME: it would be better to refactor this code to split necessary setup from pure sanity
+         // checks, and have a regular flag for skipping the latter. Also see
diff --git a/srcpkgs/rust/patches/0011-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0011-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index 347ee613983d..3813cc0d97c7 100644
--- a/srcpkgs/rust/patches/0011-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0011-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -1,19 +1,5 @@
-From de93abe8a0d9dc7878a48f61b9e3ae4a923020f6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 18:08:09 +0200
-Subject: [PATCH 11/15] Use ELFv2 ABI on all powerpc64 targets
-
-This patches librustc_target so that ELFv2 is used everywhere, matching our
-LLVM. While this is not perfect (it does not allow rustc to compile legacy
-binaries), rustc never requests specific ABI from llvm in the first place,
-so at least match the environment we have.
----
- compiler/rustc_target/src/abi/call/powerpc64.rs          | 9 +--------
- .../rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
- 2 files changed, 2 insertions(+), 13 deletions(-)
-
 diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
-index c22ef9c8f..932172b2f 100644
+index 359bb8fc0..414c70cea 100644
 --- a/compiler/rustc_target/src/abi/call/powerpc64.rs
 +++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
 @@ -119,14 +119,7 @@ where
@@ -32,28 +18,3 @@ index c22ef9c8f..932172b2f 100644
  
      if !fn_abi.ret.is_ignore() {
          classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-index 24d5d187e..aa594b02e 100644
---- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,5 +1,5 @@
- use crate::abi::Endian;
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions};
- 
- pub fn target() -> Target {
-     let mut base = super::linux_gnu_base::opts();
-@@ -7,10 +7,6 @@ pub fn target() -> Target {
-     base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m64".into());
-     base.max_atomic_width = Some(64);
- 
--    // ld.so in at least RHEL6 on ppc64 has a bug related to BIND_NOW, so only enable partial RELRO
--    // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
--    base.relro_level = RelroLevel::Partial;
--
-     Target {
-         llvm_target: "powerpc64-unknown-linux-gnu".into(),
-         pointer_width: 64,
--- 
-2.37.2
-
diff --git a/srcpkgs/rust/patches/0012-bootstrap-Disable-initial-exec-TLS-model-on-powerpc.patch b/srcpkgs/rust/patches/0012-bootstrap-Disable-initial-exec-TLS-model-on-powerpc.patch
index 7b1ba46b1f2b..1ca8871d0066 100644
--- a/srcpkgs/rust/patches/0012-bootstrap-Disable-initial-exec-TLS-model-on-powerpc.patch
+++ b/srcpkgs/rust/patches/0012-bootstrap-Disable-initial-exec-TLS-model-on-powerpc.patch
@@ -1,26 +1,13 @@
-From 4b803b211f765f6c6b18223e23670dbf754a980f Mon Sep 17 00:00:00 2001
-From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
-Date: Sat, 29 May 2021 12:38:46 +0000
-Subject: [PATCH 12/15] bootstrap: Disable initial-exec TLS model on powerpc
-
-Fixes #81334.
----
- src/bootstrap/builder.rs | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
 diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
-index 554dd4188..6a02a225c 100644
+index 8b144f146..acfa7cf04 100644
 --- a/src/bootstrap/builder.rs
 +++ b/src/bootstrap/builder.rs
-@@ -1844,7 +1844,7 @@ impl<'a> Builder<'a> {
+@@ -1856,7 +1856,7 @@ impl<'a> Builder<'a> {
          // efficient initial-exec TLS model. This doesn't work with `dlopen`,
          // so we can't use it by default in general, but we can use it for tools
          // and our own internal libraries.
 -        if !mode.must_support_dlopen() && !target.triple.starts_with("powerpc-") {
 +        if !mode.must_support_dlopen() && !target.triple.starts_with("powerpc-") && !target.triple.starts_with("powerpcle-") {
-             rustflags.arg("-Ztls-model=initial-exec");
+             cargo.env("RUSTC_TLS_MODEL_INITIAL_EXEC", "1");
          }
  
--- 
-2.37.2
-
diff --git a/srcpkgs/rust/patches/0015-initial-ppcle-port.patch b/srcpkgs/rust/patches/0015-initial-ppcle-port.patch.skip
similarity index 100%
rename from srcpkgs/rust/patches/0015-initial-ppcle-port.patch
rename to srcpkgs/rust/patches/0015-initial-ppcle-port.patch.skip
diff --git a/srcpkgs/rust/patches/0016-bootstrap-fix-unsoundness.patch b/srcpkgs/rust/patches/0016-bootstrap-fix-unsoundness.patch
new file mode 100644
index 000000000000..eb160661a2c2
--- /dev/null
+++ b/srcpkgs/rust/patches/0016-bootstrap-fix-unsoundness.patch
@@ -0,0 +1,38 @@
+From 675fa0b3dd5fe14b43ad5b7862f4528df7322468 Mon Sep 17 00:00:00 2001
+From: Michael Goulet <michael@errs.io>
+Date: Mon, 12 Dec 2022 18:29:33 +0000
+Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20fix=20unsoundness=20in=20bootstr?=
+ =?UTF-8?q?ap=20cache=20code?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+ src/bootstrap/cache.rs | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs
+index be5c9bb078808..05f25af68ea8f 100644
+--- a/src/bootstrap/cache.rs
++++ b/src/bootstrap/cache.rs
+@@ -89,16 +89,16 @@ impl<T: Internable + Hash> Hash for Interned<T> {
+ 
+ impl<T: Internable + Deref> Deref for Interned<T> {
+     type Target = T::Target;
+-    fn deref(&self) -> &'static Self::Target {
++    fn deref(&self) -> &Self::Target {
+         let l = T::intern_cache().lock().unwrap();
+-        unsafe { mem::transmute::<&Self::Target, &'static Self::Target>(l.get(*self)) }
++        unsafe { mem::transmute::<&Self::Target, &Self::Target>(l.get(*self)) }
+     }
+ }
+ 
+ impl<T: Internable + AsRef<U>, U: ?Sized> AsRef<U> for Interned<T> {
+-    fn as_ref(&self) -> &'static U {
++    fn as_ref(&self) -> &U {
+         let l = T::intern_cache().lock().unwrap();
+-        unsafe { mem::transmute::<&U, &'static U>(l.get(*self).as_ref()) }
++        unsafe { mem::transmute::<&U, &U>(l.get(*self).as_ref()) }
+     }
+ }
+ 
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 8e639c486470..36a11c1ba507 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -8,17 +8,17 @@
 # uploaded to https://repo-default.voidlinux.org/distfiles/
 #
 pkgname=rust
-version=1.64.0
+version=1.67.0
 revision=1
 hostmakedepends="cmake curl pkg-config python3 tar cargo-bootstrap"
-makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm12"
+makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm15"
 depends="rust-std"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT, Apache-2.0"
 homepage="https://www.rust-lang.org/"
 distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum=b3cd9f481e1a2901bf6f3808d30c69cc4ea80d93c4cc4e2ed52258b180381205
+checksum=d029f14fce45a2ec7a9a605d2a0a40aae4739cb2fdae29ee9f7a6e9025a7fde4
 lib32disabled=yes
 make_check=no # CBA for now
 
@@ -33,7 +33,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm12"
+	hostmakedepends+=" rust llvm15"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From ae6cd3f9ab017f978aa07d6cc0b2b1a6520ddc82 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 5 Feb 2023 14:14:16 +0100
Subject: [PATCH 21/23] cargo: update to 1.67.0

---
 srcpkgs/cargo/patches/crossbeam-ppcle.patch | 11 ---------
 srcpkgs/cargo/template                      | 25 ++++-----------------
 2 files changed, 4 insertions(+), 32 deletions(-)
 delete mode 100644 srcpkgs/cargo/patches/crossbeam-ppcle.patch

diff --git a/srcpkgs/cargo/patches/crossbeam-ppcle.patch b/srcpkgs/cargo/patches/crossbeam-ppcle.patch
deleted file mode 100644
index 36d9256e1071..000000000000
--- a/srcpkgs/cargo/patches/crossbeam-ppcle.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/crossbeam-utils/no_atomic.rs
-+++ b/crossbeam-utils/no_atomic.rs
-@@ -33,6 +33,8 @@ const NO_ATOMIC_64: &[&str] = &[
-     "powerpc-unknown-linux-gnu",
-     "powerpc-unknown-linux-gnuspe",
-     "powerpc-unknown-linux-musl",
-+    "powerpcle-unknown-linux-gnu",
-+    "powerpcle-unknown-linux-musl",
-     "powerpc-unknown-netbsd",
-     "powerpc-unknown-openbsd",
-     "powerpc-wrs-vxworks",
diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template
index e557bbe20805..dd22ccc18c79 100644
--- a/srcpkgs/cargo/template
+++ b/srcpkgs/cargo/template
@@ -1,8 +1,8 @@
 # Template file for 'cargo'
 pkgname=cargo
-version=1.64.0
+version=1.67.0
 revision=1
-create_wrksrc=yes
+_cargo_revision=0.68.0
 build_helper=rust
 hostmakedepends="cargo-bootstrap rust python3 curl cmake pkg-config zlib-devel"
 makedepends="rust libcurl-devel openssl-devel"
@@ -11,10 +11,8 @@ short_desc="Rust package manager"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT, Apache-2.0"
 homepage="https://crates.io/"
-distfiles="https://github.com/rust-lang/cargo/archive/rust-${version}.tar.gz
- https://github.com/crossbeam-rs/crossbeam/archive/refs/tags/crossbeam-utils-0.8.8.tar.gz"
-checksum="8363ee37e1ff85c7322f0619087b1230f43852dcb26316627a1a703ed20ea4b7
- 52c451910203cd9002cc4b85cff95f45c6ba245392801e80d7898ca5c3c3ab29"
+distfiles="https://github.com/rust-lang/cargo/archive/refs/tags/${_cargo_revision}.tar.gz"
+checksum=b60b794dfdca61dfad106dbbb9c7c2c077c1a4bd505b90988057be5fd1ae99b7
 replaces="cargo-tree>=0"
 
 build_options="static bindist"
@@ -28,21 +26,6 @@ if [ -z "$_build_static" ]; then
 	makedepends+=" libgit2-devel"
 fi
 
-post_extract() {
-	mv cargo-rust-${version}/* .
-	mv crossbeam-crossbeam-utils-* crossbeam-utils
-}
-
-post_patch() {
-	rm crossbeam-utils/crossbeam-utils/no_atomic.rs
-	cp crossbeam-utils/no_atomic.rs crossbeam-utils/crossbeam-utils
-
-	cat >> Cargo.toml <<- EOF
-		[patch.crates-io]
-		crossbeam-utils = { path = './crossbeam-utils/crossbeam-utils' }
-	EOF
-}
-
 do_build() {
 	local cargs
 

From 5d7264ad56fa6c787c4464f9f31418c13882a619 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 5 Feb 2023 14:15:20 +0100
Subject: [PATCH 22/23] cargo-auditable-bootstrap: rebuild for rust 1.67

---
 srcpkgs/cargo-auditable-bootstrap/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cargo-auditable-bootstrap/template b/srcpkgs/cargo-auditable-bootstrap/template
index 4efd32137b91..43f861a36f3a 100644
--- a/srcpkgs/cargo-auditable-bootstrap/template
+++ b/srcpkgs/cargo-auditable-bootstrap/template
@@ -2,7 +2,7 @@
 # Keep synced with cargo-auditable
 pkgname=cargo-auditable-bootstrap
 version=0.6.0
-revision=1
+revision=2
 build_wrksrc=cargo-auditable
 build_style=cargo
 # Required for bootstrapping purposes

From 72b25cf5bb702cd3b351d9f6bf94e5b19426c084 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 5 Feb 2023 14:16:29 +0100
Subject: [PATCH 23/23] cargo-auditable: rebuild for rust 1.67

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

diff --git a/srcpkgs/cargo-auditable/template b/srcpkgs/cargo-auditable/template
index d9302394725b..17780db11a5a 100644
--- a/srcpkgs/cargo-auditable/template
+++ b/srcpkgs/cargo-auditable/template
@@ -2,7 +2,7 @@
 # Keep synced with cargo-auditable-bootstrap
 pkgname=cargo-auditable
 version=0.6.0
-revision=1
+revision=2
 build_wrksrc=cargo-auditable
 build_style=cargo
 hostmakedepends="cargo-auditable-bootstrap"

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

end of thread, other threads:[~2023-04-02  5:35 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 14:55 [PR PATCH] [WIP] Rust 1.67 tranzystorek-io
2023-02-07 14:58 ` tranzystorek-io
2023-02-10 15:29 ` [PR PATCH] [Updated] " tranzystorek-io
2023-02-10 16:44 ` tranzystorek-io
2023-02-10 19:24 ` tranzystorek-io
2023-02-15 16:24 ` tranzystorek-io
2023-02-15 17:19 ` tranzystorek-io
2023-02-15 17:30 ` tranzystorek-io
2023-02-20 16:30 ` tranzystorek-io
2023-02-22 19:48 ` tranzystorek-io
2023-03-10 16:18 ` tranzystorek-io
2023-03-18 17:17 ` [PR PATCH] [Updated] [WIP] Rust 1.68 tranzystorek-io
2023-03-28 12:56 ` tranzystorek-io
2023-03-29 10:33 ` tranzystorek-io
2023-03-29 14:20 ` tranzystorek-io
2023-03-29 14:25 ` tranzystorek-io
2023-03-31 20:32 ` [PR PATCH] [Updated] " tranzystorek-io
2023-04-01  7:41 ` tranzystorek-io
2023-04-01  9:57 ` tranzystorek-io
2023-04-01 11:09 ` tranzystorek-io
2023-04-01 11:10 ` tranzystorek-io
2023-04-01 16:48 ` [PR PATCH] [Updated] " tranzystorek-io
2023-04-01 16:50 ` tranzystorek-io
2023-04-01 16:51 ` tranzystorek-io
2023-04-01 17:36 ` [PR REVIEW] " classabbyamp
2023-04-01 17:36 ` classabbyamp
2023-04-01 17:36 ` classabbyamp
2023-04-01 17:36 ` classabbyamp
2023-04-01 17:36 ` classabbyamp
2023-04-01 20:23 ` [PR PATCH] [Updated] " tranzystorek-io
2023-04-02  0:26 ` tranzystorek-io
2023-04-02  5:35 ` [PR PATCH] [Merged]: " classabbyamp

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).