Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Recent builds of NSS on Windows?

865 views
Skip to first unread message

Walter Goulet

unread,
Oct 13, 2011, 4:23:18 PM10/13/11
to mozilla-dev...@lists.mozilla.org
Hi,

I'm wondering if anyone has recently built a version of NSS on Windows
per the instructions on the NSS build pages (http://www.mozilla.org/
projects/security/pki/nss/nss-3.7.7/nss-3.7.7-build.html)? I've run
into problems building NSS using both MozillaBuild and Netscape
wintools (although I can build nspr just fine).

I'll dig in and try to figure out exactly what's causing the builds to
fail at some point, but for now I'm using an older binary of NSS
3.7.7.

Thanks,
Walter

Honza Bambas

unread,
Oct 14, 2011, 4:00:12 PM10/14/11
to dev-tec...@lists.mozilla.org

Yep, I was able to build nss-3.12.8-with-nspr-4.8.6 source tar ball with
MozillaBuild using msvc 9 prompt on Windows 7. I have also installed
Windows SDK 7 as instructed on the build prerequisites for the whole
mozilla tree build (see [1]). Probably you should go by those
instructions first. I have set OS_TARGET=WINNT (AFAIR) and ran 'make
nss_build_all' from the nss dir.

[1] https://developer.mozilla.org/en/Windows_Build_Prerequisites

-hb-

Walter Goulet

unread,
Oct 14, 2011, 10:57:12 PM10/14/11
to mozilla-dev...@lists.mozilla.org
Thanks that's great to hear; I'll give it a shot again.

Brian Smith

unread,
Oct 17, 2011, 5:34:17 PM10/17/11
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org
Walter Goulet wrote:

> > > I'm wondering if anyone has recently built a version of NSS on
> > > Windows per the instructions on the NSS build pages
> > > (http://www.mozilla.org/
> > > projects/security/pki/nss/nss-3.7.7/nss-3.7.7-build.html)? I've
> > > run
> > > into problems building NSS using both MozillaBuild and Netscape
> > > wintools (although I can build nspr just fine).

I use only MozillaBuild, and I build it all the time:

mkdir trunk
cd trunk
cvs co NSS NSPR
cd mozilla/security/nss

OS_TARGET=WIN95 make nss_clean_all nss_build_all

I always use Microsoft Visual Studio 2010.

- Brian

Brian Smith

unread,
Oct 17, 2011, 5:34:17 PM10/17/11
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org

helpcrypto helpcrypto

unread,
Oct 27, 2011, 4:03:03 AM10/27/11
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org
and, has anyone achieved to compile it using mingw?
im always having many issues with that...

helpcrypto helpcrypto

unread,
Oct 27, 2011, 4:03:03 AM10/27/11
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org

Brian Smith

unread,
Oct 31, 2011, 4:53:12 AM10/31/11
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org
helpcrypto helpcrypto wrote:
> and, has anyone achieved to compile it using mingw?
> im always having many issues with that...

MozillaBuild is pretty much mingw.

Please post the errors you receive during your build and I will try to help you decipher them.

Cheers,
Brian

Brian Smith

unread,
Oct 31, 2011, 4:53:12 AM10/31/11
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org

helpcrypto helpcrypto

unread,
Mar 28, 2012, 12:05:37 PM3/28/12
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org
Hi brian (& CO)

Today, a buggy old/legacy modutil.exe binary we are using, made me try
building NSS using mingw. Once again.

...
make[4]: /mingw/bin/windres: Command not found

Ok...i must copy windres from another mingw and this seems solved.

...
make[2]: Entering directory
`/c/nss-jss-src/mozilla/nsprpub/WINNT5.1_gcc_OPT.OBJ/config'
gcc -mno-cygwin -o now.o -c -O -UDEBUG -DNDEBUG=1 -DXP_PC=1
-DWIN32=1 -DWINNT=1 -D_X86_=1 -DFORCE_PR_LOG ../../config/now.c
gcc.exe: CreateProcess: No such file or directory


Installed mozilla-build (only) on XP SP3.
My build script:

export CVSROOT=":pserver:anon...@cvs-mirror.mozilla.org:/cvsroot"
export JAVA_HOME="/c/Archivos de programa/Java/jdk1.6.0_27"
export NO_MDUPDATE=1
export NSDISTMODE="copy"
export BUILD_OPT=1
#WIN95
export OS_TARGET="WINNT"
export NS_USE_GCC=1
export HOME="/c/"
export PATH=".:/usr/bin:/c/mozilla-build/moztools/bin:/c/mozilla-build/msys/mingw/bin"

cd nss-jss-src/mozilla/security/nss
make nss_build_all
cd -


Any ideas?

helpcrypto helpcrypto

unread,
Mar 28, 2012, 12:05:37 PM3/28/12
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org

helpcrypto helpcrypto

unread,
Mar 28, 2012, 1:42:17 PM3/28/12
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org
Using --verbose:

$ gcc --verbose -mno-cygwin -o now.o -c -O -UDEBUG -DNDEBUG=1
-DXP_PC=1 -DWIN32=1 -DWINNT=1 -D_X86_=1 -DFORCE_PR_LOG ../../config
/now.c
Using built-in specs.
COLLECT_GCC=C:\mozilla-build\msys\mingw\bin\gcc.exe
Target: mingw32
Configured with: ../../src/gcc-4.5.2/configure --build=mingw32
--enable-languages=c,c++,ada,fortran,objc,obj-c++ --enable-threads=
win32 --enable-libgomp --enable-lto --enable-fully-dynamic-string
--enable-libstdcxx-debug --enable-version-specific-runtime-libs
--with-gnu-ld --disable-nls --disable-win32-registry --disable-symvers
--disable-werror --prefix=/mingw32tdm --with-local-prefix=/
mingw32tdm --enable-cxx-flags='-fno-function-sections
-fno-data-sections' --with-pkgversion=tdm-1 --enable-sjlj-exceptions
--with-
bugurl=http://tdm-gcc.tdragon.net/bugs
Thread model: win32
gcc version 4.5.2 (tdm-1)
COLLECT_GCC_OPTIONS='-v' '-mno-cygwin' '-o' 'now.o' '-c' '-O'
'-UDEBUG' '-DNDEBUG=1' '-DXP_PC=1' '-DWIN32=1' '-DWINNT=1' '-D_X86_=
1' '-DFORCE_PR_LOG' '-mtune=i386' '-march=i386'
cc1 -quiet -v -iprefix
c:\mozilla-build\msys\mingw\bin\../lib/gcc/mingw32/4.5.2/ -UDEBUG
-DNDEBUG=1 -DXP_PC=1 -DWIN32=1 -DWINNT=1
-D_X86_=1 -DFORCE_PR_LOG ../../config/now.c -quiet -dumpbase now.c
-mno-cygwin -mtune=i386 -march=i386 -auxbase-strip now.o -O -v
ersion -o C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\ccTc2eq0.s

helpcrypto helpcrypto

unread,
Mar 28, 2012, 1:42:17 PM3/28/12
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org

helpcrypto helpcrypto

unread,
Mar 28, 2012, 3:20:51 PM3/28/12
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org
Using process monitor, as explained here
http://stackoverflow.com/questions/3908475/gcc-exe-createprocess-no-such-file-or-directory-error,
i finally solved this issue, but an old friend appears again: warnings
about discarding thread
attribute.(https://groups.google.com/forum/#!msg/mozilla.dev.tech.crypto/CodPWr7DB9M/8YEogWg73PEJ)

and the result, as expected:

gcc -mwindows -shared -Wl,--export-all-symbols -Wl,--out-implib
-Wl,./libnspr4.a -o libnspr4.dll ./prvrsion.o io/./prfd
cach.o io/./prmwait.o io/./prmapopt.o io/./priometh.o io/./pripv6.o
io/./prlayer.o io/./prlog.o io/./prmmap.o io/./prpol
evt.o io/./prprf.o io/./prscanf.o io/./prstdio.o threads/./prcmon.o
threads/./prrwlock.o threads/./prtpd.o linking/./prl
ink.o malloc/./prmalloc.o malloc/./prmem.o md/./prosdep.o
memory/./prshm.o memory/./prshma.o memory/./prseg.o misc/./pra
larm.o misc/./pratom.o misc/./prcountr.o misc/./prdtoa.o
misc/./prenv.o misc/./prerr.o misc/./prerror.o misc/./prerrorta
ble.o misc/./prinit.o misc/./prinrval.o misc/./pripc.o misc/./prlog2.o
misc/./prlong.o misc/./prnetdb.o misc/./praton.o
misc/./prolock.o misc/./prrng.o misc/./prsystem.o misc/./prthinfo.o
misc/./prtpool.o misc/./prtrace.o misc/./prtime.o io
/./prdir.o io/./prfile.o io/./prio.o io/./prsocket.o misc/./pripcsem.o
threads/./prcthr.o threads/./prdump.o threads/./p
rmon.o threads/./prsem.o threads/combined/./prucpu.o
threads/combined/./prucv.o threads/combined/./prulock.o threads/com
bined/./prustack.o threads/combined/./pruthr.o md/windows/./ntmisc.o
md/windows/./ntsec.o md/windows/./ntsem.o md/window
s/./ntinrval.o md/windows/./ntgc.o md/windows/./ntio.o
md/windows/./ntthread.o md/windows/./ntdllmn.o md/windows/./win32
_errors.o md/windows/./w32ipcsem.o md/windows/./w32poll.o
md/windows/./w32rng.o md/windows/./w32shm.o ./nspr.res -lad
vapi32 -lwsock32 -lwinmm
Creating library file: ./libnspr4.a
threads/./prtpd.o:prtpd.c:(.text+0x44): undefined reference to
`_InterlockedIncrement'
misc/./prinit.o:prinit.c:(.text+0xa6a): undefined reference to
`_InterlockedExchange'
misc/./prinit.o:prinit.c:(.text+0xb33): undefined reference to
`_InterlockedExchange'
threads/combined/./pruthr.o:pruthr.c:(.text+0x10a3): undefined
reference to `_InterlockedIncrement'
threads/combined/./pruthr.o:pruthr.c:(.text+0x10b1): undefined
reference to `_InterlockedIncrement'
collect2: ld devolvi¾ el estado de salida 1
make[4]: *** [libnspr4.dll] Error 1
make[4]: Leaving directory
`/c/nss-jss-src/mozilla/nsprpub/WINNT5.1_gcc_OPT.OBJ/pr/src'
make[3]: *** [export] Error 2
make[3]: Leaving directory
`/c/nss-jss-src/mozilla/nsprpub/WINNT5.1_gcc_OPT.OBJ/pr/src'
make[2]: *** [export] Error 2
make[2]: Leaving directory
`/c/nss-jss-src/mozilla/nsprpub/WINNT5.1_gcc_OPT.OBJ/pr'
make[1]: *** [export] Error 2
make[1]: Leaving directory `/c/nss-jss-src/mozilla/nsprpub/WINNT5.1_gcc_OPT.OBJ'
make: *** [build_nspr] Error 2

using gcc version 4.6.1

helpcrypto helpcrypto

unread,
Mar 28, 2012, 3:20:51 PM3/28/12
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org

Brian Smith

unread,
Apr 4, 2012, 7:03:09 PM4/4/12
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org
> Today, a buggy old/legacy modutil.exe binary we are using, made me
> try building NSS using mingw. Once again.

The only way I recommend building NSS on Windows is with Microsoft Visual C++ and the mozilla-build package located at https://developer.mozilla.org/en/Windows_Build_Prerequisites#MozillaBuild_.2F_Pymake

Looking at your errors, it seems like the problem is a general problem with the MinGW/MSYS configuration itself, and not a problem specific to NSS. In my experience, more than a year ago, getting a correct GCC-based toolchain working in MSYS/MinGW (not just for building NSS, but in general) that isn't using an ancient version of GCC has been impractically difficult.

See https://bugzilla.mozilla.org/show_bug.cgi?id=570340 where there is a MinGW/MSYS/GCC user trying to build NSS. If you are not him, then he might be more helpful than I.

Cheers,
Brian

Brian Smith

unread,
Apr 4, 2012, 7:03:09 PM4/4/12
to mozilla's crypto code discussion list, mozilla-dev...@lists.mozilla.org

helpcrypto helpcrypto

unread,
Apr 9, 2012, 4:30:15 AM4/9/12
to mozilla's crypto code discussion list
> The only way I recommend building NSS on Windows is with Microsoft Visual C++ and the mozilla-build package located at https://developer.mozilla.org/en/Windows_Build_Prerequisites#MozillaBuild_.2F_Pymake

:(

> See https://bugzilla.mozilla.org/show_bug.cgi?id=570340 where there is a MinGW/MSYS/GCC user trying to build NSS. If you are not him, then he might be more helpful than I.

Im not. Thanks a lot Brian!
0 new messages