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

Tapani Pälli tapani.palli at intel.com
Mon Sep 4 05:37:03 UTC 2017



On 09/02/2017 11:17 AM, Chad Versace 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".

I don't think this requirement exists, we are using libvulkan_intel.so 
on Android IA and running Vulkan aps. It's up to the HAL implementation 
to choose what library it opens.


> 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";
> +#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");
> 


More information about the mesa-dev mailing list