[Cryptech-Commits] [sw/pkcs11] 02/02: Shared library symbol versioning support from Ondrej Sury (thanks!).

git at cryptech.is git at cryptech.is
Thu Aug 11 01:35:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch master
in repository sw/pkcs11.

commit ef142cd0ba5e60baee56b8aaafac9a835958a679
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Wed Aug 10 21:06:04 2016 -0400

    Shared library symbol versioning support from Ondrej Sury (thanks!).
    
    Apparently this is how the cool kids handle hiding library-internal
    symbols now, using objcopy is old hat.  Ondrey tells us that this
    should work on GNU/Linux and on *BSD, which, at the moment, just
    leaves OSX, which we already handle with an OSX-specific kludge.
---
 Makefile               | 4 +---
 libcryptech-pkcs11.map | 6 ++++++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 95fce05..0eb86e3 100644
--- a/Makefile
+++ b/Makefile
@@ -179,9 +179,7 @@ ifeq "${UNAME}" "Darwin"
 else
 
   ${SONAME}: pkcs11.o ${LIBS}
-	${CC} ${CFLAGS} -shared -o $@.tmp $^ ${SOFLAGS} ${LDFLAGS}
-	${OBJCOPY} -w -G 'C_*' $@.tmp $@
-	rm -f $@.tmp
+	${CC} ${CFLAGS} -Wl,--version-script=libcryptech-pkcs11.map -shared -o $@ $^ ${SOFLAGS} ${LDFLAGS}
 
 endif
 
diff --git a/libcryptech-pkcs11.map b/libcryptech-pkcs11.map
new file mode 100644
index 0000000..11c3036
--- /dev/null
+++ b/libcryptech-pkcs11.map
@@ -0,0 +1,6 @@
+LIBCRYPTECH_PKCS11_2.0 {
+    global:
+	C_*;
+    local:
+	*;
+};



More information about the Commits mailing list