p11-glue / p11-kit

Provides a way to load and enumerate PKCS#11 modules.
https://p11-glue.github.io/p11-glue/p11-kit.html
Other
151 stars 94 forks source link

static library from p11-kit #355

Closed bulbalion closed 3 years ago

bulbalion commented 3 years ago

Hello, I'm trying to build elinks-0.14 with gnutls statically. The reason is GNU license. I would like to use elinks for a project and static binary would be nice. When I try to compile it I run into error due to p11-kit as follows: /usr/bin/ld: cannot find -lp11-kit It's compile using the -static gcc option. I tried to download p11-kit-0.23.22 and compile it using: ./configure --enable-static and I run into: configure: error: p11-kit cannot be used as a static library Is that intentional behavior or bug? Thank You & take care and thank You for Your work

ueno commented 3 years ago

I'm afraid to say it's intentional. p11-kit uses ELF constructor for library initialization and that wouldn't work otherwise. Although it is possible to expose an explicit initialization function as part of the API (currently used in tests but hidden), it would require the calling sites (e.g., gnutls) to call that function explicitly.

bulbalion commented 3 years ago

Thank You very much. That answers my question.