From 8a453669e2bd44651cacdeac1c372d6e80cab0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= Date: Mon, 2 Dec 2024 18:29:19 +0100 Subject: [PATCH] fix(FTBFS): clc/clover: pass a VFS instance explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This just replicates what upstream did before breaking mesa with commit df9a14d7bbf and requiring a VFS instance. Reported-by: @Lone_Wolf Reference: Closes: Signed-off-by: Kai Wasserbäch Tested-by: Dieter Nützel Reviewed-by: Karol Herbst Part-of: --- src/compiler/clc/clc_helpers.cpp | 10 +++++++++- src/gallium/frontends/clover/llvm/invocation.cpp | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git src/compiler/clc/clc_helpers.cpp src/compiler/clc/clc_helpers.cpp index f3f884b21809..ce0563d7f4fd 100644 --- src/compiler/clc/clc_helpers.cpp +++ src/compiler/clc/clc_helpers.cpp @@ -56,6 +56,10 @@ #include #include +#if LLVM_VERSION_MAJOR >= 20 +#include +#endif + #include "util/macros.h" #include "glsl_types.h" @@ -841,7 +845,11 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx, // http://www.llvm.org/bugs/show_bug.cgi?id=19735 c->getDiagnosticOpts().ShowCarets = false; - c->createDiagnostics(new clang::TextDiagnosticPrinter( + c->createDiagnostics( +#if LLVM_VERSION_MAJOR >= 20 + *llvm::vfs::getRealFileSystem(), +#endif + new clang::TextDiagnosticPrinter( diag_log_stream, &c->getDiagnosticOpts())); diff --git src/gallium/frontends/clover/llvm/invocation.cpp src/gallium/frontends/clover/llvm/invocation.cpp index d2e238c880bd..3cbb05baecf6 100644 --- src/gallium/frontends/clover/llvm/invocation.cpp +++ src/gallium/frontends/clover/llvm/invocation.cpp @@ -40,6 +40,10 @@ #include #include +#if LLVM_VERSION_MAJOR >= 20 +#include +#endif + // We need to include internal headers last, because the internal headers // include CL headers which have #define's like: // @@ -305,7 +309,11 @@ namespace { ::llvm::Triple(target.triple), get_language_version(opts, device_clc_version)); - c->createDiagnostics(new clang::TextDiagnosticPrinter( + c->createDiagnostics( +#if LLVM_VERSION_MAJOR >= 20 + *llvm::vfs::getRealFileSystem(), +#endif + new clang::TextDiagnosticPrinter( *new raw_string_ostream(r_log), &c->getDiagnosticOpts(), true)); -- GitLab