From 70b48a9c0c55ced80607613f1f2b6159e3f959c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= Date: Fri, 7 Dec 2018 16:29:12 +0100 Subject: [PATCH] Problem: --version-script not used on OpenBSD Solution: switch to libtool symbol visibility support, which leads to more portable constructs in the autotools glue. As noted in the libtool documentation "This option has no effect on some platforms." After this commit, global symbols intended to be kept private will disappear on platforms that were previously not handled using -Wl,--version-script. --- Makefile.am | 12 +++++------- src/libzmq.vers | 4 ---- 2 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 src/libzmq.vers diff --git a/Makefile.am b/Makefile.am index 71e3f7a2..12a9a1c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -294,20 +294,17 @@ else if ON_LINUX src_libzmq_la_LDFLAGS = \ -version-info @LTVER@ \ - @LIBZMQ_EXTRA_LDFLAGS@ \ - -Wl,--version-script=$(srcdir)/src/libzmq.vers + @LIBZMQ_EXTRA_LDFLAGS@ else if ON_GNU src_libzmq_la_LDFLAGS = \ -version-info @LTVER@ \ - @LIBZMQ_EXTRA_LDFLAGS@ \ - -Wl,--version-script=$(srcdir)/src/libzmq.vers + @LIBZMQ_EXTRA_LDFLAGS@ else if ON_DEBIAN_KFREEBSD src_libzmq_la_LDFLAGS = \ -version-info @LTVER@ \ - @LIBZMQ_EXTRA_LDFLAGS@ \ - -Wl,--version-script=$(srcdir)/src/libzmq.vers + @LIBZMQ_EXTRA_LDFLAGS@ else src_libzmq_la_LDFLAGS = \ -version-info @LTVER@ \ @@ -320,6 +317,8 @@ endif endif endif +src_libzmq_la_LDFLAGS += -export-symbols-regex '^zmq_.*' + src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(LIBUNWIND_CFLAGS) src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(LIBUNWIND_CFLAGS) src_libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ $(CODE_COVERAGE_CXXFLAGS) \ @@ -1047,7 +1046,6 @@ EXTRA_DIST = \ version.sh \ src/libzmq.pc.cmake.in \ ci_build.sh \ - src/libzmq.vers \ src/version.rc.in \ tests/CMakeLists.txt \ unittests/CMakeLists.txt \ diff --git a/src/libzmq.vers b/src/libzmq.vers deleted file mode 100644 index 9a2d4154..00000000 --- a/src/libzmq.vers +++ /dev/null @@ -1,4 +0,0 @@ -{ - global: zmq_*; - local: *; -};