llvmPackages_22.libclc: fix eval + build (#535109)

This commit is contained in:
Alyssa Ross
2026-06-25 10:15:09 +00:00
committed by GitHub
3 changed files with 14 additions and 2 deletions
@@ -24,6 +24,12 @@ stdenv.mkDerivation (finalAttrs: {
url = "https://github.com/KhronosGroup/SPIRV-Headers/commit/1a22b167081842915a1c78a0b5b5a353a23284aa.diff";
hash = "sha256-XUHfPHnk7bWK4vnozfW/84vaZN+rbFJUZSa6Og8GUAU=";
})
# Backport new predicated load/store instructions, needed by spirv-llvm-translator
# Not in any tagged releases yet, should exist in the next release after 1.4.350.1.
(fetchpatch {
url = "https://github.com/KhronosGroup/SPIRV-Headers/commit/b8a32968473ce852a809b9de5f04f02a5a9dfa78.patch";
hash = "sha256-59jmN28ifEhAxySXCpuGZ62jo1WVsRPnVosK8X4yrjM=";
})
];
nativeBuildInputs = [ cmake ];
@@ -1,6 +1,7 @@
{
lib,
stdenv,
srcOnly,
fetchFromGitHub,
fetchpatch,
cmake,
@@ -16,6 +17,11 @@ let
llvmMajor = lib.versions.major llvm.version;
versions = {
"22" = rec {
version = "22.1.3";
rev = "v${version}";
hash = "sha256-u/OytBH9LgAyGF9PX+5lmAbGPQ7iVv52w8mwQ+6fi/s=";
};
"21" = rec {
version = "21.1.0";
rev = "v${version}";
@@ -79,7 +85,7 @@ stdenv.mkDerivation {
"-DLLVM_SPIRV_BUILD_EXTERNAL=YES"
# RPATH of binary /nix/store/.../bin/llvm-spirv contains a forbidden reference to /build/
"-DCMAKE_SKIP_BUILD_RPATH=ON"
"-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${spirv-headers.src}"
"-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${srcOnly spirv-headers}"
]
++ lib.optional (
lib.toInt llvmMajor >= 19
@@ -97,7 +97,7 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ llvm ];
strictDeps = true;
postInstall = ''
postInstall = lib.optionalString (lib.versionOlder finalAttrs.version "22.1") ''
install -Dt $dev/bin prepare_builtins
'';