From bfdcddfda987237a2e637ce7c32dc66ec4767d8e Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Tue, 12 Mar 2024 10:27:09 -0700 Subject: [PATCH] intel/tools: Make intel_stub_gpu work when using meson devenv When `meson devenv` is used, the shim library that is meant to be preloaded is not necessarily available at the installation dir. So when running in that mode both the script and the shim library will be in the same (build) directory, so adjust the ld_preload to pick that. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10798 Part-of: --- src/intel/tools/intel_stub_gpu.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/intel/tools/intel_stub_gpu.in b/src/intel/tools/intel_stub_gpu.in index 4a35678119f..ea3e3054c33 100755 --- a/src/intel/tools/intel_stub_gpu.in +++ b/src/intel/tools/intel_stub_gpu.in @@ -70,7 +70,13 @@ done INTEL_STUB_GPU_PLATFORM=$platform -ld_preload="@install_libdir@/libintel_noop_drm_shim.so${LD_PRELOAD:+:$LD_PRELOAD}" +drm_shim_dir="@install_libdir@" + +if [ -n "$MESON_DEVENV" ]; then + drm_shim_dir=$(realpath "$(dirname "$0")") +fi + +ld_preload="$drm_shim_dir/libintel_noop_drm_shim.so${LD_PRELOAD:+:$LD_PRELOAD}" if [ -n "$gdb" ]; then gdb -iex "set exec-wrapper env LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform" --args "$@" elif [ -n "$valgrind" ]; then