Skip to content
Open

llvm23 #62475

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: 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.350.1
version=1.4.357.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=9e6d5c78878172d2b810e97f3a74ecbbb14b4ad52b07384ce915fbbeb226d610
checksum=4d703067a7e06331ccb37bdfed3f9b7879cc61969a2689ae95c95db34a47ff07

post_install() {
vlicense LICENSE
Expand Down
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=2026.2
version=2026.3
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}.tar.gz"
checksum=b4390652e64ab188eede9d556cf183b3c1c4be44d4fcd104b0d4af3bea2712d1
checksum=fff0667b25dfb98177da3cc4cc61ac277d076786df42baaf8d9635a25bdf9226
LDFLAGS="-Wl,--no-undefined"

SPIRV-Tools-devel_package() {
Expand Down
1 change: 1 addition & 0 deletions srcpkgs/clang-analyzer23
1 change: 1 addition & 0 deletions srcpkgs/clang-tools-extra23
1 change: 1 addition & 0 deletions srcpkgs/clang23
1 change: 1 addition & 0 deletions srcpkgs/clang23-devel
1 change: 1 addition & 0 deletions srcpkgs/clang23-headers
1 change: 1 addition & 0 deletions srcpkgs/compiler-rt23
1 change: 1 addition & 0 deletions srcpkgs/flang23
1 change: 1 addition & 0 deletions srcpkgs/flang23-devel
1 change: 1 addition & 0 deletions srcpkgs/libclang-cpp23
1 change: 1 addition & 0 deletions srcpkgs/libclang23
1 change: 1 addition & 0 deletions srcpkgs/libclc23
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/liblldb23
1 change: 1 addition & 0 deletions srcpkgs/libllvm23
1 change: 1 addition & 0 deletions srcpkgs/libomp23
1 change: 1 addition & 0 deletions srcpkgs/libomp23-devel
1 change: 1 addition & 0 deletions srcpkgs/lld23
1 change: 1 addition & 0 deletions srcpkgs/lld23-devel
1 change: 1 addition & 0 deletions srcpkgs/lldb23
1 change: 1 addition & 0 deletions srcpkgs/lldb23-devel
1 change: 1 addition & 0 deletions srcpkgs/llvm-bolt23
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/llvm23-bootstrap/patches
76 changes: 76 additions & 0 deletions srcpkgs/llvm23-bootstrap/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Template file for 'llvm23-bootstrap'
pkgname=llvm23-bootstrap
version=23.1.1
revision=1
_spirv_version=v23.1.1
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="851b3d701a4fbdd9f69536d4acda578469e810ca7056687d6556443f5fd39557
9e0bf1beb0ab7edca6cd8c17fd9bbb7ce3dcd520f3e969e0485ff5b00931f929"

skip_extraction=${_spirv_version}.tar.gz

conflicts="llvm23>=0 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/llvm23-cross-tools
1 change: 1 addition & 0 deletions srcpkgs/llvm23-devel
1 change: 1 addition & 0 deletions srcpkgs/llvm23-doc
9 changes: 9 additions & 0 deletions srcpkgs/llvm23/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/llvm23/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/llvm23/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)
44 changes: 44 additions & 0 deletions srcpkgs/llvm23/patches/clang-001-fix-unwind-chain-inclusion.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Tue, 8 Sep 2015 22:14:57 +0200
Subject: [PATCH 2/7] fix unwind chain inclusion

---
lib/Headers/unwind.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
index 303d792..44e10cc 100644
--- a/clang/lib/Headers/unwind.h
+++ b/clang/lib/Headers/unwind.h
@@ -9,9 +9,6 @@

/* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/

-#ifndef __CLANG_UNWIND_H
-#define __CLANG_UNWIND_H
-
#if defined(__APPLE__) && __has_include_next(<unwind.h>)
/* Darwin (from 11.x on) provide an unwind.h. If that's available,
* use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
@@ -39,6 +36,9 @@
# endif
#else

+#ifndef __CLANG_UNWIND_H
+#define __CLANG_UNWIND_H
+
#include <stdint.h>

#ifdef __cplusplus
@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
}
#endif

+#endif /* __CLANG_UNWIND_H */
+
#endif

-#endif /* __CLANG_UNWIND_H */
--
2.5.1
13 changes: 13 additions & 0 deletions srcpkgs/llvm23/patches/clang-003-ppc64-dynamic-linker-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
Loader = "ld.so.1";
break;
case llvm::Triple::ppc64:
- LibDir = "lib64";
- Loader =
- (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
- break;
case llvm::Triple::ppc64le:
LibDir = "lib64";
Loader =
16 changes: 16 additions & 0 deletions srcpkgs/llvm23/patches/compiler-rt-sanitizer-supported-arch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
+++ b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
@@ -42,9 +42,13 @@
set(ARM32 ${ARM32} armv7)
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} ${ALPHA})
+endif()
set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON}
${LOONGARCH64} ${ALPHA})
12 changes: 12 additions & 0 deletions srcpkgs/llvm23/patches/cross-compiler-as-configured.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
We want to always use clang and not rely on cmake to choose a gcc cross compiler.
--- a/llvm/cmake/modules/CrossCompile.cmake
+++ b/llvm/cmake/modules/CrossCompile.cmake
@@ -23,7 +23,7 @@
if (EXISTS ${LLVM_MAIN_SRC_DIR}/cmake/platforms/${toolchain}.cmake)
set(CROSS_TOOLCHAIN_FLAGS_INIT
-DCMAKE_TOOLCHAIN_FILE=\"${LLVM_MAIN_SRC_DIR}/cmake/platforms/${toolchain}.cmake\")
- elseif (NOT CMAKE_CROSSCOMPILING)
+ else()
set(CROSS_TOOLCHAIN_FLAGS_INIT
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
Loading