Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] llvm-17, multiple version of llvm to co-exist.
@ 2024-01-28 15:29 sgn
  2024-01-28 15:35 ` classabbyamp
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sgn @ 2024-01-28 15:29 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages llvm-multi-version
https://github.com/void-linux/void-packages/pull/48404

llvm-17, multiple version of llvm to co-exist.
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

<!--
#### 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/48404.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm-multi-version-48404.patch --]
[-- Type: text/x-diff, Size: 80856 bytes --]

From 6a963271f6c0909dc26c91097f136046d4dfb5ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Jan 2024 22:27:12 +0700
Subject: [PATCH 1/3] New package: python3-sphinx-markdown-tables-0.0.17

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

diff --git a/srcpkgs/python3-sphinx-markdown-tables/template b/srcpkgs/python3-sphinx-markdown-tables/template
new file mode 100644
index 0000000000000..4771d47f81461
--- /dev/null
+++ b/srcpkgs/python3-sphinx-markdown-tables/template
@@ -0,0 +1,14 @@
+# Template file for 'python3-sphinx-markdown-tables'
+pkgname=python3-sphinx-markdown-tables
+version=0.0.17
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-Markdown"
+makedepends=""
+depends="python3-Markdown"
+short_desc="Sphinx extension for rendering tables written in markdown"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ryanfox/sphinx-markdown-tables"
+distfiles="${PYPI_SITE}/s/sphinx-markdown-tables/sphinx-markdown-tables-${version}.tar.gz"
+checksum=6bc6d3d400eaccfeebd288446bc08dd83083367c58b85d40fe6c12d77ef592f1

From 0021fca204ccbde959df10c926224f08bb642b2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sat, 27 Jan 2024 23:39:34 +0700
Subject: [PATCH 2/3] llvm15: versioning

---
 srcpkgs/llvm15/patches/0001-tools-path.patch  |  28 ++++
 .../llvm15/patches/clang-006-version.patch    | 141 ++++++++++++++++++
 .../patches/clang-007-version-define.patch    |  48 ++++++
 srcpkgs/llvm15/template                       |   1 +
 4 files changed, 218 insertions(+)
 create mode 100644 srcpkgs/llvm15/patches/0001-tools-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-006-version.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-007-version-define.patch

diff --git a/srcpkgs/llvm15/patches/0001-tools-path.patch b/srcpkgs/llvm15/patches/0001-tools-path.patch
new file mode 100644
index 0000000000000..879d68bdf30be
--- /dev/null
+++ b/srcpkgs/llvm15/patches/0001-tools-path.patch
@@ -0,0 +1,28 @@
+From: Peter Wu <peter@lekensteyn.nl>
+Date: Fri, 4 May 2018 15:55:26 +0200
+Subject: [PATCH] [clang] cmake: resolve symlinks in ClangConfig.cmake
+
+Ensure that symlinks such as /usr/lib/cmake/clang-X.Y (pointing to
+/usr/lib/llvm-X.Y/lib/cmake/llvm) are resolved. This ensures that
+CLANG_INSTALL_PREFIX ends up to be /usr/lib/llvm-X.Y instead of /usr.
+
+Partially addresses PR37128
+---
+ cmake/modules/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/cmake/Modules/FindPrefixFromConfig.cmake
++++ b/cmake/Modules/FindPrefixFromConfig.cmake
+@@ -39,10 +39,10 @@ function(find_prefix_from_config out_var
+     # install prefix, and avoid hard-coding any absolute paths.
+     set(config_code
+       "# Compute the installation prefix from this LLVMConfig.cmake file location."
+-      "get_filename_component(${prefix_var} \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
++      "get_filename_component(${prefix_var} \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)")
+     # Construct the proper number of get_filename_component(... PATH)
+     # calls to compute the installation prefix.
+-    string(REGEX REPLACE "/" ";" _count "${path_to_leave}")
++    string(REGEX REPLACE "/" ";" _count "prefix/${path_to_leave}")
+     foreach(p ${_count})
+       list(APPEND config_code
+         "get_filename_component(${prefix_var} \"\${${prefix_var}}\" PATH)")
diff --git a/srcpkgs/llvm15/patches/clang-006-version.patch b/srcpkgs/llvm15/patches/clang-006-version.patch
new file mode 100644
index 0000000000000..60b5fcdec11f6
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-006-version.patch
@@ -0,0 +1,141 @@
+--- a/clang/tools/scan-build/libexec/ccc-analyzer
++++ b/clang/tools/scan-build/libexec/ccc-analyzer
+@@ -93,7 +93,7 @@ if ($FindBin::Script =~ /c\+\+-analyzer/
+   if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler))) { $Compiler = $DefaultCXXCompiler; }
+ 
+   $Clang = $ENV{'CLANG_CXX'};
+-  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang++'; }
++  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang++-15'; }
+ 
+   $IsCXX = 1
+ }
+@@ -102,7 +102,7 @@ else {
+   if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler))) { $Compiler = $DefaultCCompiler; }
+ 
+   $Clang = $ENV{'CLANG'};
+-  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang'; }
++  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang-15'; }
+ 
+   $IsCXX = 0
+ }
+--- a/clang/tools/scan-build/bin/scan-build
++++ b/clang/tools/scan-build/bin/scan-build
+@@ -1486,7 +1486,7 @@ sub FindClang {
+   if (!defined $Options{AnalyzerDiscoveryMethod}) {
+     $Clang = Cwd::realpath("$RealBin/bin/clang") if (-f "$RealBin/bin/clang");
+     if (!defined $Clang || ! -x $Clang) {
+-      $Clang = Cwd::realpath("$RealBin/clang") if (-f "$RealBin/clang");
++      $Clang = Cwd::realpath("/usr/lib/llvm15/bin/clang");
+       if (!defined $Clang || ! -x $Clang) {
+         # When an Xcode toolchain is present, look for a clang in the sibling bin
+         # of the parent of the bin directory. So if scan-build is at
+--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
++++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
+@@ -121,7 +121,7 @@ def main():
+                                    'output diagnostics only for modified '
+                                    'lines.')
+   parser.add_argument('-clang-tidy-binary', metavar='PATH',
+-                      default='clang-tidy',
++                      default='clang-tidy-15',
+                       help='path to clang-tidy binary')
+   parser.add_argument('-p', metavar='NUM', default=0,
+                       help='strip the smallest prefix containing P slashes')
+--- a/clang/tools/clang-format/git-clang-format
++++ b/clang/tools/clang-format/git-clang-format
+@@ -104,7 +104,7 @@ def main():
+     usage=usage, formatter_class=argparse.RawDescriptionHelpFormatter,
+     description=desc)
+   p.add_argument('--binary',
+-                 default=config.get('clangformat.binary', 'clang-format'),
++                 default=config.get('clangformat.binary', 'clang-format-15'),
+                  help='path to clang-format'),
+   p.add_argument('--commit',
+                  default=config.get('clangformat.commit', 'HEAD'),
+--- a/clang/tools/scan-build-py/lib/libscanbuild/arguments.py
++++ b/clang/tools/scan-build-py/lib/libscanbuild/arguments.py
+@@ -266,7 +266,7 @@ def create_analyze_parser(from_build_com
+         '--use-analyzer',
+         metavar='<path>',
+         dest='clang',
+-        default='clang',
++        default='clang-15',
+         help="""'%(prog)s' uses the 'clang' executable relative to itself for
+         static analysis. One can override this behavior with this option by
+         using the 'clang' packaged with Xcode (on OS X) or from the PATH.""")
+@@ -413,7 +413,7 @@ def create_analyze_parser(from_build_com
+             '--use-extdef-map-cmd',
+             metavar='<path>',
+             dest='extdef_map_cmd',
+-            default='clang-extdef-mapping',
++            default='clang-extdef-mapping-15',
+             help="""'%(prog)s' uses the 'clang-extdef-mapping' executable
+             relative to itself for generating external definition maps for
+             static analysis. One can override this behavior with this option
+--- a/llvm/tools/llvm-shlib/gen-msvc-exports.py
++++ b/llvm/tools/llvm-shlib/gen-msvc-exports.py
+@@ -94,7 +94,7 @@ def main():
+         action='store_true'
+     )
+     parser.add_argument(
+-        '--nm', help='path to the llvm-nm executable', default='llvm-nm'
++        '--nm', help='path to the llvm-nm executable', default='llvm-nm-15'
+     )
+     parser.add_argument(
+         'libs', metavar='LIBS', nargs='*', help='list of libraries to generate export from'
+--- a/clang/tools/clang-format/clang-format-diff.py
++++ b/clang/tools/clang-format/clang-format-diff.py
+@@ -63,7 +63,7 @@ def main():
+                       'fallback in case clang-format is invoked with'
+                       '-style=file, but can not find the .clang-format'
+                       'file to use.')
+-  parser.add_argument('-binary', default='clang-format',
++  parser.add_argument('-binary', default='clang-format-15',
+                       help='location of binary to use for clang-format')
+   args = parser.parse_args()
+ 
+--- a/clang/tools/clang-format/clang-format.el
++++ b/clang/tools/clang-format/clang-format.el
+@@ -37,7 +37,7 @@
+   :group 'tools)
+ 
+ (defcustom clang-format-executable
+-  (or (executable-find "clang-format")
++  (or (executable-find "clang-format-15")
+       "clang-format")
+   "Location of the clang-format executable.
+ 
+--- a/clang/tools/clang-format/clang-format.py
++++ b/clang/tools/clang-format/clang-format.py
+@@ -48,7 +48,7 @@ import vim
+ 
+ # set g:clang_format_path to the path to clang-format if it is not on the path
+ # Change this to the full path if clang-format is not on the path.
+-binary = 'clang-format'
++binary = 'clang-format-15'
+ if vim.eval('exists("g:clang_format_path")') == "1":
+   binary = vim.eval('g:clang_format_path')
+ 
+--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
++++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+@@ -226,8 +226,10 @@ def main():
+                       action='store_true', help='allow alpha checkers from '
+                                                 'clang-analyzer.')
+   parser.add_argument('-clang-tidy-binary', metavar='PATH',
++                      default='clang-tidy-15',
+                       help='path to clang-tidy binary')
+   parser.add_argument('-clang-apply-replacements-binary', metavar='PATH',
++                      default='clang-apply-replacements-15',
+                       help='path to clang-apply-replacements binary')
+   parser.add_argument('-checks', default=None,
+                       help='checks filter, when not specified, use clang-tidy '
+--- a/clang/bindings/python/clang/cindex.py
++++ b/clang/bindings/python/clang/cindex.py
+@@ -4162,7 +4162,7 @@ class Config(object):
+         elif name == 'Windows':
+             file = 'libclang.dll'
+         else:
+-            file = 'libclang.so'
++            file = 'libclang-15.so'
+ 
+         if Config.library_path:
+             file = Config.library_path + '/' + file
diff --git a/srcpkgs/llvm15/patches/clang-007-version-define.patch b/srcpkgs/llvm15/patches/clang-007-version-define.patch
new file mode 100644
index 0000000000000..f8545d54f9d09
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-007-version-define.patch
@@ -0,0 +1,48 @@
+--- a/compiler-rt/lib/sanitizer_common/CMakeLists.txt
++++ b/compiler-rt/lib/sanitizer_common/CMakeLists.txt
+@@ -203,6 +203,7 @@ set(SANITIZER_IMPL_HEADERS
+   )
+ 
+ include_directories(..)
++include_directories(${LLVM_INCLUDE_DIR})
+ 
+ set(SANITIZER_COMMON_DEFINITIONS
+   HAVE_RPC_XDR_H=${HAVE_RPC_XDR_H})
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
+@@ -25,6 +25,7 @@
+ #include "sanitizer_symbolizer_internal.h"
+ #include "sanitizer_symbolizer_libbacktrace.h"
+ #include "sanitizer_symbolizer_mac.h"
++#include "llvm/Config/llvm-config.h"
+ 
+ #include <dlfcn.h>   // for dlsym()
+ #include <errno.h>
+@@ -451,7 +452,7 @@ static SymbolizerTool *ChooseExternalSym
+     return new(*allocator) AtosSymbolizer(found_path, allocator);
+   }
+ #endif  // SANITIZER_APPLE
+-  if (const char *found_path = FindPathToBinary("llvm-symbolizer")) {
++  if (const char *found_path = "/usr/bin/llvm-symbolizer-" LLVM_VERSION_STRING) {
+     VReport(2, "Using llvm-symbolizer found at: %s\n", found_path);
+     return new(*allocator) LLVMSymbolizer(found_path, allocator);
+   }
+--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
++++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+@@ -34,6 +34,7 @@
+ #include "lldb/Utility/StreamString.h"
+ #include "llvm/ADT/SmallString.h"
+ #include "llvm/Support/ScopedPrinter.h"
++#include "llvm/Config/llvm-config.h"
+ 
+ #include "ProcessGDBRemoteLog.h"
+ 
+@@ -42,7 +43,7 @@
+ #elif defined(_WIN32)
+ #define DEBUGSERVER_BASENAME "lldb-server.exe"
+ #else
+-#define DEBUGSERVER_BASENAME "lldb-server"
++#define DEBUGSERVER_BASENAME "lldb-server-" LLVM_VERSION_STRING
+ #endif
+ 
+ #if defined(HAVE_LIBCOMPRESSION)
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index 24f73810c3aa5..191ae7f789e8c 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -6,6 +6,7 @@ build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
 configure_args="
+ -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm15
  -DCMAKE_BUILD_TYPE=Release -Wno-dev
  -DENABLE_LINKER_BUILD_ID=YES
  -DLLDB_USE_SYSTEM_SIX=YES

From 121de1d156fc86d21d17c0e57ad1bab3a0ffab87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sat, 27 Jan 2024 23:04:00 +0700
Subject: [PATCH 3/3] llvm17

---
 srcpkgs/clang-analyzer17                      |   1 +
 srcpkgs/clang-tools-extra17                   |   1 +
 srcpkgs/clang17                               |   1 +
 srcpkgs/libclang-cpp17                        |   1 +
 srcpkgs/libclang17                            |   1 +
 srcpkgs/libcxx17                              |   1 +
 srcpkgs/libcxx17-devel                        |   1 +
 srcpkgs/libcxxabi17                           |   1 +
 srcpkgs/libcxxabi17-devel                     |   1 +
 srcpkgs/libllvm17                             |   1 +
 srcpkgs/libomp17                              |   1 +
 srcpkgs/libomp17-devel                        |   1 +
 srcpkgs/libomptarget17                        |   1 +
 srcpkgs/lld17                                 |   1 +
 srcpkgs/lld17-devel                           |   1 +
 srcpkgs/lldb17                                |   1 +
 srcpkgs/lldb17-devel                          |   1 +
 srcpkgs/llvm-libunwind17                      |   1 +
 srcpkgs/llvm-libunwind17-devel                |   1 +
 .../llvm17/files/llvm-Config-llvm-config.h    |   9 +
 srcpkgs/llvm17/patches/0001-tools-path.patch  |  28 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  31 +
 .../patches/clang-002-add-musl-triples.patch  | 115 ++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  54 ++
 .../llvm17/patches/clang-005-i686-cpu.patch   |  13 +
 .../llvm17/patches/clang-006-version.patch    | 146 +++++
 .../patches/clang-007-version-define.patch    |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  36 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm17/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm17/patches/libcxx-musl.patch      |  26 +
 .../llvm17/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm17/patches/libomp-soname.patch    |  10 +
 srcpkgs/llvm17/patches/lldb-002-swig.patch    |  11 +
 srcpkgs/llvm17/patches/lldb-003-soname.patch  |  11 +
 .../llvm17/patches/lldb-004-print-path.patch  |  44 ++
 srcpkgs/llvm17/patches/llvm-001-musl.patch    |  31 +
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  29 +
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm17/patches/llvm-005-ppc-bigpic.patch  |  32 +
 .../patches/llvm-006-aarch64-mf_exec.patch    |  26 +
 srcpkgs/llvm17/template                       | 576 ++++++++++++++++++
 srcpkgs/llvm17/update                         |   3 +
 45 files changed, 1395 insertions(+)
 create mode 120000 srcpkgs/clang-analyzer17
 create mode 120000 srcpkgs/clang-tools-extra17
 create mode 120000 srcpkgs/clang17
 create mode 120000 srcpkgs/libclang-cpp17
 create mode 120000 srcpkgs/libclang17
 create mode 120000 srcpkgs/libcxx17
 create mode 120000 srcpkgs/libcxx17-devel
 create mode 120000 srcpkgs/libcxxabi17
 create mode 120000 srcpkgs/libcxxabi17-devel
 create mode 120000 srcpkgs/libllvm17
 create mode 120000 srcpkgs/libomp17
 create mode 120000 srcpkgs/libomp17-devel
 create mode 120000 srcpkgs/libomptarget17
 create mode 120000 srcpkgs/lld17
 create mode 120000 srcpkgs/lld17-devel
 create mode 120000 srcpkgs/lldb17
 create mode 120000 srcpkgs/lldb17-devel
 create mode 120000 srcpkgs/llvm-libunwind17
 create mode 120000 srcpkgs/llvm-libunwind17-devel
 create mode 100644 srcpkgs/llvm17/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm17/patches/0001-tools-path.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-005-i686-cpu.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-006-version.patch
 create mode 100644 srcpkgs/llvm17/patches/clang-007-version-define.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm17/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/lldb-002-swig.patch
 create mode 100644 srcpkgs/llvm17/patches/lldb-003-soname.patch
 create mode 100644 srcpkgs/llvm17/patches/lldb-004-print-path.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm17/template
 create mode 100644 srcpkgs/llvm17/update

diff --git a/srcpkgs/clang-analyzer17 b/srcpkgs/clang-analyzer17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-analyzer17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra17 b/srcpkgs/clang-tools-extra17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang-tools-extra17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/clang17 b/srcpkgs/clang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp17 b/srcpkgs/libclang-cpp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang-cpp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libclang17 b/srcpkgs/libclang17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libclang17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx17 b/srcpkgs/libcxx17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libcxx17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxx17-devel b/srcpkgs/libcxx17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libcxx17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi17 b/srcpkgs/libcxxabi17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libcxxabi17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi17-devel b/srcpkgs/libcxxabi17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libcxxabi17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libllvm17 b/srcpkgs/libllvm17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libllvm17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp17 b/srcpkgs/libomp17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libomp17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomp17-devel b/srcpkgs/libomp17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libomp17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/libomptarget17 b/srcpkgs/libomptarget17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/libomptarget17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17 b/srcpkgs/lld17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lld17-devel b/srcpkgs/lld17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lld17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17 b/srcpkgs/lldb17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/lldb17-devel b/srcpkgs/lldb17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/lldb17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind17 b/srcpkgs/llvm-libunwind17
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-libunwind17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind17-devel b/srcpkgs/llvm-libunwind17-devel
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm-libunwind17-devel
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/files/llvm-Config-llvm-config.h b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
new file mode 100644
index 0000000000000..2fa08c9be6962
--- /dev/null
+++ b/srcpkgs/llvm17/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm17/patches/0001-tools-path.patch b/srcpkgs/llvm17/patches/0001-tools-path.patch
new file mode 100644
index 0000000000000..879d68bdf30be
--- /dev/null
+++ b/srcpkgs/llvm17/patches/0001-tools-path.patch
@@ -0,0 +1,28 @@
+From: Peter Wu <peter@lekensteyn.nl>
+Date: Fri, 4 May 2018 15:55:26 +0200
+Subject: [PATCH] [clang] cmake: resolve symlinks in ClangConfig.cmake
+
+Ensure that symlinks such as /usr/lib/cmake/clang-X.Y (pointing to
+/usr/lib/llvm-X.Y/lib/cmake/llvm) are resolved. This ensures that
+CLANG_INSTALL_PREFIX ends up to be /usr/lib/llvm-X.Y instead of /usr.
+
+Partially addresses PR37128
+---
+ cmake/modules/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/cmake/Modules/FindPrefixFromConfig.cmake
++++ b/cmake/Modules/FindPrefixFromConfig.cmake
+@@ -39,10 +39,10 @@ function(find_prefix_from_config out_var
+     # install prefix, and avoid hard-coding any absolute paths.
+     set(config_code
+       "# Compute the installation prefix from this LLVMConfig.cmake file location."
+-      "get_filename_component(${prefix_var} \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
++      "get_filename_component(${prefix_var} \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)")
+     # Construct the proper number of get_filename_component(... PATH)
+     # calls to compute the installation prefix.
+-    string(REGEX REPLACE "/" ";" _count "${path_to_leave}")
++    string(REGEX REPLACE "/" ";" _count "prefix/${path_to_leave}")
+     foreach(p ${_count})
+       list(APPEND config_code
+         "get_filename_component(${prefix_var} \"\${${prefix_var}}\" PATH)")
diff --git a/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000000000..05d57e2c12917
--- /dev/null
+++ b/srcpkgs/llvm17/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,31 @@
+--- 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
+@@ -327,6 +327,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struc
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
diff --git a/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 0000000000000..e8021cbfb17af
--- /dev/null
+++ b/srcpkgs/llvm17/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2308,7 +2308,8 @@ void Generic_GCC::GCCInstallationDetecto
+   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"};
+   static const char *const ARMebHFTriples[] = {
+@@ -2384,8 +2385,7 @@ void Generic_GCC::GCCInstallationDetecto
+       "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[] = {
+@@ -2464,6 +2464,92 @@ void Generic_GCC::GCCInstallationDetecto
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 0000000000000..3852c5d5d6129
--- /dev/null
+++ b/srcpkgs/llvm17/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -547,10 +547,6 @@ std::string Linux::getDynamicLinker(cons
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm17/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm17/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 0000000000000..4e6960f66842a
--- /dev/null
+++ b/srcpkgs/llvm17/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,54 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -424,18 +424,16 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-Fn32-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e";
+       if (Triple.isPPC64ELFv2ABI()) {
+-        ABI = "elfv2";
+         DataLayout += "-Fn32";
+       } else {
+-        ABI = "elfv1";
+         DataLayout += "-Fi64";
+       }
+       DataLayout += "-i64:64-n32:64";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -2029,13 +2029,7 @@ void Clang::AddPPCTargetArgs(const ArgLi
+   const char *ABIName = nullptr;
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if (T.isPPC64ELFv2ABI())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
+--- a/clang/lib/CodeGen/CodeGenModule.cpp
++++ b/clang/lib/CodeGen/CodeGenModule.cpp
+@@ -194,9 +194,9 @@ createTargetCodeGenInfo(CodeGenModule &C
+       return createAIXTargetCodeGenInfo(CGM, /*Is64Bit=*/true);
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIKind Kind = PPC64_SVR4_ABIKind::ELFv1;
+-      if (Target.getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIKind::ELFv2;
++      PPC64_SVR4_ABIKind Kind = PPC64_SVR4_ABIKind::ELFv2;
++      if (Target.getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIKind::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return createPPC64_SVR4_TargetCodeGenInfo(CGM, Kind, IsSoftFloat);
diff --git a/srcpkgs/llvm17/patches/clang-005-i686-cpu.patch b/srcpkgs/llvm17/patches/clang-005-i686-cpu.patch
new file mode 100644
index 0000000000000..7a2ac19eafa40
--- /dev/null
+++ b/srcpkgs/llvm17/patches/clang-005-i686-cpu.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Arch/X86.cpp
++++ b/clang/lib/Driver/ToolChains/Arch/X86.cpp
+@@ -111,8 +111,8 @@ std::string x86::getX86TargetCPU(const D
+   case llvm::Triple::FreeBSD:
+     return "i686";
+   default:
+-    // Fallback to p4.
+-    return "pentium4";
++    // Fallback to i686.
++    return "i686";
+   }
+ }
+ 
diff --git a/srcpkgs/llvm17/patches/clang-006-version.patch b/srcpkgs/llvm17/patches/clang-006-version.patch
new file mode 100644
index 0000000000000..23057d605f616
--- /dev/null
+++ b/srcpkgs/llvm17/patches/clang-006-version.patch
@@ -0,0 +1,146 @@
+--- a/clang/tools/scan-build/libexec/ccc-analyzer
++++ b/clang/tools/scan-build/libexec/ccc-analyzer
+@@ -93,7 +93,7 @@ if ($FindBin::Script =~ /c\+\+-analyzer/
+   if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler))) { $Compiler = $DefaultCXXCompiler; }
+ 
+   $Clang = $ENV{'CLANG_CXX'};
+-  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang++'; }
++  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang++-17'; }
+ 
+   $IsCXX = 1
+ }
+@@ -102,7 +102,7 @@ else {
+   if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler))) { $Compiler = $DefaultCCompiler; }
+ 
+   $Clang = $ENV{'CLANG'};
+-  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang'; }
++  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang-17'; }
+ 
+   $IsCXX = 0
+ }
+--- a/clang/tools/scan-build/bin/scan-build
++++ b/clang/tools/scan-build/bin/scan-build
+@@ -1485,7 +1485,7 @@ sub FindClang {
+   if (!defined $Options{AnalyzerDiscoveryMethod}) {
+     $Clang = Cwd::realpath("$RealBin/bin/clang") if (-f "$RealBin/bin/clang");
+     if (!defined $Clang || ! -x $Clang) {
+-      $Clang = Cwd::realpath("$RealBin/clang") if (-f "$RealBin/clang");
++      $Clang = Cwd::realpath("/usr/lib/llvm17/bin/clang");
+       if (!defined $Clang || ! -x $Clang) {
+         # When an Xcode toolchain is present, look for a clang in the sibling bin
+         # of the parent of the bin directory. So if scan-build is at
+--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
++++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
+@@ -125,7 +125,7 @@ def main():
+     parser.add_argument(
+         "-clang-tidy-binary",
+         metavar="PATH",
+-        default="clang-tidy",
++        default="clang-tidy-17",
+         help="path to clang-tidy binary",
+     )
+     parser.add_argument(
+--- a/clang/tools/clang-format/git-clang-format
++++ b/clang/tools/clang-format/git-clang-format
+@@ -104,7 +104,7 @@ def main():
+     usage=usage, formatter_class=argparse.RawDescriptionHelpFormatter,
+     description=desc)
+   p.add_argument('--binary',
+-                 default=config.get('clangformat.binary', 'clang-format'),
++                 default=config.get('clangformat.binary', 'clang-format-17'),
+                  help='path to clang-format'),
+   p.add_argument('--commit',
+                  default=config.get('clangformat.commit', 'HEAD'),
+--- a/clang/tools/scan-build-py/lib/libscanbuild/arguments.py
++++ b/clang/tools/scan-build-py/lib/libscanbuild/arguments.py
+@@ -293,7 +293,7 @@ def create_analyze_parser(from_build_com
+         "--use-analyzer",
+         metavar="<path>",
+         dest="clang",
+-        default="clang",
++        default="clang-17",
+         help="""'%(prog)s' uses the 'clang' executable relative to itself for
+         static analysis. One can override this behavior with this option by
+         using the 'clang' packaged with Xcode (on OS X) or from the PATH.""",
+@@ -457,7 +457,7 @@ def create_analyze_parser(from_build_com
+             "--use-extdef-map-cmd",
+             metavar="<path>",
+             dest="extdef_map_cmd",
+-            default="clang-extdef-mapping",
++            default="clang-extdef-mapping-17",
+             help="""'%(prog)s' uses the 'clang-extdef-mapping' executable
+             relative to itself for generating external definition maps for
+             static analysis. One can override this behavior with this option
+--- a/llvm/tools/llvm-shlib/gen-msvc-exports.py
++++ b/llvm/tools/llvm-shlib/gen-msvc-exports.py
+@@ -99,7 +99,7 @@ def main():
+         action="store_true",
+     )
+     parser.add_argument(
+-        "--nm", help="path to the llvm-nm executable", default="llvm-nm"
++        "--nm", help="path to the llvm-nm executable", default="llvm-nm-17"
+     )
+     parser.add_argument(
+         "libs",
+--- a/clang/tools/clang-format/clang-format-diff.py
++++ b/clang/tools/clang-format/clang-format-diff.py
+@@ -92,7 +92,7 @@ def main():
+     )
+     parser.add_argument(
+         "-binary",
+-        default="clang-format",
++        default="clang-format-17",
+         help="location of binary to use for clang-format",
+     )
+     args = parser.parse_args()
+--- a/clang/tools/clang-format/clang-format.el
++++ b/clang/tools/clang-format/clang-format.el
+@@ -37,7 +37,7 @@
+   :group 'tools)
+ 
+ (defcustom clang-format-executable
+-  (or (executable-find "clang-format")
++  (or (executable-find "clang-format-17")
+       "clang-format")
+   "Location of the clang-format executable.
+ 
+--- a/clang/tools/clang-format/clang-format.py
++++ b/clang/tools/clang-format/clang-format.py
+@@ -49,7 +49,7 @@ import vim
+ 
+ # set g:clang_format_path to the path to clang-format if it is not on the path
+ # Change this to the full path if clang-format is not on the path.
+-binary = "clang-format"
++binary = "clang-format-17"
+ if vim.eval('exists("g:clang_format_path")') == "1":
+     binary = vim.eval("g:clang_format_path")
+ 
+--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
++++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+@@ -260,11 +260,14 @@ def main():
+         help="allow alpha checkers from " "clang-analyzer.",
+     )
+     parser.add_argument(
+-        "-clang-tidy-binary", metavar="PATH", help="path to clang-tidy binary"
++        "-clang-tidy-binary", metavar="PATH",
++        default="clang-tidy-17",
++        help="path to clang-tidy binary"
+     )
+     parser.add_argument(
+         "-clang-apply-replacements-binary",
+         metavar="PATH",
++        default="clang-apply-replacements-17",
+         help="path to clang-apply-replacements binary",
+     )
+     parser.add_argument(
+--- a/clang/bindings/python/clang/cindex.py
++++ b/clang/bindings/python/clang/cindex.py
+@@ -3937,7 +3937,7 @@ class Config(object):
+         elif name == "Windows":
+             file = "libclang.dll"
+         else:
+-            file = "libclang.so"
++            file = "libclang-17.so"
+ 
+         if Config.library_path:
+             file = Config.library_path + "/" + file
diff --git a/srcpkgs/llvm17/patches/clang-007-version-define.patch b/srcpkgs/llvm17/patches/clang-007-version-define.patch
new file mode 100644
index 0000000000000..88c83cf9b0a28
--- /dev/null
+++ b/srcpkgs/llvm17/patches/clang-007-version-define.patch
@@ -0,0 +1,48 @@
+--- a/compiler-rt/lib/sanitizer_common/CMakeLists.txt
++++ b/compiler-rt/lib/sanitizer_common/CMakeLists.txt
+@@ -209,6 +209,7 @@ set(SANITIZER_IMPL_HEADERS
+   )
+ 
+ include_directories(..)
++include_directories(${LLVM_INCLUDE_DIR})
+ 
+ set(SANITIZER_COMMON_DEFINITIONS
+   HAVE_RPC_XDR_H=${HAVE_RPC_XDR_H})
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
+@@ -32,6 +32,7 @@
+ #  include "sanitizer_symbolizer_internal.h"
+ #  include "sanitizer_symbolizer_libbacktrace.h"
+ #  include "sanitizer_symbolizer_mac.h"
++#  include "llvm/Config/llvm-config.h"
+ 
+ // C++ demangling function, as required by Itanium C++ ABI. This is weak,
+ // because we do not require a C++ ABI library to be linked to a program
+@@ -451,7 +452,7 @@ static SymbolizerTool *ChooseExternalSym
+     return new(*allocator) AtosSymbolizer(found_path, allocator);
+   }
+ #endif  // SANITIZER_APPLE
+-  if (const char *found_path = FindPathToBinary("llvm-symbolizer")) {
++  if (const char *found_path = "/usr/bin/llvm-symbolizer-" LLVM_VERSION_STRING) {
+     VReport(2, "Using llvm-symbolizer found at: %s\n", found_path);
+     return new(*allocator) LLVMSymbolizer(found_path, allocator);
+   }
+--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
++++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+@@ -33,6 +33,7 @@
+ #include "lldb/Utility/StreamString.h"
+ #include "llvm/ADT/SmallString.h"
+ #include "llvm/Support/ScopedPrinter.h"
++#include "llvm/Config/llvm-config.h"
+ 
+ #include "ProcessGDBRemoteLog.h"
+ 
+@@ -41,7 +42,7 @@
+ #elif defined(_WIN32)
+ #define DEBUGSERVER_BASENAME "lldb-server.exe"
+ #else
+-#define DEBUGSERVER_BASENAME "lldb-server"
++#define DEBUGSERVER_BASENAME "lldb-server-" LLVM_VERSION_STRING
+ #endif
+ 
+ #if defined(HAVE_LIBCOMPRESSION)
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 0000000000000..831db7c5639c7
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,36 @@
+--- 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
+@@ -95,7 +95,8 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || defined(__loongarch__) ||SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__loongarch__) || \
++        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_LOONGARCH64) && \
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
+      !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
diff --git a/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 0000000000000..c9b9286ac37b3
--- /dev/null
+++ b/srcpkgs/llvm17/patches/compiler-rt-sanitizer-supported-arch.patch
@@ -0,0 +1,22 @@
+Based on patch from Alpine:
+https://gitlab.alpinelinux.org/alpine/aports/-/blob/693203c42aa1cde88cb547173ef67a98824973fd/main/llvm-runtimes/compiler-rt-sanitizer-supported-arch.patch
+
+Sanitizer code is broken on armhf, armv7, s390x, x86, and probably riscv64 on musl,
+i.e. enable it only on x86_64, aarch64, and ppc64le.
+
+--- a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
++++ b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
+@@ -23,9 +23,13 @@ if(APPLE)
+   set(X86_64 x86_64 x86_64h)
+ endif()
+ 
++if (LIBCXX_HAS_MUSL_LIBC)
++set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86_64} ${ARM64} ${PPC64})
++else()
+ set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} ${RISCV64}
+     ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X} ${SPARC} ${SPARCV9}
+     ${HEXAGON} ${LOONGARCH64})
++endif()
+ set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
+     ${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON}
+     ${LOONGARCH64})
diff --git a/srcpkgs/llvm17/patches/libcxx-armv67.patch b/srcpkgs/llvm17/patches/libcxx-armv67.patch
new file mode 100644
index 0000000000000..1dab312c83e3e
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-armv67.patch
@@ -0,0 +1,22 @@
+See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180
+Avoid the following undefined reference:
+
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__x() const [clone .localalias]':
+locale.cpp:(.text._ZNKSt3__120__time_get_c_storageIcE3__xEv+0xb4): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__X() const [clone .localalias]':
+
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,12 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIB
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++set(VOID_GCC_BUG_109180_WORKAROUND OFF CACHE BOOL "")
++
++if (VOID_GCC_BUG_109180_WORKAROUND)
++  set_source_files_properties(string.cpp PROPERTIES COMPILE_FLAGS -fno-inline)
++endif()
++
+ if (APPLE AND LLVM_USE_SANITIZER)
+   if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
+       ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
diff --git a/srcpkgs/llvm17/patches/libcxx-musl.patch b/srcpkgs/llvm17/patches/libcxx-musl.patch
new file mode 100644
index 0000000000000..adc5e4e4037a1
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -758,7 +758,11 @@ __num_get_signed_integral(const char* __
+         __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -798,7 +802,11 @@ __num_get_unsigned_integral(const char*
+         __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 0000000000000..e9a3e3d6b3e05
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -681,6 +681,8 @@ function(cxx_link_system_libraries targe
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm17/patches/libomp-soname.patch b/srcpkgs/llvm17/patches/libomp-soname.patch
new file mode 100644
index 0000000000000..1e687570acc57
--- /dev/null
+++ b/srcpkgs/llvm17/patches/libomp-soname.patch
@@ -0,0 +1,10 @@
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -154,6 +154,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LI
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm17/patches/lldb-002-swig.patch b/srcpkgs/llvm17/patches/lldb-002-swig.patch
new file mode 100644
index 0000000000000..1cff6b1b94d8e
--- /dev/null
+++ b/srcpkgs/llvm17/patches/lldb-002-swig.patch
@@ -0,0 +1,11 @@
+--- a/lldb/bindings/python/python.swig
++++ b/lldb/bindings/python/python.swig
+@@ -54,7 +54,7 @@ except ImportError:
+ %enddef
+ // These versions will not generate working python modules, so error out early.
+ #if SWIG_VERSION >= 0x030009 && SWIG_VERSION < 0x030011
+-#error Swig versions 3.0.9 and 3.0.10 are incompatible with lldb.
++#warning Swig versions 3.0.9 and 3.0.10 are incompatible with lldb.
+ #endif
+ 
+ // The name of the module to be created.
diff --git a/srcpkgs/llvm17/patches/lldb-003-soname.patch b/srcpkgs/llvm17/patches/lldb-003-soname.patch
new file mode 100644
index 0000000000000..784dea40bcda0
--- /dev/null
+++ b/srcpkgs/llvm17/patches/lldb-003-soname.patch
@@ -0,0 +1,11 @@
+--- a/lldb/source/API/CMakeLists.txt
++++ b/lldb/source/API/CMakeLists.txt
+@@ -20,7 +20,7 @@ if(LLDB_ENABLE_LUA)
+   set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp)
+ endif()
+ 
+-add_lldb_library(liblldb SHARED ${option_framework}
++add_lldb_library(liblldb SHARED OUTPUT_NAME lldb SONAME
+   SBAddress.cpp
+   SBAttachInfo.cpp
+   SBBlock.cpp
diff --git a/srcpkgs/llvm17/patches/lldb-004-print-path.patch b/srcpkgs/llvm17/patches/lldb-004-print-path.patch
new file mode 100644
index 0000000000000..2cbebdf8adc7f
--- /dev/null
+++ b/srcpkgs/llvm17/patches/lldb-004-print-path.patch
@@ -0,0 +1,44 @@
+Author: Gianfranco Costamagna <locutusofborg@debian.org>
+Last-Update: 2023-01-19
+
+--- a/lldb/bindings/python/get-python-config.py
++++ b/lldb/bindings/python/get-python-config.py
+@@ -15,6 +15,7 @@ def relpath_nodots(path, base):
+     return rel
+ 
+ def main():
++    import sysconfig
+     parser = argparse.ArgumentParser(description="extract cmake variables from python")
+     parser.add_argument("variable_name")
+     args = parser.parse_args()
+@@ -31,7 +32,19 @@ def main():
+         # If not, you'll have to use lldb -P or lldb -print-script-interpreter-info
+         # to figure out where it is.
+         try:
+-            print(relpath_nodots(sysconfig.get_path("platlib"), sys.prefix))
++            if hasattr(sysconfig, 'get_default_scheme'):
++                scheme = sysconfig.get_default_scheme()
++            else:
++                scheme = sysconfig._get_default_scheme()
++            if scheme == 'posix_local':
++                # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
++                scheme = 'posix_prefix'
++                path = sysconfig.get_path('purelib', scheme)
++            else:
++                from distutils import sysconfig
++                path = sysconfig.get_python_lib(0, 0)
++
++            print(relpath_nodots(path, sys.prefix))
+         except ValueError:
+             # Try to fall back to something reasonable if sysconfig's platlib
+             # is outside of sys.prefix
+--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
++++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+@@ -240,6 +240,7 @@ void ScriptInterpreterPython::ComputePyt
+   // the real python interpreter uses.  (e.g. lib for most, lib64 on RHEL
+   // x86_64, or bin on Windows).
+   llvm::sys::path::remove_filename(path);
++  llvm::sys::path::append(path, "/llvm-" + std::to_string(LLVM_VERSION_MAJOR));
+   llvm::sys::path::append(path, LLDB_PYTHON_RELATIVE_LIBDIR);
+ 
+ #if defined(_WIN32)
diff --git a/srcpkgs/llvm17/patches/llvm-001-musl.patch b/srcpkgs/llvm17/patches/llvm-001-musl.patch
new file mode 100644
index 0000000000000..7f3850832258d
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-001-musl.patch
@@ -0,0 +1,31 @@
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -17,6 +17,17 @@
+ #include "llvm/TargetParser/Triple.h"
+ #include <optional>
+ 
++#ifndef __GLIBC__
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++#endif
++
+ namespace llvm {
+ 
+ template <typename T> class ArrayRef;
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -104,7 +104,7 @@ static void *DoSearch(const char *Symbol
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM)                                                   \
+   if (!strcmp(SymbolName, #SYM))                                               \
+-  return &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/srcpkgs/llvm17/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm17/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 0000000000000..05e5444f7d0e6
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,29 @@
+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.
+
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -246,12 +246,8 @@ static PPCTargetMachine::PPCABI computeT
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    if (TT.isPPC64ELFv2ABI())
+-      return PPCTargetMachine::PPC_ABI_ELFv2;
+-    else
+-      return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+--- 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/llvm17/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm17/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 0000000000000..717fe6c30836d
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -106,7 +106,7 @@ void PPCSubtarget::initSubtargetFeatures
+   if (IsPPC64 && has64BitSupport())
+     Use64BitRegs = true;
+ 
+-  if (TargetTriple.isPPC32SecurePlt())
++  if (isTargetLinux() || TargetTriple.isPPC32SecurePlt())
+     IsSecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm17/patches/llvm-004-override-opt.patch b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
new file mode 100644
index 0000000000000..a0e8a4c2f7836
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -1135,6 +1135,12 @@ if(LLVM_INCLUDE_TESTS)
+   umbrella_lit_testsuite_begin(check-all)
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 0000000000000..541a11629cb5d
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,32 @@
+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(-)
+
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -683,7 +683,7 @@ void PPCAsmPrinter::EmitTlsCall(const Ma
+ 
+   // 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);
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const Mach
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 0000000000000..520fa2ac6f92c
--- /dev/null
+++ b/srcpkgs/llvm17/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,26 @@
+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
+@@ -50,7 +50,8 @@ static int getPosixProtectionFlags(unsig
+       llvm::sys::Memory::MF_EXEC:
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+-#if defined(__FreeBSD__) || defined(__powerpc__)
++#if defined(__FreeBSD__) || defined(__powerpc__) || \
++  (defined(__linux__) && defined(__aarch64__))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
new file mode 100644
index 0000000000000..1f9d8ead485f4
--- /dev/null
+++ b/srcpkgs/llvm17/template
@@ -0,0 +1,576 @@
+# Template file for 'llvm17'
+pkgname=llvm17
+version=17.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm17
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -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_VERSION_SUFFIX=
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -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/lib/llvm17/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -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 python3-sphinx-markdown-tables
+ pkg-config"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel"
+depends="libllvm17>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
+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
+
+# disable libc & llvm-libgcc
+_enable_runtimes="libcxx;libcxxabi;libunwind;compiler-rt;pstl"
+_enable_projects="clang;clang-tools-extra;lld;mlir"
+
+_lldb_enable=yes
+_libomp_enable=no
+_bolt_enable=no
+_flang_enable=no
+_polly_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
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*) _bolt_enable=yes ;;
+esac
+
+if [ "$XBPS_TARGET_WORDSIZE" = 64 ]; then
+	_flang_enable=yes
+fi
+
+subpackages="clang-tools-extra17"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enable_runtimes+=";openmp"
+	subpackages+=" libomptarget17 libomp17 libomp17-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp17>=${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+=" clang17 clang-analyzer17
+ libclang17 libclang-cpp17 libllvm17
+ llvm-libunwind17 llvm-libunwind-17devel libcxx17 libcxx17-devel
+ libcxxabi17 libcxxabi17-devel"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enable_projects+=";lldb"
+	subpackages+=" lldb17 lldb17-devel"
+fi
+
+if [ "$_bolt_enable" = yes ]; then
+	_enable_projects+=";bolt"
+	subpackages+=" bolt17 libbolt17-devel"
+fi
+
+if [ "$_flang_enable" = yes ]; then
+	_enable_projects+=";flang"
+	subpackages+=" flang17;libflang17-devel"
+fi
+
+if [ "$_polly_enable" = yes ]; then
+	_enable_projects+=";polly"
+	subpackages+=" libpolly17-devel"
+fi
+
+if [ "$_libfuzzer_enable" = yes ]; then
+	subpackages+=" libfuzzer17-devel"
+fi
+
+subpackages+=" lld17 lld17-devel"
+
+configure_args+=" -DLLVM_ENABLE_RUNTIMES=${_enable_runtimes}"
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enable_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+		armv*) configure_args+=" -DVOID_GCC_BUG_109180_WORKAROUND=ON" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DCMAKE_INSTALL_PREFIX=/usr/lib/llvm17 \
+			-DLLVM_ENABLE_RUNTIMES=${_enable_runtimes} \
+			-DLLVM_ENABLE_PROJECTS=${_enable_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+	arm*-musl|i686-musl)
+		# sanitizer code is broken since it duplicates some libc bits
+		configure_args+=" -DCOMPILER_RT_BUILD_SANITIZERS=OFF"
+		;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+post_install() {
+	local _file _header _fname _bname _group
+	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/lib/llvm17/bin/llvm-config-host
+	fi
+
+	for _file in ${DESTDIR}/usr/lib/llvm17/bin/*; do
+		_fname="${_file##*/}"
+		ln -sf "../lib/llvm17/bin/$_fname" \
+			"${DESTDIR}/usr/bin/${_fname}-17"
+	done
+
+	rm -f ${DESTDIR}/usr/bin/clang-17-17
+	for _file in clang clang++ clang-cpp; do
+		ln -sf "../lib/llvm17/bin/$_file" \
+			"${DESTDIR}/usr/bin/${_file}-17"
+	done
+
+	vmkdir usr/share/man/man1
+	for _file in ${DESTDIR}/usr/lib/llvm17/share/man/man1/*; do
+		_fname="${_file##*/}"
+		_bname="${_fname%.1}"
+		mv "${_file}" \
+			"${DESTDIR}/usr/share/man/man1/${_bname}-17.1"
+	done
+
+	for _group in ftdetect ftplugin indent syntax; do
+		vmkdir "usr/share/vim/vimfiles/$_group"
+		for _file in "utils/vim/$_group"/*; do
+			_fname="${_file##*/}"
+			_bname="${_fname%.vim}"
+			vinstall "${_file}" 644 \
+				"usr/share/vim/vimfiles/$_group" \
+				"${_bname}-17.vim"
+		done
+	done
+
+	for _v in ${version} 17; do
+		vmkdir "usr/lib/clang/${_v}"
+		ln -sf ../../llvm17/lib/clang/17/lib \
+			"${DESTDIR}/usr/lib/clang/${_v}/"
+		ln -sf ../../llvm17/lib/clang/17/include \
+			"${DESTDIR}/usr/lib/clang/${_v}/"
+		ln -sf ../../lib/llvm17/lib/clang/17/include \
+			"${DESTDIR}/usr/include/clang/${_v}"
+	done
+
+	for _file in ${DESTDIR}/usr/lib/llvm17/lib/lib*.so.17; do
+		_fname="${_file##*/}"
+		ln -sf "llvm17/lib/${_fname}" "${DESTDIR}/usr/lib"
+	done
+
+	# Install asan_symbolize
+	vbin ../compiler-rt/lib/asan/scripts/asan_symbolize.py \
+		asan_symbolize-17
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 \
+		usr/lib/llvm17/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 \
+		usr/lib/llvm17/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 \
+		usr/lib/llvm17/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 \
+		usr/lib/llvm17/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 \
+		usr/lib/llvm17/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/lib/llvm17/include/mach-o
+}
+
+_vbinsplit() {
+	local _fname
+	for _fname
+	do
+		vmove "usr/bin/${_fname}-17"
+		vmove "usr/lib/llvm17/bin/${_fname}"
+	done
+}
+
+clang-analyzer17_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang17-${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/lib/llvm17/bin/scan-*"
+		vmove "usr/lib/llvm17/lib/libscanbuild"
+		vmove "usr/lib/llvm17/libexec/*-analyzer"
+		vmove "usr/lib/llvm17/libexec/analyze-*"
+		vmove "usr/lib/llvm17/libexec/intercept-*"
+		vmove "usr/lib/llvm17/share/scan-*"
+		vmove "usr/share/man/man1/scan-*"
+	}
+}
+
+clang-tools-extra17_package() {
+	lib32disabled=yes
+	depends="clang17-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		local _file
+		_vbinsplit \
+			clang-apply-replacements \
+			clange-change-namespace \
+			clang-doc \
+			clang-include-fixer \
+			clang-move \
+			clang-pseudo \
+			clang-query \
+			clang-reorder-fields \
+			clang-tidy \
+			clangd \
+			find-all-symbols \
+			hmaptool \
+			modularize \
+			pp-trace \
+
+		vmove usr/lib/llvm17/include/clang-tidy
+		vmove "usr/lib/llvm17/lib/libclangApplyReplacements*"
+		vmove "usr/lib/llvm17/lib/libclangChangeNamespace*"
+		vmove "usr/lib/llvm17/lib/libclangDaemon*"
+		vmove "usr/lib/llvm17/lib/libclangDoc*"
+		vmove "usr/lib/llvm17/lib/libclangIncludeCleaner*"
+		vmove "usr/lib/llvm17/lib/libclangIncludeFixer*"
+		vmove "usr/lib/llvm17/lib/libclangMove*"
+		vmove "usr/lib/llvm17/lib/libclangPseudo*"
+		vmove "usr/lib/llvm17/lib/libclangReorderFields*"
+		vmove "usr/lib/llvm17/lib/libclangQuery*"
+		vmove "usr/lib/llvm17/lib/libclangTidy*"
+		vmove "usr/lib/llvm17/lib/libclangd*"
+		vmove "usr/lib/llvm17/lib/libfindAllSymbols*"
+		vmove "usr/lib/llvm17/share/clang/*find-all-symbols*"
+		vmove "usr/lib/llvm17/share/clang/*include-fixer*"
+		vmove "usr/lib/llvm17/share/clang/*tidy*"
+		vmove usr/lib/llvm17/share/doc/LLVM/clang-tools
+		vmove "usr/share/man/man1/extraclangtools-17.1"
+	}
+}
+
+clang17_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang17-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove "usr/lib/llvm17/bin/*clang*"
+		_vbinsplit c-index-test diagtool
+		vmove usr/lib/llvm17/include/clang
+		vmove usr/lib/llvm17/include/clang-c
+		vmove usr/lib/llvm17/lib/clang
+		for _v in "${version}" 17; do
+			vmove "usr/lib/clang/${_v}/lib"
+			vmove "usr/lib/clang/${_v}/include"
+			vmove "usr/include/clang/${_v}/include"
+		done
+		vmove usr/lib/llvm17/lib/cmake/clang
+		vmove "usr/lib/llvm17/lib/libclang*.a"
+		vmove "usr/lib/llvm17/lib/libclang*.so"
+		vmove usr/lib/llvm17/share/clang
+		vmove usr/lib/llvm17/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang-17.1
+		vmove usr/share/man/man1/diagtool-17.1
+	}
+}
+
+libclang17_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+		vmove "usr/lib/llvm17/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp17_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+		vmove "usr/lib/llvm17/lib/libclang-cpp.so.*"
+	}
+}
+
+lld17_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		_vbinsplit "ld.lld*" "ld64.lld*" "lld*" wasm-ld
+		vmove usr/lib/llvm17/share/doc/LLVM/lld
+	}
+}
+
+lld17-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/llvm17/include/lld
+		vmove usr/lib/llvm17/lib/cmake/lld
+		vmove "usr/lib/llvm17/lib/liblld*a"
+	}
+}
+
+lldb17_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/llvm17/bin/*lldb*"
+		vmove "usr/lib/llvm17/lib/liblldb*so.*"
+		vmove "usr/lib/llvm17/${py3_sitelib#usr/}/lldb"
+	}
+}
+
+# TODO
+
+lldb17-devel_package() {
+	lib32disabled=yes
+	depends="lldb17>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind17_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind17-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind17>=${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
+	}
+}
+
+libcxxabi17_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi17-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi17>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx17_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx17-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx17>=${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
+	}
+}
+
+libomptarget17_package() {
+	short_desc+=" - Clang OpenMP for target"
+	pkg_install() {
+		vmove "usr/lib/libomptarget.*.so.*"
+	}
+}
+
+libomp17_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.*"
+	}
+}
+
+libomp17-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp17>=${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
+	}
+}
+
+libllvm17_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
new file mode 100644
index 0000000000000..e95cf26b3586b
--- /dev/null
+++ b/srcpkgs/llvm17/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: llvm-17, multiple version of llvm to co-exist.
  2024-01-28 15:29 [PR PATCH] llvm-17, multiple version of llvm to co-exist sgn
@ 2024-01-28 15:35 ` classabbyamp
  2024-01-28 23:42 ` sgn
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2024-01-28 15:35 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/48404#issuecomment-1913636290

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

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

* Re: llvm-17, multiple version of llvm to co-exist.
  2024-01-28 15:29 [PR PATCH] llvm-17, multiple version of llvm to co-exist sgn
  2024-01-28 15:35 ` classabbyamp
@ 2024-01-28 23:42 ` sgn
  2024-01-30 14:36 ` Calandracas606
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2024-01-28 23:42 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/48404#issuecomment-1913762614

Comment:
I see that, but I want multiple version of llvm.

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

* Re: llvm-17, multiple version of llvm to co-exist.
  2024-01-28 15:29 [PR PATCH] llvm-17, multiple version of llvm to co-exist sgn
  2024-01-28 15:35 ` classabbyamp
  2024-01-28 23:42 ` sgn
@ 2024-01-30 14:36 ` Calandracas606
  2024-01-30 14:57 ` sgn
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Calandracas606 @ 2024-01-30 14:36 UTC (permalink / raw)
  To: ml

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

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/48404#issuecomment-1917020273

Comment:
I've proposed this in, [#48222
](https://github.com/void-linux/void-packages/issues/48222)

I think there are some issues with cross compiling the PR too.

Please let me know if I should close/stop work on my PR if this one will be used instead

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

* Re: llvm-17, multiple version of llvm to co-exist.
  2024-01-28 15:29 [PR PATCH] llvm-17, multiple version of llvm to co-exist sgn
                   ` (2 preceding siblings ...)
  2024-01-30 14:36 ` Calandracas606
@ 2024-01-30 14:57 ` sgn
  2024-04-30  1:45 ` github-actions
  2024-05-14  1:46 ` [PR PATCH] [Closed]: " github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2024-01-30 14:57 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/48404#issuecomment-1917076021

Comment:
> I've proposed this in, [#48222
> ](https://github.com/void-linux/void-packages/issues/48222)
> 
> I think there are some issues with cross compiling the PR too.
> 
> Please let me know if I should close/stop work on my PR if this one will be used instead

Please work on your. I have very limited time.

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

* Re: llvm-17, multiple version of llvm to co-exist.
  2024-01-28 15:29 [PR PATCH] llvm-17, multiple version of llvm to co-exist sgn
                   ` (3 preceding siblings ...)
  2024-01-30 14:57 ` sgn
@ 2024-04-30  1:45 ` github-actions
  2024-05-14  1:46 ` [PR PATCH] [Closed]: " github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: github-actions @ 2024-04-30  1:45 UTC (permalink / raw)
  To: ml

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

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

https://github.com/void-linux/void-packages/pull/48404#issuecomment-2084121253

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

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

* Re: [PR PATCH] [Closed]: llvm-17, multiple version of llvm to co-exist.
  2024-01-28 15:29 [PR PATCH] llvm-17, multiple version of llvm to co-exist sgn
                   ` (4 preceding siblings ...)
  2024-04-30  1:45 ` github-actions
@ 2024-05-14  1:46 ` github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: github-actions @ 2024-05-14  1:46 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

llvm-17, multiple version of llvm to co-exist.
https://github.com/void-linux/void-packages/pull/48404

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**
[ci skip][skip ci]
<!--
#### 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
-->


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

end of thread, other threads:[~2024-05-14  1:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-28 15:29 [PR PATCH] llvm-17, multiple version of llvm to co-exist sgn
2024-01-28 15:35 ` classabbyamp
2024-01-28 23:42 ` sgn
2024-01-30 14:36 ` Calandracas606
2024-01-30 14:57 ` sgn
2024-04-30  1:45 ` github-actions
2024-05-14  1:46 ` [PR PATCH] [Closed]: " github-actions

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