Unverified Commit 4781916d authored by Luna Nova's avatar Luna Nova
Browse files

rocmPackages.rocm-comgr: bake fallback LLVM PATH to fix C++ stdlib search

parent 6df5d367
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -45,9 +45,18 @@ stdenv.mkDerivation (finalAttrs: {
    ./fix-ccob-compat-output-filename.patch
  ];

  postPatch = ''
  postPatch =
    # Fix relative path assumption for libllvm
    ''
      substituteInPlace cmake/opencl_header.cmake \
        --replace-fail "\''${CLANG_CMAKE_DIR}/../../../" "${llvm.clang-unwrapped.lib}"
    ''
    # Bake LLVM root for cfg/includes or HIPRTC can't find C++ stdlib headers (e.g. <type_traits>).
    + ''
      substituteInPlace src/comgr-env.cpp \
        --replace-fail \
          'return EnvLLVMPath;' \
          'return EnvLLVMPath ? EnvLLVMPath : "${llvm.rocm-toolchain}";'
    '';

  nativeBuildInputs = [