Mesa (master): anv: automake: use VISIBILITY_CFLAGS to restrict symbol visibility

Emil Velikov evelikov at kemper.freedesktop.org
Thu Aug 18 14:39:51 UTC 2016


Module: Mesa
Branch: master
Commit: 40e4fff563ef1448656b1d3e6c11f5bd0c0b9e8a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=40e4fff563ef1448656b1d3e6c11f5bd0c0b9e8a

Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Thu Jul 28 14:40:08 2016 +0100

anv: automake: use VISIBILITY_CFLAGS to restrict symbol visibility

Hide the internal symbols and annotate the vk_icdGetInstanceProcAddr as public
since the loader needs it (since v1 of the loader interface).

v2: Add VISIBILITY_CFLAGS to AM_CFLAGS (Ken)

Cc: "12.0" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net> (v1)
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

---

 src/intel/vulkan/Makefile.am  | 4 +++-
 src/intel/vulkan/anv_device.c | 6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am
index 73db8f5..c621c34 100644
--- a/src/intel/vulkan/Makefile.am
+++ b/src/intel/vulkan/Makefile.am
@@ -61,7 +61,9 @@ AM_CPPFLAGS = \
 	-I$(top_builddir)/src/intel \
 	-I$(top_srcdir)/src/intel
 
-AM_CFLAGS = -Wno-override-init -msse2
+AM_CFLAGS = \
+	$(VISIBILITY_CFLAGS) \
+	-Wno-override-init -msse2
 
 libanv_gen7_la_CFLAGS = $(AM_CFLAGS) -DGEN_VERSIONx10=70
 libanv_gen7_la_SOURCES = $(GEN7_FILES)
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index e64790e..3f1334b 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -659,13 +659,15 @@ PFN_vkVoidFunction anv_GetInstanceProcAddr(
    return anv_lookup_entrypoint(pName);
 }
 
-/* The loader wants us to expose a second GetInstanceProcAddr function
- * to work around certain LD_PRELOAD issues seen in apps.
+/* With version 1+ of the loader interface the ICD should expose
+ * vk_icdGetInstanceProcAddr to work around certain LD_PRELOAD issues seen in apps.
  */
+PUBLIC
 VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(
     VkInstance                                  instance,
     const char*                                 pName);
 
+PUBLIC
 VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(
     VkInstance                                  instance,
     const char*                                 pName)




More information about the mesa-commit mailing list