=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: build: Use linker version scripts to control visibility.
Alexandre Julliard
julliard at winehq.org
Mon Jan 15 10:54:12 CST 2018
Module: vkd3d
Branch: master
Commit: 41715a2f33e1e73395e9b1be5effb42058a372c1
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=41715a2f33e1e73395e9b1be5effb42058a372c1
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Mon Jan 15 13:49:01 2018 +0100
build: Use linker version scripts to control visibility.
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
Makefile.am | 9 +++++++
configure.ac | 2 ++
libs/vkd3d-shader/vkd3d_shader.map | 14 +++++++++++
libs/vkd3d-utils/vkd3d_utils.map | 13 +++++++++++
libs/vkd3d/vkd3d.map | 18 ++++++++++++++
m4/ld-version-script.m4 | 48 ++++++++++++++++++++++++++++++++++++++
6 files changed, 104 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 2876f64..190a7ac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,9 @@ libvkd3d_shader_la_SOURCES = \
libs/vkd3d-shader/vkd3d_shader_main.c \
libs/vkd3d-shader/vkd3d_shader_private.h
libvkd3d_shader_la_LIBADD = libvkd3d-common.la @SPIRV_TOOLS_LIBS@
+if HAVE_LD_VERSION_SCRIPT
+libvkd3d_shader_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libs/vkd3d-shader/vkd3d_shader.map
+endif
libvkd3d_la_SOURCES = \
include/d3d12.idl \
@@ -85,11 +88,17 @@ libvkd3d_la_SOURCES = \
libs/vkd3d/vkd3d_private.h \
libs/vkd3d/vulkan_procs.h
libvkd3d_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la @PTHREAD_LIBS@ @VULKAN_LIBS@
+if HAVE_LD_VERSION_SCRIPT
+libvkd3d_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libs/vkd3d/vkd3d.map
+endif
libvkd3d_utils_la_SOURCES = \
libs/vkd3d-utils/vkd3d_utils_main.c \
libs/vkd3d-utils/vkd3d_utils_private.h
libvkd3d_utils_la_LIBADD = libvkd3d-common.la libvkd3d.la
+if HAVE_LD_VERSION_SCRIPT
+libvkd3d_utils_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libs/vkd3d-utils/vkd3d_utils.map
+endif
EXTRA_DIST = LICENSE
diff --git a/configure.ac b/configure.ac
index 5614f79..b886058 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,8 @@ AM_SILENT_RULES([yes])
LT_PREREQ([2.4.2])
LT_INIT
+gl_LD_VERSION_SCRIPT
+
dnl Check compiler specific flags
AC_SUBST([VKD3D_CFLAGS])
AS_IF([test "x${GCC}" = "xyes"],
diff --git a/libs/vkd3d-shader/vkd3d_shader.map b/libs/vkd3d-shader/vkd3d_shader.map
new file mode 100644
index 0000000..31ee4a9
--- /dev/null
+++ b/libs/vkd3d-shader/vkd3d_shader.map
@@ -0,0 +1,14 @@
+{
+global:
+ vkd3d_shader_compile_dxbc;
+ vkd3d_shader_find_signature_element;
+ vkd3d_shader_free_root_signature;
+ vkd3d_shader_free_shader_code;
+ vkd3d_shader_free_shader_signature;
+ vkd3d_shader_parse_input_signature;
+ vkd3d_shader_parse_root_signature;
+ vkd3d_shader_scan_dxbc;
+ vkd3d_shader_serialize_root_signature;
+
+local: *;
+};
diff --git a/libs/vkd3d-utils/vkd3d_utils.map b/libs/vkd3d-utils/vkd3d_utils.map
new file mode 100644
index 0000000..42df666
--- /dev/null
+++ b/libs/vkd3d-utils/vkd3d_utils.map
@@ -0,0 +1,13 @@
+{
+global:
+ D3D12CreateDevice;
+ D3D12CreateRootSignatureDeserializer;
+ D3D12GetDebugInterface;
+ D3D12SerializeRootSignature;
+ vkd3d_create_event;
+ vkd3d_destroy_event;
+ vkd3d_signal_event;
+ vkd3d_wait_event;
+
+local: *;
+};
diff --git a/libs/vkd3d/vkd3d.map b/libs/vkd3d/vkd3d.map
new file mode 100644
index 0000000..db638f6
--- /dev/null
+++ b/libs/vkd3d/vkd3d.map
@@ -0,0 +1,18 @@
+{
+global:
+ vkd3d_create_device;
+ vkd3d_create_image_resource;
+ vkd3d_create_instance;
+ vkd3d_create_root_signature_deserializer;
+ vkd3d_get_vk_device;
+ vkd3d_get_vk_format;
+ vkd3d_get_vk_instance;
+ vkd3d_get_vk_physical_device;
+ vkd3d_get_vk_queue;
+ vkd3d_get_vk_queue_family_index;
+ vkd3d_instance_decref;
+ vkd3d_instance_incref;
+ vkd3d_serialize_root_signature;
+
+local: *;
+};
diff --git a/m4/ld-version-script.m4 b/m4/ld-version-script.m4
new file mode 100644
index 0000000..4364f9f
--- /dev/null
+++ b/m4/ld-version-script.m4
@@ -0,0 +1,48 @@
+# ld-version-script.m4 serial 4
+dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# FIXME: The test below returns a false positive for mingw
+# cross-compiles, 'local:' statements does not reduce number of
+# exported symbols in a DLL. Use --disable-ld-version-script to work
+# around the problem.
+
+# gl_LD_VERSION_SCRIPT
+# --------------------
+# Check if LD supports linker scripts, and define automake conditional
+# HAVE_LD_VERSION_SCRIPT if so.
+AC_DEFUN([gl_LD_VERSION_SCRIPT],
+[
+ AC_ARG_ENABLE([ld-version-script],
+ [AS_HELP_STRING([--enable-ld-version-script],
+ [enable linker version script (default is enabled when possible)])],
+ [have_ld_version_script=$enableval],
+ [AC_CACHE_CHECK([if LD -Wl,--version-script works],
+ [gl_cv_sys_ld_version_script],
+ [gl_cv_sys_ld_version_script=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+ echo foo >conftest.map
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ [],
+ [cat > conftest.map <<EOF
+VERS_1 {
+ global: sym;
+};
+
+VERS_2 {
+ global: sym;
+} VERS_1;
+EOF
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ [gl_cv_sys_ld_version_script=yes])])
+ rm -f conftest.map
+ LDFLAGS=$save_LDFLAGS])
+ have_ld_version_script=$gl_cv_sys_ld_version_script])
+ AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT],
+ [test "$have_ld_version_script" = yes])
+])
More information about the wine-cvs
mailing list