This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4] When using the Mozilla NSS library for cryptography, include the NSPR header files
- From: Florian Weimer <fweimer at redhat dot com>
- To: Guido Trentalancia <guido at trentalancia dot net>, GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Sat, 11 Jun 2016 11:06:18 +0200
- Subject: Re: [PATCH v4] When using the Mozilla NSS library for cryptography, include the NSPR header files
- Authentication-results: sourceware.org; auth=none
- References: <1464696577 dot 24965 dot 16 dot camel at trentalancia dot net> <1464698125 dot 24965 dot 18 dot camel at trentalancia dot net> <1464717048 dot 2379 dot 43 dot camel at trentalancia dot net> <1464722725 dot 2379 dot 62 dot camel at trentalancia dot net> <20160611060459 dot GK4053 at vapier dot lan> <5d5b4212-9baf-159a-8af9-b7f9132d39c9 at redhat dot com> <20160611080252 dot GM4053 at vapier dot lan>
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