<div dir="ltr"><div class="gmail_extra">.<br><div class="gmail_quote">On Sat, Sep 2, 2017 at 1:17 AM, Chad Versace <span dir="ltr"><<a href="mailto:chadversary@chromium.org" target="_blank">chadversary@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">NOT FOR UPSTREAM.<br>
<br>
To get the driver's build-id, anv_physical_device_init_<wbr>uuids() searches<br>
the current process for an ELF phdr for filename "libvulkan_intel.so".<br>
However, Android requires that the library be named<br>
"vulkan.${board}.so".<br>
<br>
Fix it with a quick #ifdef hack.<br>
<br>
I have a plan to properly fix this by teaching src/util/build_id.c how<br>
to filter ELF phdrs by symbol address instead of by filename.<br>
---<br>
 src/intel/vulkan/anv_device.c | 12 +++++++++++-<br>
 1 file changed, 11 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_device.<wbr>c b/src/intel/vulkan/anv_device.<wbr>c<br>
index 095e18ebb95..8cc760c3721 100644<br>
--- a/src/intel/vulkan/anv_device.<wbr>c<br>
+++ b/src/intel/vulkan/anv_device.<wbr>c<br>
@@ -207,7 +207,17 @@ anv_physical_device_init_<wbr>heaps(struct anv_physical_device *device, int fd)<br>
 static VkResult<br>
 anv_physical_device_init_<wbr>uuids(struct anv_physical_device *device)<br>
 {<br>
-   const struct build_id_note *note = build_id_find_nhdr("libvulkan_<wbr>intel.so");<br>
+#ifdef ANDROID /* HACK(chadv) */<br>
+   /* FINISHME(chadv): Stop searching for ELF headers based on hard-coded<br>
+    * library names. Intead, try comparing this function's address against the<br>
+    * virtual address ranges listed in the ELF header.<br>
+    */<br>
+   const char *lib_filename = "<a href="http://vulkan.cheets.so" rel="noreferrer" target="_blank">vulkan.cheets.so</a>";<br></blockquote><div><br></div><div>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<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+#else<br>
+   const char *lib_filename = "libvulkan_intel.so";<br>
+#endif<br>
+<br>
+   const struct build_id_note *note = build_id_find_nhdr(lib_<wbr>filename);<br>
    if (!note) {<br>
       return vk_errorf(VK_ERROR_<wbr>INITIALIZATION_FAILED,<br>
                        "Failed to find build-id");<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
2.13.5<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>