NSS 3.29 fails to compile on Linux/x86_64

RESOLVED FIXED

Status

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: mozilla, Unassigned)

Tracking

3.29

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (X11; CrOS x86_64 9202.18.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.32 Safari/537.36

Steps to reproduce:

Try to cross-compile NSS 3.29 for Linux/x86_64 (from a different platform of Linux/x86_64)


Actual results:

It did not compile, instead gave this error:

cc -o Linux4.1_x86_64_glibc_PTH_64_OPT.OBJ/secoid.o -c -O2 -fPIC  -m64 -pipe -ffunction-sections -fdata-sections -DHAVE_STRERROR -DLINUX -Dlinux -Wall -Werror -DXP_UNIX -UDEBUG -DNDEBUG -D_REENTRANT -DNSS_NO_IN
IT_SUPPORT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I/include/nspr -I../../../dist/Linux4.1_x86_64_glibc_PTH_64_OPT.OBJ/include -I../../../dist/public/nss -I../../..
/dist/private/nss  secoid.c
secoid.c: In function 'SECOID_Init':
secoid.c:2034:5: error: implicit declaration of function 'PR_GetEnvSecure' [-Werror=implicit-function-declaration]
     if (!PR_GetEnvSecure("NSS_ALLOW_WEAK_SIGNATURE_ALG")) {
     ^
secoid.c:2049:12: error: assignment makes pointer from integer without a cast [-Werror]
     envVal = PR_GetEnvSecure("NSS_HASH_ALG_SUPPORT");
            ^
cc1: all warnings being treated as errors
../../coreconf/rules.mk:392: recipe for target 'Linux4.1_x86_64_glibc_PTH_64_OPT.OBJ/secoid.o' failed
make[4]: *** [Linux4.1_x86_64_glibc_PTH_64_OPT.OBJ/secoid.o] Error 1
make[4]: Leaving directory '/home/rkeene/devel/aurae/node/root/packages/nss/workdir-DiNIYo1i4.F2/nss/lib/util'
../coreconf/rules.mk:101: recipe for target 'libs' failed
make[3]: *** [libs] Error 2


Expected results:

No error, just compile
What's the platform and OS you use to make the compilation? And how does your setup look like (which toolchain etc)?
Flags: needinfo?(mozilla)
(Reporter)

Comment 2

2 years ago
As I originally indicated, I am on Linux/x86_64 cross-compiling for Linux/x86_64.

I am using GCC 4.9.3 with GNU binutils 2.25.1.
Flags: needinfo?(mozilla)
> I am on Linux/x86_64 cross-compiling for Linux/x86_64.

That's not cross-compiling.

> -I/include/nspr 

I'm not sure where this bit is coming from. It's not part of the normal build process. Looks like your build includes the system nspr, which is probably too old.
(Reporter)

Comment 4

2 years ago
(In reply to Franziskus Kiefer [:fkiefer or :franziskus] from comment #3)
> > I am on Linux/x86_64 cross-compiling for Linux/x86_64.
> 
> That's not cross-compiling.

In what way is compiling from one platform to another not cross-compiling ?  Just because it happens to be the same kernel and CPU architecture ?  I certainly can't run the binaries compiled on the build system that are being cross-compiled for the host system.

> 
> > -I/include/nspr 
> 
> I'm not sure where this bit is coming from. It's not part of the normal
> build process. Looks like your build includes the system nspr, which is
> probably too old.

That's where the headers for NSPR are, relative to the host platform's system root using the cross-compiler.  I used NSPR 4.10.7.

Is it documented somewhere what version of NSPR is required for NSS 3.29 ?
> > -I/include/nspr
> That's where the headers for NSPR are, relative to the host platform's system root using the cross-compiler.  I used NSPR 4.10.7.

That's the absolute path to your system NSPR. You need NSPR 4.13.1 for NSS 3.29.

> Is it documented somewhere what version of NSPR is required for NSS 3.29 ?

yep, here: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.29_release_notes
(Reporter)

Comment 6

2 years ago
It's not the absolute path, the C preprocessor does not require an absolute path(In reply to Franziskus Kiefer [:fkiefer or :franziskus] from comment #5)
> > > -I/include/nspr
> > That's where the headers for NSPR are, relative to the host platform's system root using the cross-compiler.  I used NSPR 4.10.7.
> 
> That's the absolute path to your system NSPR. You need NSPR 4.13.1 for NSS
> 3.29.

It's not an absolute path.  The C preprocessor for my cross-compiler looks in the configured sysroot, the actual path is something like /home/rkeene/devel/cross-compilers/x86_64-vendor-linux-gnu/blah/blah/include.

See the "--with-sysroot" option to the configure script for GCC for further details.

> 
> > Is it documented somewhere what version of NSPR is required for NSS 3.29 ?
> 
> yep, here:
> https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.
> 29_release_notes

Ah, thank you !  I missed it when I first worked on the upgrade to NSS 3.29 and can confirm that both NSS 3.29 and NSS 3.29.2 work with NSPR 4.13.1 for me.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.