This is the mail archive of the libc-alpha@sourceware.org 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] When using the Mozilla NSS library for cryptography, include the NSPR header files


HelloÂAdhemerval.

I'll try to get back on the problem that you mention...

On Tue, 31/05/2016 at 11.39 -0300, Adhemerval Zanella wrote:
> 
> On 31/05/2016 09:35, Guido Trentalancia wrote:
> > When configuring and building GNU libc using the Mozilla NSS
> > library
> > for cryptography (--enable-nss-crypt option), also include the
> > NSPR header files along with the Mozilla NSS library header files.
> > 
> > Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
> 
> This patch is missing a proper ChangeLog [1]
> 
> [1] https://sourceware.org/glibc/wiki/Contribution%20checklist#Proper
> ly_Formatted_GNU_ChangeLog
> 
> > ---
> > ÂconfigureÂÂÂÂÂÂ|ÂÂÂÂ6 +++++-
> > Âconfigure.acÂÂÂ|ÂÂÂÂ6 +++++-
> > Âcrypt/Makefile |ÂÂÂÂ6 +++---
> > Â3 files changed, 13 insertions(+), 5 deletions(-)
> > 
> > --- glibc-31052016-0900GMT/configure	2016-05-30
> > 13:25:35.299696688 +0200
> > +++ glibc-configure-nss-crypt-include-nspr-headers/configure	
> > 2016-05-31 13:57:28.117571376 +0200
> > @@ -3501,8 +3501,12 @@ if test x$nss_crypt = xyes; then
> > ÂÂÂif test $? -ne 0; then
> > ÂÂÂÂÂas_fn_error $? "cannot find include directory with nss-config" 
> > "$LINENO" 5
> > ÂÂÂfi
> > +ÂÂnspr_includes=-I$(nspr-config --includedir 2>/dev/null)
> > +ÂÂif test $? -ne 0; then
> > +ÂÂÂÂas_fn_error $? "cannot find include directory with nspr-
> > config" "$LINENO" 5
> > +ÂÂfi
> > ÂÂÂold_CFLAGS="$CFLAGS"
> > -ÂÂCFLAGS="$CFLAGS $nss_includes"
> > +ÂÂCFLAGS="$CFLAGS $nss_includes $nspr_includes"
> 
> I tried to build it on Ubuntu 16.04 and even with the patch configure
> failed
> due it could not find libfreebl3.so.ÂÂOn this distro this is
> installed on
> /usr/lib/x86_64-linux-gnu/nss/ and I am not familiar with this
> project to say
> if this is the default folder, if it is something recently changed or
> if it a
> distro-based modification.ÂÂ

I suspect it is a distro-based modification.

FHS specifies different directories, please see:

http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s09.html
http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s10.html

Try adding "/usr/lib/x86_64-linux-gnu/nss/" to LDFLAGS and passing such
variable to configure, for example as follows (please adapt it to your
needs):

LDFLAGS="-L/usr/lib/x86_64-linux-gnu/nss" configure --enable-nss-crypt
--whatever-other-options-you-might-need

Best regards,

Guido Trentalancia

> Either way I think to fully re-enable the NSS
> configure option we need to take care of it.
> 
> > Â
> > Âcat confdefs.h - <<_ACEOF >conftest.$ac_ext
> > Â/* end confdefs.h.ÂÂ*/
> > --- glibc-31052016-0900GMT/configure.ac	2016-05-30
> > 13:25:35.299696688 +0200
> > +++ glibc-configure-nss-crypt-include-nspr-headers/configure.ac	
> > 2016-05-31 13:58:03.962731844 +0200
> > @@ -311,8 +311,12 @@ if test x$nss_crypt = xyes; then
> > ÂÂÂif test $? -ne 0; then
> > ÂÂÂÂÂAC_MSG_ERROR([cannot find include directory with nss-config])
> > ÂÂÂfi
> > +ÂÂnspr_includes=-I$(nspr-config --includedir 2>/dev/null)
> > +ÂÂif test $? -ne 0; then
> > +ÂÂÂÂAC_MSG_ERROR([cannot find include directory with nspr-config])
> > +ÂÂfi
> > ÂÂÂold_CFLAGS="$CFLAGS"
> > -ÂÂCFLAGS="$CFLAGS $nss_includes"
> > +ÂÂCFLAGS="$CFLAGS $nss_includes $nspr_includes"
> > ÂÂÂAC_COMPILE_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
> > Â#include <hasht.h>
> > Â#include <nsslowhash.h>
> > --- glibc-31052016-0900GMT/crypt/Makefile	2016-05-30
> > 13:25:35.306696710 +0200
> > +++ glibc-configure-nss-crypt-include-nspr-headers/crypt/Makefile	
> > 2016-05-31 14:28:38.995883272 +0200
> > @@ -37,9 +37,9 @@ routines += $(libcrypt-routines)
> > Âendif
> > Â
> > Âifeq ($(nss-crypt),yes)
> > -CPPFLAGS-sha256-crypt.c = -DUSE_NSS -I$(shell nss-config --
> > includedir)
> > -CPPFLAGS-sha512-crypt.c = -DUSE_NSS -I$(shell nss-config --
> > includedir)
> > -CPPFLAGS-md5-crypt.c = -DUSE_NSS -I$(shell nss-config --
> > includedir)
> > +CPPFLAGS-sha256-crypt.c = -DUSE_NSS -I$(shell nss-config --
> > includedir) -I$(shell nspr-config --includedir)
> > +CPPFLAGS-sha512-crypt.c = -DUSE_NSS -I$(shell nss-config --
> > includedir) -I$(shell nspr-config --includedir)
> > +CPPFLAGS-md5-crypt.c = -DUSE_NSS -I$(shell nss-config --
> > includedir) -I$(shell nspr-config --includedir)
> > ÂLDLIBS-crypt.so = -lfreebl3
> > Âelse
> > Âlibcrypt-routines += md5 sha256 sha512
> > 
> 


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