This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] [BZ 17956] Fix build failure due to missing definitions from header file nss/nss.h when Mozilla NSS is used for cryptography

Hello Adhemerval,

thanks for getting back about this patch and the other issues with the
header inclusion system.

Il giorno mar, 31/05/2016 alle 12.09 -0300, Adhemerval Zanella ha
> On 31/05/2016 10:20, Guido Trentalancia wrote:
> > A build failure might occur when glibc is configured with the
> > --enable-nss-crypt option in order to use Mozilla NSS library for
> > cryptography.
> > 
> > Such failure is due to conflicting "nss.h" header files: one from
> > GNU
> > glibc and the other from the Mozilla NSS library (usually located
> > at
> > /usr/include/nss3/nss.h).
> > 
> > For example, a build configuration that leads to the occurrence of
> > this
> > bug includes passing the Mozilla NSS library headers full path to
> > the
> > preprocessor using CPPFLAGS.
> > 
> > This patch aims to fix such build failure (BZ 17956) by helping the
> > preprocessor pick the right (local) "nss.h" header file during
> > compilation.
> > 
> > This new version includes amendments to both source and test files
> > (in a
> > unique patch instead of two separate patches).
> This is missing a proper ChangeLog [1]

I can write one if needed. However, the patch is trivial (it mostly
just sources nss.h differently using a relative path, a not much more).

> Besides that I am not following this patch.ÂÂThe only function
> defined in
> nss/nss.h is __nss_configure_lookup along with some other internal
> defines
> (NSS_STATUS_*).ÂÂThe ABI from libnss3 nss.h file is completely
> different
> I am not seeing how we can just replace its inclusion.

Wherever you see <nss/nss.h> or "nss.h" or similar within GNU libc it
is meant nss.h from GNU libc and not from libnss3.

However under some circumstances it might happen that the latter is
sourced instead of the GNU libc, causing a build failure.

> My understanding is trying to building using configured provided
> defies the proper configure check plus makefile rules that uses
> system
> provides nss-config and nspr-config commands to get the very include
> and library directories (and as you pointed out in a earlier message
> it seems also broken [2]).

[2] is another patch that is highly recommended, although it won't
completely solve BZ 17956, it might only prevent it from happening.

To make the inclusion of nss.h from GNU libc robust this patch is
necessary even when [2] has been applied.

> So I think the proper way to re-enable external nss build is first
> correct
> the configure checks and instead of passing the external flags
> through
> CPPFLAGS, to make sure the intended nss-config/nspr-config are on
> for both configure check and makefile rule generation to get the
> correct
> flags.

As already explained, it is highly recommended that [2] is applied
([PATCH v2] When using the Mozilla NSS library for cryptography,
include the NSPR header files).

Then this patch should be applied to make the build system completely
robust, even against modified CPPFLAGS.

Finally, a third patch should be applied to prevent false positives
(FAIL) in one test:Â[PATCH v2] Ignore nspr headers directory when
checking local headers

I recommend to apply all the three patches as soon as possible so that
the build and test systems are sane and robust when using the Mozilla
NSS library for cryptography !

Please let me know if the ChangeLog is required for the first two
patches and I will be glad to prepare one (what has been changed is
trivial and explained in the header of each patch).

Best regards,

Guido Trentalancia

> [1]
> ormatted_GNU_ChangeLog
> [2]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]