about summary refs log tree commit diff
path: root/pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix
blob: 1fd72ee67188f8ecd5a9c818a7aee7d1f57b22f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ stdenv
, callPackage
, rocmUpdateScript
, llvm
, clang
, spirv-llvm-translator
}:

let
  spirv = (spirv-llvm-translator.override { inherit llvm; });
in callPackage ../base.nix rec {
  inherit stdenv rocmUpdateScript;
  buildDocs = false; # No documentation to build
  buildMan = false; # No man pages to build
  targetName = "libclc";
  targetDir = targetName;
  extraBuildInputs = [ spirv ];

  # `spirv-mesa3d` isn't compiling with LLVM 15.0.0, it does with LLVM 14.0.0
  # Try removing the `spirv-mesa3d` and `clspv` patches next update
  # `clspv` tests fail, unresolved calls
  extraPostPatch = ''
    substituteInPlace CMakeLists.txt \
      --replace "find_program( LLVM_CLANG clang PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \
        "find_program( LLVM_CLANG clang PATHS \"${clang}/bin\" NO_DEFAULT_PATH )" \
      --replace "find_program( LLVM_SPIRV llvm-spirv PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \
        "find_program( LLVM_SPIRV llvm-spirv PATHS \"${spirv}/bin\" NO_DEFAULT_PATH )" \
      --replace "  spirv-mesa3d-" "" \
      --replace "  spirv64-mesa3d-" "" \
      --replace "NOT \''${t} MATCHES" \
        "NOT \''${ARCH} STREQUAL \"clspv\" AND NOT \''${ARCH} STREQUAL \"clspv64\" AND NOT \''${t} MATCHES"
  '';

  checkTargets = [ ];
  isBroken = true; # ROCm 5.7.0 doesn't have IR/AttributeMask.h yet...?
}