diff --git a/pkgs/development/compilers/llvm/git/default.nix b/pkgs/development/compilers/llvm/git/default.nix index 45a16b5e09eb..f968ebecb2c8 100644 --- a/pkgs/development/compilers/llvm/git/default.nix +++ b/pkgs/development/compilers/llvm/git/default.nix @@ -274,6 +274,12 @@ in let nixSupport.cc-cflags = [ "-fno-exceptions" ]; }); + # Has to be in tools despite mostly being a library, + # because we use a native helper executable from a + # non-cross build in cross builds. + libclc = callPackage ../common/libclc.nix { + inherit buildLlvmTools; + }; }); libraries = lib.makeExtensible (libraries: let 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";