Last Comment Bug 389248 - NSS build failure when NSS_ENABLE_ECC is not defined
: NSS build failure when NSS_ENABLE_ECC is not defined
Product: NSS
Classification: Components
Component: Libraries (show other bugs)
: trunk
: x86 Linux
P1 normal (vote)
: 3.12
Assigned To: Neil Williams
Depends on:
  Show dependency treegraph
Reported: 2007-07-23 06:26 PDT by Kai Engert (:kaie)
Modified: 2007-08-01 10:30 PDT (History)
1 user (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

Patch v1 (628 bytes, patch)
2007-07-23 06:32 PDT, Kai Engert (:kaie)
nelson: review-
Details | Diff | Splinter Review

Description User image Kai Engert (:kaie) 2007-07-23 06:26:58 PDT
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’
Comment 1 User image Kai Engert (:kaie) 2007-07-23 06:32:03 PDT
Created attachment 273407 [details] [diff] [review]
Patch v1

this patch helps me
Comment 2 User image Nelson Bolyard (seldom reads bugmail) 2007-07-23 11:48:04 PDT
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. */
Comment 3 User image Nelson Bolyard (seldom reads bugmail) 2007-07-24 00:12:05 PDT
Biswatosh observes that the typedef for ECName is inside of 
but the line that declares ssl3_GetCurveWithECKeyStrength is not.

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

please fix the broken declaration of ssl3_GetCurveWithECKeyStrength *today.*
Comment 4 User image Neil Williams 2007-07-24 15:25:17 PDT
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
Comment 5 User image Kai Engert (:kaie) 2007-08-01 10:30:31 PDT
thanks, confirming fixed

Note You need to log in before you can comment on or make changes to this bug.