Skip to content
Open

llvm22 #59471

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions common/shlibs
Original file line number Diff line number Diff line change
Expand Up @@ -940,14 +940,17 @@ 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.22.1 liblldb22-22.1.1_1
liblldb.so.21.1 liblldb21-21.1.4_1
liblldb.so.19.1 liblldb19-19.1.0_1
liblldb.so.18.1 liblldb18-18.1.8_1
liblldb.so.17 liblldb17-17.0.6_3
libclang.so.22.1 libclang22-22.1.1_1
libclang.so.21.1 libclang21-21.1.4_1
libclang.so.19.1 libclang19-19.1.0_1
libclang.so.18.1 libclang18-18.1.8_1
libclang.so.17 libclang17-17.0.6_1
libclang-cpp.so.22.1 libclang-cpp22-22.1.1_1
libclang-cpp.so.21.1 libclang-cpp21-21.1.4_1
libclang-cpp.so.19.1 libclang-cpp19-19.1.0_1
libclang-cpp.so.18.1 libclang-cpp18-18.1.8_1
Expand All @@ -956,6 +959,7 @@ libLLVM-17.so libllvm17-17.0.6_1
libLLVM.so.18.1 libllvm18-18.1.8_1
libLLVM.so.19.1 libllvm19-19.1.0_1
libLLVM.so.21.1 libllvm21-21.1.4_1
libLLVM.so.22.1 libllvm22-22.1.1_1
libLLVMSPIRVLib.so.18.1 SPIRV-LLVM-Translator-18.1.2_1
libLLVMSPIRVLib.so.19.1 SPIRV-LLVM-Translator19-19.1.1_1
libLLVMSPIRVLib.so.21.1 SPIRV-LLVM-Translator21-21.1.1_1
Expand Down
4 changes: 2 additions & 2 deletions srcpkgs/SPIRV-Headers/template
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Template file for 'SPIRV-Headers'
pkgname=SPIRV-Headers
reverts="1.5.4.raytracing.fixed_1 1.5.3_2 1.5.3_1 1.5.1_1"
version=1.4.328.1
version=1.4.341.0
revision=1
build_style=cmake
short_desc="Machine-readable files for the SPIR-V Registry"
maintainer="Daniel Martinez <danielmartinez@cock.li>"
license="MIT"
homepage="https://github.com/KhronosGroup/SPIRV-Headers"
distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/vulkan-sdk-${version}.tar.gz"
checksum=602364ab7bf404a7f352df7da5c645f1c4558a9c92616f8ee33422b04d5e35b7
checksum=cab0a654c4917e16367483296b44cdb1d614e3120c721beafcd37e3a8580486c

post_install() {
vlicense LICENSE
Expand Down
1 change: 1 addition & 0 deletions srcpkgs/SPIRV-LLVM-Translator22-devel
40 changes: 40 additions & 0 deletions srcpkgs/SPIRV-LLVM-Translator22/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Template file for 'SPIRV-LLVM-Translator22'
pkgname=SPIRV-LLVM-Translator22
version=22.1.0
revision=1
_llvm_ver=${version%%.*}
build_style=cmake
configure_args="
-DBUILD_SHARED_LIBS=ON
-DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/usr/lib/llvm/${_llvm_ver}
-DCMAKE_SKIP_RPATH=ON
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr
-DLLVM_LINK_LLVM_DYLIB=ON
-DLLVM_SPIRV_INCLUDE_TESTS=OFF
"
hostmakedepends="clang${_llvm_ver} llvm${_llvm_ver} pkg-config"
makedepends="llvm${_llvm_ver}-devel SPIRV-Headers SPIRV-Tools-devel"
short_desc="API and commands for processing SPIR-V modules - LLVM ${_llvm_ver}"
maintainer="Duncaen <duncaen@voidlinux.org>"
license="NCSA"
homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
checksum=a5d476404ab88ac0d148211da50428178c89caef8af8042a3ca8e71e58ed9427

alternatives="llvm-spirv:llvm-spirv:/usr/bin/llvm-spirv-${_llvm_ver}"

post_install() {
mv ${DESTDIR}/usr/bin/llvm-spirv ${DESTDIR}/usr/bin/llvm-spirv-${_llvm_ver}
vlicense LICENSE.TXT
}

SPIRV-LLVM-Translator22-devel_package() {
depends="SPIRV-LLVM-Translator${_llvm_ver}-${version}_${revision}"
conflicts="SPIRV-LLVM-Translator-devel>=0"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.so"
}
}
4 changes: 2 additions & 2 deletions srcpkgs/SPIRV-Tools/template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Template file for 'SPIRV-Tools'
pkgname=SPIRV-Tools
version=2025.4
version=2026.1
revision=1
build_style=cmake
configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
Expand All @@ -13,7 +13,7 @@ license="Apache-2.0"
homepage="https://github.com/KhronosGroup/SPIRV-Tools"
changelog="https://raw.githubusercontent.com/KhronosGroup/SPIRV-Tools/master/CHANGES"
distfiles="https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/v${version}.rc1.tar.gz"
checksum=721b29e33729f220bb8deffa23681e32304a1ef3f4b057d004ef49ac6a473559
checksum=41337dbdd090bc4b38bda41dbe6d0b569ad3f7b1d63e173c2ce0639cda58be80
LDFLAGS="-Wl,--no-undefined"

SPIRV-Tools-devel_package() {
Expand Down
1 change: 1 addition & 0 deletions srcpkgs/clang-analyzer22
1 change: 1 addition & 0 deletions srcpkgs/clang-tools-extra22
1 change: 1 addition & 0 deletions srcpkgs/clang22
1 change: 1 addition & 0 deletions srcpkgs/clang22-devel
1 change: 1 addition & 0 deletions srcpkgs/clang22-headers
1 change: 1 addition & 0 deletions srcpkgs/compiler-rt22
1 change: 1 addition & 0 deletions srcpkgs/flang22
1 change: 1 addition & 0 deletions srcpkgs/flang22-devel
1 change: 1 addition & 0 deletions srcpkgs/libclang-cpp22
1 change: 1 addition & 0 deletions srcpkgs/libclang22
1 change: 1 addition & 0 deletions srcpkgs/libclc22
2 changes: 1 addition & 1 deletion srcpkgs/libcxx
2 changes: 1 addition & 1 deletion srcpkgs/libcxx-devel
2 changes: 1 addition & 1 deletion srcpkgs/libcxxabi
2 changes: 1 addition & 1 deletion srcpkgs/libcxxabi-devel
1 change: 1 addition & 0 deletions srcpkgs/liblldb22
1 change: 1 addition & 0 deletions srcpkgs/libllvm22
1 change: 1 addition & 0 deletions srcpkgs/libomp22
1 change: 1 addition & 0 deletions srcpkgs/libomp22-devel
1 change: 1 addition & 0 deletions srcpkgs/lld22
1 change: 1 addition & 0 deletions srcpkgs/lld22-devel
1 change: 1 addition & 0 deletions srcpkgs/lldb22
1 change: 1 addition & 0 deletions srcpkgs/lldb22-devel
1 change: 1 addition & 0 deletions srcpkgs/llvm-bolt22
2 changes: 1 addition & 1 deletion srcpkgs/llvm-libunwind
2 changes: 1 addition & 1 deletion srcpkgs/llvm-libunwind-devel
1 change: 1 addition & 0 deletions srcpkgs/llvm22-bootstrap/patches
76 changes: 76 additions & 0 deletions srcpkgs/llvm22-bootstrap/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Template file for 'llvm22-bootstrap'
pkgname=llvm22-bootstrap
version=22.1.1
revision=1
_spirv_version=v22.1.0
build_wrksrc=llvm
build_style=cmake
configure_args="
-DCMAKE_BUILD_TYPE=Release -Wno-dev
-DENABLE_LINKER_BUILD_ID=YES
-DLLVM_INSTALL_UTILS=YES
-DLLVM_BINUTILS_INCDIR=/usr/include
-DBASE_LLVM_VERSION=${version}
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
-DLLVM_TARGETS_TO_BUILD=Native
-DLLVM_ENABLE_PROJECTS=clang;lld
"
hostmakedepends="perl python3 pkg-config"
makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
libxml2-devel binutils-devel z3-devel SPIRV-Headers SPIRV-Tools-devel"
short_desc="LLVM Compiler Infrastructure Project - Version ${_major}"
maintainer="Duncaen <duncaen@voidlinux.org>"
license="Apache-2.0 AND NCSA AND custom:Apache-2.0-with-llvm-exception"
homepage="https://www.llvm.org"
distfiles="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${version/rc/-rc}.tar.gz
https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/${_spirv_version}.tar.gz"
checksum="c48878550911a8a8993a749e6118446082656768e62b26456ac7d39c4422b409
a5d476404ab88ac0d148211da50428178c89caef8af8042a3ca8e71e58ed9427"

skip_extraction=${_spirv_version}.tar.gz

conflicts="llvm22>=0 llvm21>=0 llvm19>=0 llvm18>=0 llvm17>=0 llvm15>=0"

lib32disabled=yes
python_version=3
nodebug=yes
repository=bootstrap
nocross="bootstrap package"

# fails to build with libquadmth on musl
case "$XBPS_TARGET_MACHINE" in
x86_64|i686) makedepends+=" libquadmath-devel" ;;
esac

if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
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

configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"

pre_configure() {
configure_args+=" -DLLVM_HOST_TRIPLE=$($CC -dumpmachine)"
configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=$($CXX -dumpmachine)"
}

post_extract() {
vsrcextract -C llvm/projects/llvm-spirv "${_spirv_version}.tar.gz"
}

post_install() {
vlicense "${wrksrc}/LICENSE.TXT"
}
1 change: 1 addition & 0 deletions srcpkgs/llvm22-cross-tools
1 change: 1 addition & 0 deletions srcpkgs/llvm22-devel
1 change: 1 addition & 0 deletions srcpkgs/llvm22-doc
9 changes: 9 additions & 0 deletions srcpkgs/llvm22/files/llvm-Config-llvm-config.h
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions srcpkgs/llvm22/patches/SmallVector.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index 2e6d2dc6ce90..be2cf6cc1fee 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -1163,7 +1163,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
// happens on a 32-bit host and then fails due to sizeof(T) *increasing* on a
// 64-bit host, is expected to be very rare.
static_assert(
- sizeof(T) <= 256,
+ sizeof(T) <= 288,
"You are trying to use a default number of inlined elements for "
"`SmallVector<T>` but `sizeof(T)` is really big! Please use an "
"explicit number of inlined elements with `SmallVector<T, N>` to make "
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 2354350bcc890c13016d67f4c060b32cb1cd693c Mon Sep 17 00:00:00 2001
From: q66 <q66@chimera-linux.org>
Date: Sat, 4 Nov 2023 08:44:01 +0100
Subject: [PATCH 01/25] llvm: always set a larger stack size explicitly

---
llvm/lib/Support/Threading.cpp | 14 --------------
1 file changed, 14 deletions(-)

diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp
index 7cc7ba44c..b91b8f4bb 100644
--- a/llvm/lib/Support/Threading.cpp
+++ b/llvm/lib/Support/Threading.cpp
@@ -77,21 +77,7 @@ unsigned llvm::ThreadPoolStrategy::compute_thread_count() const {
// keyword.
#include "llvm/Support/thread.h"

-#if defined(__APPLE__)
- // Darwin's default stack size for threads except the main one is only 512KB,
- // which is not enough for some/many normal LLVM compilations. This implements
- // the same interface as std::thread but requests the same stack size as the
- // main thread (8MB) before creation.
const std::optional<unsigned> llvm::thread::DefaultStackSize = 8 * 1024 * 1024;
-#elif defined(_AIX)
- // On AIX, the default pthread stack size limit is ~192k for 64-bit programs.
- // This limit is easily reached when doing link-time thinLTO. AIX library
- // developers have used 4MB, so we'll do the same.
-const std::optional<unsigned> llvm::thread::DefaultStackSize = 4 * 1024 * 1024;
-#else
-const std::optional<unsigned> llvm::thread::DefaultStackSize;
-#endif
-

#endif

--
2.42.0
29 changes: 29 additions & 0 deletions srcpkgs/llvm22/patches/armv7l-is-armhf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
armv7l is referred to as armhf in LLVM. While compiler-rt/CMakeLists.txt
already performs this replacement, it does not seem to be applied in all
places where it is needed.

In compiler-rt/lib/builtins/CMakeLists.txt, the incorrect value is used,
which prevents creation of the clang_rt.builtins-${arch}.sources.txt file
for the target architecture, because armv7l is not included in the
BUILTIN_SUPPORTED_ARCH list.

As a result, compiler-rt/test/builtins/CMakeLists.txt is unable to read the
clang_rt.builtins-armhf.sources.txt file.

CMake Error at /builddir/llvm22-22.1.1/compiler-rt/test/builtins/CMakeLists.txt:110 (file):
file failed to open for reading (No such file or directory):
/builddir/llvm22-22.1.1/llvm/build/./lib/../lib/clang/22/lib/linux/clang_rt.builtins-armhf.sources.txt

--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -413,6 +413,10 @@
set(COMPILER_RT_DEFAULT_TARGET_ARCH "i386")
endif()

+ if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "^armv7l$")
+ set(COMPILER_RT_DEFAULT_TARGET_ARCH "armhf")
+ endif()
+
# If we are directly targeting a GPU we need to check that the compiler is
# compatible and pass some default arguments.
if(COMPILER_RT_DEFAULT_TARGET_ONLY)
Loading