I am building 64-bit nss 3.39 on Windows 10 with Microsoft Visual Studio 2017. It failed with the error:
error C4235: nonstandard extension used : '__asm' keyword not supported on this architecture
Has anyone faced this issue? Need solution on this.
Steps I followed:
- Installed Visual Studio 2017 (Enterprise trial edition) as mentioned in the Windows Prerequisites for Firefox build.
- Installed Rust.
- Installed MozillaBuild, downloaded from MozillaBuild Package.
- Downloaded the NSS package of release 3.39 (nss-3.39-with-nspr-4.20.tar.gz) from http://ftp.mozilla.org/pub/security/nss/releases/NSS_3_39_RTM/
- Created a directory C:\src Extracted nss to c:/src (this looks like C:/src/nss-3.39)
- Run the C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- Run C:\mozilla-build\start-shell.bat
- Set
MOZ_NO_RESET_PATH=1
so this will not override the PATH variable. Created the required env variables,
export OS_TARGET=WIN95 export BUILD_OPT=1 export HOME="/c/src"
cd ~
(To bring me into my home directory).- Now
cd
into the nss-3.5\nss Build usingmake nss_build_all
Now with these options: USE_64=1 BUILD_OPT=1 make nss_build_all
I am getting the following error:
gtest/include/gtest/internal/gtest-port.h(999): error C2220: warning treated as error - no 'object' file generated... [some build messages]...
make[2]: *** [WIN954.0_x86_64_64_OPT.OBJ/gtest/src/gtest-all.obj] Error 2
make[2]: Leaving directory /c/src/nss-3.39/nss/gtests/google_test'
make[1]: *** [libs] Error 2
make[1]: Leaving directory /c/src/nss-3.39/nss/gtests'
make: *** [libs] Error 2
Installing CYGWIN and disabling 'gtests' worked for me. To disable GTests, set
NSS_DISABLE_GTESTS=1
Here are some troubleshooting:
If you get following errors which are due to lack of some libraries and includes then remove two variables from C:\mozilla-build\start-shell.bat (basically, you should not initialize them with empty values so it can pick up required libraries from Windows)
Error Ex.:
Re-execute steps from step 8 onwards.
If your build is failed due to assembly code/assembly keywords then install some assembly compiler(I have installed CYGWIN) and add into your path or set CYGWIN variable value in C:\mozilla-build\start-shell.bat.
Error Ex.:
This happens because inline asm on 64-bit development is not a supported scenario by VS2017.
NSS 3.39 is using gtest 1.7 and it throws TR1 deprecation warnings. This could lead into build failure. If you see error like following then by disabling 'gtests', you can compile NSS successfully. To do this, before starting build set
NSS_DISABLE_GTESTS=1
Error Ex.:
Though this issue has been fixed into Mozilla build system project, it is not reflected in NSS. I think, NSS needs to be updated to use gtest 1.8.
Following are the steps I followed to build NSSv3.39 (with NSPR) successfully on Windows 10 (64-bit) with VS2017.
C:\src
c:/src
(this is looking like C:/src/nss-3.39)Run the
Run
C:\mozilla-build\start-shell.bat
MOZ_NO_RESET_PATH=1
so this will not override the PATH variable.Created the required env variables,
cd ~
(To bring into home directory).make nss_build_all