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

Chad Versace chadversary at chromium.org
Sat Sep 2 08:17:45 UTC 2017


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



More information about the mesa-dev mailing list