Hello, I have been trying to use Java's SunPKCS11 provider using Mozilla's NSS librairies for the past few days without any luck.
Readers interested in the symptoms can visit the folowing URL: http://forum.java.sun.com/thread.jspa?threadID=5312745&tstart=0 Anyway, it turned out that my libraries were compiled in 32 bit mode whereas Java 1.6 on Leopard is exclusively 64-bit. I double-checked my installation and recompiled NSS and NSPR (as obtained in the nss-3.12-with-nspr-4.7 archive) enabling the 64 bit mode via the environment variable USE_64=1 (yes, this variable is correctly exported). However, on Mac OS X 10.5.4, the resulting librairies are still 32-bit. $ cd nss-3.12/mozilla/dist/Darwin9.4.0_gcc_64_OPT.OBJ/lib/ $ file libnss3.dylib libnss3.dylib: Mach-O dynamically linked shared library i386 I'm using Mac OS X 10.5.4 with gcc 4.0.1 (Apple Inc. build 5465) on a Core 2 Duo laptop (yes, it's a 64-bit machine). The following flags were exported from my environment: USE_64=1 BUILD_OPT=1 NS_USE_GCC=1 NO_MDUPDATE=1 Actually, reading the gcc commands, I noticed that the flag -m64 was not used. On OS X, gcc build everything in 32-bit mode by default so using this flag is required. I naively changed mozilla/security/nss/Makefile at line 111 to use: NSPR_COMPILERS = CC="gcc -m64" CXX="g++ -m64" and also changed mozilla/security/coreconf/Darwin.mk at line 42 and 43: CC = gcc -m64 CCC = gc++ -m64 However, I now get a nasty error when compiling: $ cd nss-3.12/mozilla/security/nss/ $ make nss_build_all [...] cd linking; make export gcc -m64 -o prlink.o -c -pipe -Wmost -fno-common -pthread -O -fPIC -UDEBUG -DNDEBUG=1 -DXP_UNIX=1 -DDARWIN=1 -DHAVE_BSD_FLOCK=1 -Di386=1 -DXP_MACOSX=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_ -I/Users/jem/Desktop/nss-3.12/mozilla/security/nss/../../dist/Darwin9.4.0_gcc_64_OPT.OBJ/include -I../../../../pr/include -I../../../../pr/include/private -I/Developer/Headers/FlatCarbon ../../../../pr/src/linking/prlink.c ../../../../pr/src/linking/prlink.c:183: error: syntax error before 'CFragConnectionID' ../../../../pr/src/linking/prlink.c:183: warning: no semicolon at end of struct or union ../../../../pr/src/linking/prlink.c:185: warning: 'main' is usually a function ../../../../pr/src/linking/prlink.c:204: error: syntax error before '}' token ../../../../pr/src/linking/prlink.c: In function '_PR_InitLinker': ../../../../pr/src/linking/prlink.c:319: error: invalid application of 'sizeof' to incomplete type 'PRLibrary' ../../../../pr/src/linking/prlink.c:321: error: dereferencing pointer to incomplete type ../../../../pr/src/linking/prlink.c:322: error: dereferencing pointer to incomplete type [...] And it goes on and on and on... Apparently a problem with included headers since the type CFragConnectionID is not recognized. I also "succesfully" reproduced that error when trying to compile independentyly a subset of the prlink.c file. Indeed getting rid of CFragConnectionID "solves" the compilation problem... As does using gcc without the -m64 flag... Is it a known issue? Or, I guess I should first ask if NSS & NSPR are supported on OS X 10.5 in 64-bit mode? Is there any workarounds to my special problem? Did I do something stupid (won't be the first time!) or did I overlook a critical piece of documentation? Thank you for your help! Regards, A.Y. _______________________________________________ dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto