diff --git a/Makefile.am b/Makefile.am index 2876f648..190a7ac8 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 5614f791..b886058f 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 00000000..31ee4a90 --- /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 00000000..42df666b --- /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 00000000..db638f6d --- /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 00000000..4364f9f7 --- /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 <