[PATCH v4] When using the Mozilla NSS library for cryptography, include the NSPR header files

Florian Weimer fweimer@redhat.com
Sat Jun 11 09:06:00 GMT 2016


On 06/11/2016 10:02 AM, Mike Frysinger wrote:

>> Isn't using pkg-config in a GNU project a bit tricky?
>
> i don't see why it would be.  it's pretty much defacto now for any
> reasonable library.  GNOME, a GNU project, is heavily invested in
> it.

glibc doesn't provide pkg-config data, either. :-/

(You'd need it for statically linking libcrypt when using NSS.  Might 
also help with the libpthread.a situation.)

>> In any case, Mozilla does not publish pkg-config data as far as I can
>> see, and downstreams probably vary in what they do.  For example, Fedora
>> does not provide pkg-config data for libfreebl at all.
>
> sorry, i thought the pc file was from upstream.  then again, i'll note
> that the nss-config script isn't upstream either, so we're in the same
> situation: we're left with whatever distros have done.

Oh.

>>  You can link
>> against NSS, but then you also get libdl and libpthread, which we do not
>> want as dependencies of libgcrypt.
>
> i'm not sure what you're saying here.  `pkg-config --libs nss` doesn't
> pull in any of those libs.

I get this:

-lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl

And if freebl needs nspr headers, it may pull in libnspr as well, which 
depends on libpthread.

I do not have a strong opinion on this matter.  It's messy, so whatever 
works is okay.  But please add a test which does something like dlopen 
(LIBPTHREAD_SO, RTLD_LAZY | RTLD_NOLOAD) and check that it returns NULL 
after linking against libcrypt (and using the crypt function).

Thanks,
Florian



More information about the Libc-alpha mailing list