<div dir="ltr"><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div>Thanks for getting this figured out!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 14, 2017 at 3:58 PM, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The --build-id=... ld flag has been present since binutils-2.18,<br>
released 28 Aug 2007.<br>
---<br>
src/intel/vulkan/Makefile.am | 1 +<br>
src/intel/vulkan/anv_device.c | 28 +++++++---------------------<br>
2 files changed, 8 insertions(+), 21 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am<br>
index 95f276e..4197b0e 100644<br>
--- a/src/intel/vulkan/Makefile.am<br>
+++ b/src/intel/vulkan/Makefile.am<br>
@@ -165,6 +165,7 @@ libvulkan_intel_la_LDFLAGS = \<br>
-module \<br>
-no-undefined \<br>
-avoid-version \<br>
+ -Wl,--build-id=sha1 \<br>
$(BSYMBOLIC) \<br>
$(GC_SECTIONS) \<br>
$(LD_NO_UNDEFINED)<br>
diff --git a/src/intel/vulkan/anv_device.<wbr>c b/src/intel/vulkan/anv_device.<wbr>c<br>
index 91ee67f..b52287c 100644<br>
--- a/src/intel/vulkan/anv_device.<wbr>c<br>
+++ b/src/intel/vulkan/anv_device.<wbr>c<br>
@@ -21,18 +21,17 @@<br>
* IN THE SOFTWARE.<br>
*/<br>
<br>
-#include <dlfcn.h><br>
#include <assert.h><br>
#include <stdbool.h><br>
#include <string.h><br>
#include <sys/mman.h><br>
-#include <sys/stat.h><br>
#include <unistd.h><br>
#include <fcntl.h><br>
<br>
#include "anv_private.h"<br>
#include "util/strtod.h"<br>
#include "util/debug.h"<br>
+#include "util/build_id.h"<br>
<br>
#include "genxml/gen7_pack.h"<br>
<br>
@@ -55,30 +54,17 @@ compiler_perf_log(void *data, const char *fmt, ...)<br>
}<br>
<br>
static bool<br>
-anv_get_function_timestamp(<wbr>void *ptr, uint32_t* timestamp)<br>
-{<br>
- Dl_info info;<br>
- struct stat st;<br>
- if (!dladdr(ptr, &info) || !info.dli_fname)<br>
- return false;<br>
-<br>
- if (stat(info.dli_fname, &st))<br>
- return false;<br>
-<br>
- *timestamp = st.st_mtim.tv_sec;<br>
- return true;<br>
-}<br>
-<br>
-static bool<br>
anv_device_get_cache_uuid(void *uuid)<br>
{<br>
- uint32_t timestamp;<br>
+ const struct build_id_note *note = build_id_find_nhdr("libvulkan_<wbr>intel.so");<br>
+ if (!note)<br>
+ return false;<br>
<br>
- memset(uuid, 0, VK_UUID_SIZE);<br>
- if (!anv_get_function_timestamp(<wbr>anv_device_get_cache_uuid, ×tamp))<br>
+ unsigned len = build_id_length(note);<br>
+ if (len < VK_UUID_SIZE)<br>
return false;<br>
<br>
- snprintf(uuid, VK_UUID_SIZE, "anv-%d", timestamp);<br>
+ build_id_read(note, uuid, VK_UUID_SIZE);<br>
return true;<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.10.2<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>