about summary refs log tree commit diff
path: root/pkgs/development/compilers/spirv-llvm-translator/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/spirv-llvm-translator/default.nix')
-rw-r--r--pkgs/development/compilers/spirv-llvm-translator/default.nix16
1 files changed, 14 insertions, 2 deletions
diff --git a/pkgs/development/compilers/spirv-llvm-translator/default.nix b/pkgs/development/compilers/spirv-llvm-translator/default.nix
index 88119d002808..80e4620c7dc6 100644
--- a/pkgs/development/compilers/spirv-llvm-translator/default.nix
+++ b/pkgs/development/compilers/spirv-llvm-translator/default.nix
@@ -16,7 +16,11 @@ let
 
   # ROCm, if actively updated will always be at the latest version
   branch =
-    if llvmMajor == "17" || isROCm then rec {
+    if llvmMajor == "18" then rec {
+      version = "18.1.0";
+      rev = "v${version}";
+      hash = "sha256-64guZiuO7VpaX01wNIjV7cnjEAe6ineMdY44S6sA33k=";
+    } else if llvmMajor == "17" || isROCm then rec {
       version = "17.0.0";
       rev = "v${version}";
       hash = "sha256-Rzm5Py9IPFtS9G7kME+uSwZ/0gPGW6MlL35ZWk4LfHM=";
@@ -48,7 +52,15 @@ disable-warnings-if-gcc13 (stdenv.mkDerivation {
     inherit (branch) rev hash;
   };
 
-  patches = lib.optionals (lib.versionAtLeast llvmMajor "15") [
+  patches = lib.optionals (llvmMajor == "18") [
+    # Fixes build after SPV_INTEL_maximum_registers breaking change
+    # TODO: remove on next spirv-headers release
+    (fetchpatch {
+      url = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/d970c9126c033ebcbb7187bc705eae2e54726b74.patch";
+      revert = true;
+      hash = "sha256-71sJuGqVjTcB549eIiCO0LoqAgxkdEHCoxh8Pd/Qzz8=";
+    })
+  ] ++ lib.optionals (lib.versionAtLeast llvmMajor "15" && lib.versionOlder llvmMajor "18") [
     # Fixes build after spirv-headers breaking change
     (fetchpatch {
       url = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/0166a0fb86dc6c0e8903436bbc3a89bc3273ebc0.patch";