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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28134>
This commit is contained in:
Caio Oliveira 2024-03-12 10:27:09 -07:00 committed by Marge Bot
parent 6922f421f4
commit bfdcddfda9

View file

@ -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