p11-kit uses hash_* namespace for hash related functions. But it is 1. too generic 2. may clash (and clashes indeed) with other libraries that also don't use library specific namespaces/prefixes. In my case, the application that uses gnutls and mysql-5.0 crashes at startup. Just because gnutls uses p11-kit now. p11-kit defines and exports hash_free(), gnutls calls it by the way. Mysql-5.0 also defines and exports a bunch of hash_* functions including hash_free(). Now, it's a matter of ls.so implementation how to deal with this collision. And in my cases mysql won. Therefore, attempt to initialize gnutls finishes with gnutls' try to call p11-kit's hash_free(), but because of name collision it calls hash_free() from mysql. Result: SIGSEGV and core dump (if enabled).
None of those functions should be exported by the library. Could you run the following, and post the output? $ objdump -T /usr/lib/libp11-kit.so
Created attachment 52575 [details] Result of "objdump -T /usr/local/lib/libp11-kit.so" for p11-kit-0.7 on FreeBSD-8.0 Attached. p11-kit-0.7. OS: FreeBSD-8.0 (if it has matter).
Created attachment 52576 [details] Result of "nm -BD /usr/local/lib/libp11-kit.so" for p11-kit-0.7 on FreeBSD-8.0 Result of "nm -BD /usr/local/lib/libp11-kit.so" attached also, just for any case.
p11-kit is explicitly built so the following symbols are exported: * Functions beginning in p11_kit_ * the C_FunctionGetList symbol FreeBSD doesn't seem to be respecting our -export-symbols-regex build options. See http://cgit.freedesktop.org/p11-glue/p11-kit/tree/p11-kit/Makefile.am#n42 Are you the p11-kit freebsd port maintainer? It would be worth working with him to try and get this to build correctly.
: Are you the p11-kit freebsd port maintainer? No. I'm just a user. Maintainer is novel@FreeBSD.org : It would be worth working with him to try and get this to build correctly. Thanks!
(In reply to comment #5) > : Are you the p11-kit freebsd port maintainer? > > No. I'm just a user. Maintainer is novel@FreeBSD.org > > : It would be worth working with him to try and get this to build correctly. > > Thanks! Thanks. If you or the maintainer have figured out how I can adjust the build so that only the correct symbols are exported on FreeBSD, then please send me patches to include. And if there really is no way fix the build easily, then I'll go through and rename things.
Use GCC __attribute__((visibility ("hidden"))) ? Or, what is essencially the same, turn on the "hidden" visibility by default and show selected symbols through __attribute__((visibility ("default"))) ?
That's a GCC specific solution, and p11-kit is the sort of thing that should work with other compilers as well. I'll think about this some more...
Should be fixed now with this commit. commit 5507dc4946f0a68cece5ec9e7096e0f9b8c55984 Author: Stef Walter <stefw@collabora.co.uk> Date: Mon Oct 24 08:05:43 2011 +0200 Rename non-static functions to have a _p11_xxx prefix. * Work around issues with brain-dead linkers not respecting the libtool -export-symbol-regex argument https://bugs.freedesktop.org/show_bug.cgi?id=42020
Thanks!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.