[Mesa-dev] [PATCH 22/23] HACK: anv: Fix query of ELF build-id on ARC++

Jason Ekstrand jason at jlekstrand.net
Sat Sep 2 17:20:39 UTC 2017


.
On Sat, Sep 2, 2017 at 1:17 AM, Chad Versace <chadversary at chromium.org>
wrote:

> NOT FOR UPSTREAM.
>
> To get the driver's build-id, anv_physical_device_init_uuids() searches
> the current process for an ELF phdr for filename "libvulkan_intel.so".
> However, Android requires that the library be named
> "vulkan.${board}.so".
>
> Fix it with a quick #ifdef hack.
>
> I have a plan to properly fix this by teaching src/util/build_id.c how
> to filter ELF phdrs by symbol address instead of by filename.
> ---
>  src/intel/vulkan/anv_device.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index 095e18ebb95..8cc760c3721 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -207,7 +207,17 @@ anv_physical_device_init_heaps(struct
> anv_physical_device *device, int fd)
>  static VkResult
>  anv_physical_device_init_uuids(struct anv_physical_device *device)
>  {
> -   const struct build_id_note *note = build_id_find_nhdr("libvulkan_
> intel.so");
> +#ifdef ANDROID /* HACK(chadv) */
> +   /* FINISHME(chadv): Stop searching for ELF headers based on hard-coded
> +    * library names. Intead, try comparing this function's address
> against the
> +    * virtual address ranges listed in the ELF header.
> +    */
> +   const char *lib_filename = "vulkan.cheets.so";
>

Back before we did build-id, Dave had a clever way of getting your hands on
the actual so name.  Take a look at 656e30b6860461b2bd725590488126d5e7e10ec1


> +#else
> +   const char *lib_filename = "libvulkan_intel.so";
> +#endif
> +
> +   const struct build_id_note *note = build_id_find_nhdr(lib_filename);
>     if (!note) {
>        return vk_errorf(VK_ERROR_INITIALIZATION_FAILED,
>                         "Failed to find build-id");
> --
> 2.13.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170902/71156c65/attachment.html>


More information about the mesa-dev mailing list