Closed Bug 560150 Opened 15 years ago Closed 15 years ago

Unable to build pk11util on OpenSolaris (SunOS 5.11), pk11util.c:913: error: implicit declaration of function `open'

Categories

(NSS :: Build, defect, P3)

3.12.6
x86
Solaris
defect

Tracking

(Not tracked)

RESOLVED FIXED
3.12.7

People

(Reporter: kreinholz, Assigned: christophe.ravel.bugs)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.8) Gecko/20100226 Firefox/3.5.8 Build Identifier: nss-3.12.6 I downloaded and built nss-3.12.6-with-nspr-4.8.4 from source on OpenSolaris using the following build flags: make NS_USE_GCC=1 NO_MDUPDATE=1 nss_build_all pfexec make NS_USE_GCC=1 NO_MDUPDATE=1 install NSS builds with no problems. I also want to build the pk11util component at nss-3.12.6/mozilla/security/nss/cmd/pk11util I attempted to build using the following flags: make NS_USE_GCC=1 NO_MDUPDATE=1 Which yields the following: gcc -o SunOS5.11_i86pc_gcc_DBG.OBJ/pk11util.o -c -g -Wall -Wno-format -Werror-implicit-function-declaration -Wno-switch -fPIC -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT -Di386 -DSOLARIS2_11 -D_SVID_GETTOD -DXP_UNIX -DNSPR20 -DDEBUG -UNDEBUG -DDEBUG_reinholz -DUSE_UTIL_DIRECTLY -I/usr/dt/include -I/usr/openwin/include -I../../../../dist/SunOS5.11_i86pc_gcc_DBG.OBJ/include -I../../../../dist/public/nss -I../../../../dist/private/nss -I../../../../dist/public/seccmd pk11util.c pk11util.c: In function `restore': pk11util.c:913: error: implicit declaration of function `open' make: *** [SunOS5.11_i86pc_gcc_DBG.OBJ/pk11util.o] Error 1 Reproducible: Always Steps to Reproduce: 1. Download and extract nss-3.12.6-with-nspr-4.8.4 source code from https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_12_6_RTM/src/ 2. Successfully build NSS as outlined in the 'Details' section above 3. Attempt to build mozilla/security/nss/cmd/pk11util Actual Results: gcc spits out the following error with pk11util.c: pk11util.c: In function `restore': pk11util.c:913: error: implicit declaration of function `open' Expected Results: pk11util should build cleanly I'm trying to build pk11util so I can test Red Hat's coolkey pkcs#11 security module, which I can't get to function properly on OpenSolaris.
I suspect that this is a difference between S11 and S10. I know this builds on S10 OK. I suspect that on S11, you must define some symbol to get open declared. Why don't you take a look through your S11 header files and tell us what that is?
Version: unspecified → 3.12.6
This seems to be a long outstanding problem. Our regular build (target nss_build_all) doesn't build pk11util. I tried to build it on Solaris 8 with Sun Studio 12. I am getting a warning too: "pk11util.c", line 913: warning: implicit function declaration: open but the compiler doesn't stop on this warning. This is probably different with gcc. On Solaris (I didn't check other OSes), "open" is defined in /usr/include/fcntl.h (#include <fcntl.h), not in /usr/include/sys/fcntl.h (#include <sys/fcntl.h>). I applied the following diffs to make the build work for me: $ cvs diff -pu5 pk11util.c Index: pk11util.c =================================================================== RCS file: /cvsroot/mozilla/security/nss/cmd/pk11util/pk11util.c,v retrieving revision 1.13 diff -p -u -5 -r1.13 pk11util.c --- pk11util.c 30 Mar 2009 23:40:54 -0000 1.13 +++ pk11util.c 19 Apr 2010 22:10:06 -0000 @@ -43,11 +43,11 @@ #include "fcntl.h" #include "io.h" #include <fcntl.h> #else #include <unistd.h> -#include <sys/fcntl.h> +#include <fcntl.h> #endif #include "secutil.h"
Assignee: nobody → christophe.ravel.bugs
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P3
Target Milestone: --- → 3.12.7
Tested on Solaris 8 and OpenSolaris. All the other utilities in mozilla/security/nss/cmd include <fcntl.h> and not <sys/fcntl.h>. I think this should work on all Unixes. Bob, do you concur?
Attachment #440047 - Flags: superreview?(rrelyea)
Attachment #440047 - Flags: review?(alexei.volkov.bugs)
Comment on attachment 440047 [details] [diff] [review] Fix build for pk11util.c r+ thanks christoph
Attachment #440047 - Flags: superreview?(rrelyea) → superreview+
Tested the patch on OpenSolaris snv_134, works great! Thanks everyone for your help!
Attachment #440047 - Flags: review?(alexei.volkov.bugs) → review+
Checking in pk11util.c; /cvsroot/mozilla/security/nss/cmd/pk11util/pk11util.c,v <-- pk11util.c new revision: 1.14; previous revision: 1.13
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: