Closed Bug 233493 Opened 21 years ago Closed 21 years ago

symkeyutil build broken on OS/2

Categories

(NSS :: Tools, defect, P2)

x86
OS/2
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julien.pierre, Assigned: julien.pierre)

Details

Attachments

(2 files, 1 obsolete file)

E:\dev\nss\tip\mozilla\security\nss\cmd\symkeyutil\OS22.45_icc_OPT.OBJ\symkeyuti
l.obj(E:/dev/nss/tip/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c) : error L
NK2029: "read" : unresolved external
E:\dev\nss\tip\mozilla\security\nss\cmd\symkeyutil\OS22.45_icc_OPT.OBJ\symkeyuti
l.obj(E:/dev/nss/tip/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c) : error L
NK2029: "open" : unresolved external
E:\dev\nss\tip\mozilla\security\nss\cmd\symkeyutil\OS22.45_icc_OPT.OBJ\symkeyuti
l.obj(E:/dev/nss/tip/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c) : error L
NK2029: "close" : unresolved external
E:\dev\nss\tip\mozilla\security\nss\cmd\symkeyutil\OS22.45_icc_OPT.OBJ\symkeyuti
l.obj(E:/dev/nss/tip/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c) : error L
NK2029: "write" : unresolved external


There were 4 errors detected
gmake.exe: *** [OS22.45_icc_OPT.OBJ/symkeyutil.exe] Error 12


The fix is to use NSPR . Patch forthcoming.
This did not break mozilla because it does not build nss/cmd .
Status: NEW → ASSIGNED
This problem was introduced in 3.9, when the symkeyutil tool was added.
I would like to check this into both NSS_3_9_BRANCH and the tip.
Priority: -- → P2
Hardware: Other → PC
Target Milestone: --- → 3.9.1
Version: 3.8 → 3.9
Attachment #140934 - Flags: superreview?(rrelyea0264)
Attachment #140934 - Flags: review?(wchang0222)
Comment on attachment 140934 [details] [diff] [review]
Use NSPR instead of libc functions

The patch is basically good, but if we are replacing the libc version of
open/close/read/write we should also replace the perror calls so correct
failures are printed.
Attachment #140934 - Flags: superreview?(rrelyea0264) → superreview-
Julien, 

there was a similar problem on windows, with these symbols being underfined.  
I fixed them with a small change that undefined __STDC__ on that platform only.
That change causes all those symbols to become defined.
I wonder if there's a similarly simple patch for OS/2.
Assignee: wchang0222 → jpierre
Status: ASSIGNED → NEW
Nelson, I know there is indeed a simpler way to get these libc functions to
work under OS/2. I only reported the link error, but there were also compile
warnings because the header defining them was not included on OS/2.
But there are platforms that don't necessarily have all the needed libc
functions (eg. embedded), so I think the proper fix is to use NSPR as I did in
this patch.
Attachment #140934 - Attachment is obsolete: true
Attachment #141071 - Flags: superreview?(rrelyea0264)
Attachment #141071 - Flags: review?(MisterSSL)
Comment on attachment 141071 [details] [diff] [review]
use PR functions for errors instead of perror

r=relyea
Attachment #141071 - Flags: superreview?(rrelyea0264) → superreview+
Thanks, Bob.

Fixed in tip :

Checking in symkeyutil.c;
/cvsroot/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c,v  <--  symkeyutil.c
new revision: 1.5; previous revision: 1.4

and NSS_3_9_BRANCH :

Checking in symkeyutil.c;
/cvsroot/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c,v  <--  symkeyutil.c
new revision: 1.4.4.1; previous revision: 1.4
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment on attachment 141071 [details] [diff] [review]
use PR functions for errors instead of perror

I suggest the following changes.

1. Change "io.h" to <io.h> because it is a standard
system header file.  Actually, I think the <io.h>
inclusion (and possibly <unistd.h>, <sys/types.h>,
<sys/stat.h>, and <fcntl.h>) and the O_BINARY macro
definition can be deleted altogether.

2. If we include "nspr.h", we don't need to include
"prtypes.h", "prtime.h", and "prlong.h".

3. Add 'static' to all the functions that should be 'static'.

4. The new code should follow the prevalent style for the
placement of curly braces in the file.

5. Use SECU_PrintError (declared in "secutil.h") instead
of 'PrintError'.  Delete 'PrintError'.
Attachment #141071 - Flags: review?(MisterSSL)
This fixes all of Wan-Teh's issues except for the "static" keyword. symkeyutil
is an executable consisting of a single C source file, so the static keyword
would not have much effect.
Checked in the incremental patch to tip

Checking in symkeyutil.c;
/cvsroot/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c,v  <--  symkeyutil.c
new revision: 1.6; previous revision: 1.5

and branch

Checking in symkeyutil.c;
/cvsroot/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c,v  <--  symkeyutil.c
new revision: 1.4.4.2; previous revision: 1.4.4.1
Comment on attachment 141126 [details] [diff] [review]
incremental patch

The first argument to SECU_PrintError should be the
name of the program (symkeyutil).
I know, but the program name variable wasn't shared anywhere so I got lazy and
used the precedent that many other nss/cmd programs have by setting the first
argument to "Error".
Checking in symkeyutil.c;
/cvsroot/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c,v  <--  symkeyutil.c
new revision: 1.7; previous revision: 1.6

Checking in symkeyutil.c;
/cvsroot/mozilla/security/nss/cmd/symkeyutil/symkeyutil.c,v  <--  symkeyutil.c
new revision: 1.4.4.3; previous revision: 1.4.4.2
Attachment #140934 - Flags: review?(wchang0222)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: