Closed Bug 698923 Opened 10 years ago Closed 10 years ago

MethodJIT.cpp:263:1: error: size of array ‘js_static_assert98’ is negative

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13
Tracking Status
firefox7 --- unaffected
firefox8 --- unaffected
firefox9 --- affected
firefox10 --- affected

People

(Reporter: glandium, Unassigned)

Details

Attachments

(1 file)

Current mozilla-central fails to build with the following error:
js/src/methodjit/MethodJIT.cpp: At global scope:
js/src/methodjit/MethodJIT.cpp:263:1: error: size of array ‘js_static_assert98’ is negative

This is because VMFrame size is not a multiple of 16.
Are you using Linux or Solaris?
Linux, but it doesn't look like this would be OS specific.
VMFRAME do not need 16bytes align. Try this patch.

diff -r 879d466adbe0 js/src/methodjit/MethodJIT.cpp                             
--- a/js/src/methodjit/MethodJIT.cpp    Mon Nov 14 13:03:50 2011 -0800          
+++ b/js/src/methodjit/MethodJIT.cpp    Wed Nov 16 07:08:16 2011 +0800          
@@ -257,7 +257,7 @@                                                             
 #if defined(__GNUC__) && !defined(_WIN64)                                      
                                                                                
 /* If this assert fails, you need to realign VMFrame to 16 bytes. */           
-#ifdef JS_CPU_ARM                                                              
+#if defined(JS_CPU_ARM) || defined(JS_CPU_SPARC)                               
 JS_STATIC_ASSERT(sizeof(VMFrame) % 8 == 0);                                    
 #else                                                                          
 JS_STATIC_ASSERT(sizeof(VMFrame) % 16 == 0);
(In reply to Leon Sha from comment #3)
> VMFRAME do not need 16bytes align. Try this patch.
> 
> diff -r 879d466adbe0 js/src/methodjit/MethodJIT.cpp                         
> 
> --- a/js/src/methodjit/MethodJIT.cpp    Mon Nov 14 13:03:50 2011 -0800      
> 
> +++ b/js/src/methodjit/MethodJIT.cpp    Wed Nov 16 07:08:16 2011 +0800      
> 
> @@ -257,7 +257,7 @@                                                         
> 
>  #if defined(__GNUC__) && !defined(_WIN64)                                  
> 
>                                                                             
> 
>  /* If this assert fails, you need to realign VMFrame to 16 bytes. */       
> 
> -#ifdef JS_CPU_ARM                                                          
> 
> +#if defined(JS_CPU_ARM) || defined(JS_CPU_SPARC)                           
> 
>  JS_STATIC_ASSERT(sizeof(VMFrame) % 8 == 0);                                
> 
>  #else                                                                      
> 
>  JS_STATIC_ASSERT(sizeof(VMFrame) % 16 == 0);

Apparently, this works fine.
Component: JavaScript Engine → Java-Implemented Plugins
Target Milestone: --- → mozilla10
Version: Trunk → Other Branch
Component: Java-Implemented Plugins → JavaScript Engine
Hardware: Sun → All
Target Milestone: mozilla10 → ---
Version: Other Branch → Trunk
Attachment #595999 - Flags: review?(luke) → review+
https://hg.mozilla.org/mozilla-central/rev/32bc6264f4bf
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.