NSS build failure when NSS_ENABLE_ECC is not defined

VERIFIED FIXED in 3.12

Status

NSS
Libraries
P1
normal
VERIFIED FIXED
10 years ago
10 years ago

People

(Reporter: kaie, Assigned: Neil Williams)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

628 bytes, patch
Nelson Bolyard (seldom reads bugmail)
: review-
Details | Diff | Splinter Review
(Reporter)

Description

10 years ago
make[2]: Entering directory `/home/kaie/moz/nss/head/mozilla/security/nss/lib/ssl'
gcc -o Linux2.6_x86_64_glibc_PTH_64_DBG.OBJ/derive.o -c -g -fPIC -DLINUX1_2 -D_XOPEN_SOURCE -DLINUX2_1  -ansi -Wall -Werror-implicit-function-declaration -pipe -DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR -DXP_UNIX -DDEBUG -UNDEBUG -DDEBUG_kaie -D_REENTRANT -I../../../../dist/Linux2.6_x86_64_glibc_PTH_64_DBG.OBJ/include  -I../../../../dist/public/nss -I../../../../dist/private/nss  derive.c
In file included from derive.c:45:
sslimpl.h:1476: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ssl3_GetCurveWithECKeyStrength’
(Reporter)

Comment 1

10 years ago
Created attachment 273407 [details] [diff] [review]
Patch v1

this patch helps me
Attachment #273407 - Flags: review?(nelson)
Comment on attachment 273407 [details] [diff] [review]
Patch v1


>-ECName	ssl3_GetCurveWithECKeyStrength(PRUint32 curvemsk, int requiredECCbits);
>+enum ECName	ssl3_GetCurveWithECKeyStrength(PRUint32 curvemsk, int requiredECCbits);

This seems like a compiler bug, pure and simple.  
The patch actually seems like invalid c, because ECName is a type, not an enum name.
The fact that it satisfies this version of gcc, rather than causing a syntax error
seems like more evidence of the the compiler bug.  

Let me suggest some possible alternative patches.
1. Put "extern" in front of the above declaration, e.g. 
extern ECName ssl3_GetC...

2. If that fails, then change the declaration of the typedef for ECName to begin
typedef enum ECName { 
and then your suggested patch above will be correct c.  But please do this only
if the first suggestion above doesn't work.  Also, if you do this, please add a 
comment before the declaration of the function, saying this:
/* gcc 4.1.1 cannot compile the following line correctly if it uses a typedef. */
Attachment #273407 - Flags: review?(nelson) → review-
Biswatosh observes that the typedef for ECName is inside of 
#ifdef NSS_ENABLE_ECC
but the line that declares ssl3_GetCurveWithECKeyStrength is not.

Still, the first patch attached above was not a valid fix.

Neil, 
please fix the broken declaration of ssl3_GetCurveWithECKeyStrength *today.*
Assignee: nobody → neil.williams
Priority: -- → P1
Summary: NSS fails to compile on linux x86_64 with gcc 4.1.1 → NSS build failure when NSS_ENABLE_ECC is not defined
Target Milestone: --- → 3.12
(Assignee)

Comment 4

10 years ago
Sorry. This is the same problem we had on the 3.11 branch. The fix is to delete the declaration that is outside the #ifdef ECC. See bug # 325672.

Checking in lib/ssl/sslimpl.h;
/cvsroot/mozilla/security/nss/lib/ssl/sslimpl.h,v  <--  sslimpl.h
new revision: 1.59; previous revision: 1.58
done
Status: NEW → ASSIGNED
(Assignee)

Updated

10 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
(Reporter)

Comment 5

10 years ago
thanks, confirming fixed
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.