From 5ea5c5d48e049d7b10b7ffb814e84e3ddef7fff9 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 25 Apr 2025 19:00:14 -0700
Subject: [PATCH] gallium/clover: Do not use LLVM_LIBRARY_DIR for
 FALLBACK_CLANG_RESOURCE_DIR

This option -DFALLBACK_CLANG_RESOURCE_DIR is synthesized by meson from
LLVM_LIBRARY_DIR which is resolved to absolute path under <recipe_sysroot>
and its used in clover front-end as string in .c files, which encodes it
into binary as string and shows up in yocto QA error.

ERROR: mesa-2_25.0.2-r0 do_package_qa: QA Issue: File /usr/lib/libMesaOpenCL.so.1.0.0 in package libopencl-mesa contains reference to TMPDIR [buildpaths]
ERROR: mesa-2_25.0.2-r0 do_package_qa: Fatal QA errors were found, failing task.
ERROR: Logfile of failure stored in: /mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux/mesa/25.0.2/temp/log.do_package_qa.974870

Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/gallium/frontends/clover/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/frontends/clover/meson.build b/src/gallium/frontends/clover/meson.build
index 56a9894..32c21d6 100644
--- a/src/gallium/frontends/clover/meson.build
+++ b/src/gallium/frontends/clover/meson.build
@@ -43,7 +43,7 @@ libclllvm = static_library(
     clover_cpp_args,
     clover_opencl_cpp_args,
     '-DFALLBACK_CLANG_RESOURCE_DIR="@0@"'.format(join_paths(
-      dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang',
+     '/usr/lib/clang',
       dep_llvm.version()
     )),
   ],
