clang_resource_dir.patch 1.1 KB

12345678910111213141516171819202122232425
  1. https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232#note_1776640
  2. https://gitlab.freedesktop.org/mesa/mesa/-/issues/7717#note_1832122
  3. diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp
  4. index 80bc84831e4..34d156bf227 100644
  5. --- a/src/compiler/clc/clc_helpers.cpp
  6. +++ b/src/compiler/clc/clc_helpers.cpp
  7. @@ -39,6 +39,7 @@
  8. #include <llvm-c/Target.h>
  9. #include <LLVMSPIRVLib/LLVMSPIRVLib.h>
  10. +#include <clang/Config/config.h>
  11. #include <clang/Driver/Driver.h>
  12. #include <clang/CodeGen/CodeGenAction.h>
  13. #include <clang/Lex/PreprocessorOptions.h>
  14. @@ -866,7 +867,7 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
  15. // because we might have linked clang statically.
  16. auto libclang_path = fs::path(LLVM_LIB_DIR) / "libclang.so";
  17. auto clang_res_path =
  18. - fs::path(clang::driver::Driver::GetResourcesPath(libclang_path.string())) / "include";
  19. + fs::path(clang::driver::Driver::GetResourcesPath(libclang_path.string(), CLANG_RESOURCE_DIR)) / "include";
  20. c->getHeaderSearchOpts().UseBuiltinIncludes = true;
  21. c->getHeaderSearchOpts().UseStandardSystemIncludes = true;