Closed Bug 1642883 Opened 4 years ago Closed 4 years ago

build failure with conflicting swap64 symbol since #1065894

Categories

(Core :: JavaScript Engine, defect, P3)

Unspecified
OpenBSD
defect

Tracking

()

VERIFIED FIXED
mozilla79
Tracking Status
firefox-esr68 --- unaffected
firefox77 --- unaffected
firefox78 --- fixed
firefox79 --- fixed

People

(Reporter: gaston, Assigned: jandem)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

78.0b1 fails to build on OpenBSD because swap32/swap64 are macros defined in sys/endian.h, cf https://github.com/openbsd/src/blob/master/sys/sys/endian.h#L69:

In file included from /usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/new-regexp/regexp-macro-assembler-arch.h:18:                                                                                                               [96/9107]
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/MacroAssembler.h:854:15: error: expected ')'                                                                                                                                          
/usr/include/sys/endian.h:72:19: note: expanded from macro 'swap64'                                                                                                                                                                            
#define swap64(x) __swap64(x)                                                                                                                                                                                                                  
                  ^                                                                                                                                                                                                                            
/usr/include/sys/_endian.h:91:39: note: expanded from macro '__swap64'                                                                                                                                                                         
        (__uint64_t)(__builtin_constant_p(x) ? __swap64gen(x) : __swap64md(x))                                                                                                                                                                 
                                             ^                                                                                                                                                                                                 
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/MacroAssembler.h:854:15: note: to match this '('                                                                                                                                      
/usr/include/sys/endian.h:72:19: note: expanded from macro 'swap64'                                                                                                                                                                            
#define swap64(x) __swap64(x)                                                                                                                                                                                                                  
                  ^                                                                                                                                                                                                                            
/usr/include/sys/_endian.h:91:14: note: expanded from macro '__swap64'                                                                                                                                                                         
        (__uint64_t)(__builtin_constant_p(x) ? __swap64gen(x) : __swap64md(x))                                                                                                                                                                 
                    ^                                                                                                                                                                                                                          
In file included from Unified_cpp_js_src_new-regexp1.cpp:47:                                                                                                                                                                                   
In file included from /usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/new-regexp/regexp-native-macro-assembler.cc:16:                                                                                                                     
In file included from /usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/MacroAssembler-inl.h:20:                                                                                                                                        
In file included from /usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/x64/MacroAssembler-x64-inl.h:12:                                                                                                                                
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h:136:22: error: expected unqualified-id                                                                                                     
void MacroAssembler::swap32(Register reg) { bswapl(reg); }                                                                                                                                                                                     
                     ^                                                                                                                                                                                                                         
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h:136:22: error: call to non-static member function without an object argument                                                               
void MacroAssembler::swap32(Register reg) { bswapl(reg); }                                                                                                                                                                                     
                     ^~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                      
/usr/include/sys/endian.h:71:19: note: expanded from macro 'swap32'                                                                                                                                                                            
#define swap32(x) __swap32(x)                                                                                                                                                                                                                  
                  ^~~~~~~~~~~                                                                                                                                                                                                                  
/usr/include/sys/_endian.h:89:3: note: expanded from macro '__swap32'                                                                                                                                                                          
        (__uint32_t)(__builtin_constant_p(x) ? __swap32gen(x) : __swap32md(x))                                                                                                                                                                 
         ^~~~~~~~~~                                                                                                                                                                                                                            
In file included from Unified_cpp_js_src_new-regexp1.cpp:47:                                                                                                                                                                                   
In file included from /usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/new-regexp/regexp-native-macro-assembler.cc:16:                                                                                                                     
In file included from /usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/MacroAssembler-inl.h:20:                                                                                                                                        
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/x64/MacroAssembler-x64-inl.h:136:22: error: expected unqualified-id                                                                                                                   
void MacroAssembler::swap64(Register64 reg) { bswapq(reg.reg); }                                                                                                                                                                               
                     ^                                                                                                                                                                                                                         
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/x64/MacroAssembler-x64-inl.h:136:22: error: call to non-static member function without an object argument                                                                             
void MacroAssembler::swap64(Register64 reg) { bswapq(reg.reg); }                                                       
                     ^~~~~~~~~~~~~~~~~~~~~~                                                                            
/usr/include/sys/endian.h:72:19: note: expanded from macro 'swap64'                                                                                                                                                                            
#define swap64(x) __swap64(x)                                                                                                                                                                                                                  
                  ^~~~~~~~~~~                              
/usr/include/sys/_endian.h:91:3: note: expanded from macro '__swap64'                                                  
        (__uint64_t)(__builtin_constant_p(x) ? __swap64gen(x) : __swap64md(x))                                         
         ^~~~~~~~~~                                        
8 errors generated.     
In file included from /usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/x64/SharedICRegisters-x64.h:10:                                                                                                                                 
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/MacroAssembler.h:851:15: error: expected ')'                                                                                                                                          
/usr/include/sys/endian.h:71:19: note: expanded from macro 'swap32'                                                                                                                                                                            
#define swap32(x) __swap32(x)                                                                                                                                                                                                                  
                  ^                                                                                                                                                                                                                            
/usr/include/sys/_endian.h:89:39: note: expanded from macro '__swap32'                                                                                                                                                                         
        (__uint32_t)(__builtin_constant_p(x) ? __swap32gen(x) : __swap32md(x))                                                                                                                                                                 
                                             ^                                                                                                                                                                                                 
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/MacroAssembler.h:851:15: note: to match this '('                                                                                                                                      
/usr/include/sys/endian.h:71:19: note: expanded from macro 'swap32'                                                                                                                                                                            
#define swap32(x) __swap32(x)                                                                                                                                                                                                                  
                  ^                                                                                                                                                                                                                            
/usr/include/sys/_endian.h:89:14: note: expanded from macro '__swap32'                                                                                                                                                                         
        (__uint32_t)(__builtin_constant_p(x) ? __swap32gen(x) : __swap32md(x))     

/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/MacroAssembler.h:854:15: error: C++ requires a type specifier for all declarations                                                                                                    
  inline void swap64(Register64 reg) PER_ARCH;             
              ^                                            
/usr/include/sys/endian.h:72:19: note: expanded from macro 'swap64'                                                    
#define swap64(x) __swap64(x)                              
                  ^                                        
/usr/include/sys/_endian.h:91:15: note: expanded from macro '__swap64'                                                 
        (__uint64_t)(__builtin_constant_p(x) ? __swap64gen(x) : __swap64md(x))      

In file included from /usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/x64/SharedICRegisters-x64.h:10:
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/MacroAssembler.h:854:15: error: expected ')'
/usr/include/sys/endian.h:72:19: note: expanded from macro 'swap64'
#define swap64(x) __swap64(x)
                  ^
/usr/include/sys/_endian.h:91:39: note: expanded from macro '__swap64'
        (__uint64_t)(__builtin_constant_p(x) ? __swap64gen(x) : __swap64md(x))
                                             ^
/usr/obj/ports/firefox-78.0beta1/firefox-78.0/js/src/jit/MacroAssembler.h:854:15: note: to match this '('
/usr/include/sys/endian.h:72:19: note: expanded from macro 'swap64'
#define swap64(x) __swap64(x)
                  ^
/usr/include/sys/_endian.h:91:14: note: expanded from macro '__swap64'
        (__uint64_t)(__builtin_constant_p(x) ? __swap64gen(x) : __swap64md(x))
                    ^
4 errors generated.

An option would be to rename those two swap64/swap32 methods to 'something else', or to #undef the existing macros in the consumers ?

after quick testing, adding #undef swap64 #undef swap32 somewhere at the beginning of MacroAssembler.h seems to help, would that be acceptable ?

Flags: needinfo?(jdemooij)

Set release status flags based on info from the regressing bug 1065894

(In reply to Landry Breuil (:gaston) from comment #2)

after quick testing, adding #undef swap64 #undef swap32 somewhere at the beginning of MacroAssembler.h seems to help, would that be acceptable ?

I think I'd prefer renaming swap32 => byteSwap32 (and similar for swap64, swap16SignExtend, swap16ZeroExtend) in js/src/jit to sidestep the issue. Do you want to write the patch?

Flags: needinfo?(jdemooij) → needinfo?(landry)

that would also work for us ! sadly those days i dont think i'll have much time to tackle that...

Flags: needinfo?(landry)
Severity: -- → S4
Priority: -- → P3

jan, can this come back on the radar for 78 ? it would be a pity to have to fix that in an esr branch..

Flags: needinfo?(jdemooij)

Unfortunately OpenBSD has a header file defining swap{16,32,64} macros.

Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Flags: needinfo?(jdemooij)
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c216429dfc9d Rename MacroAssembler swap* methods to byteSwap* to fix OpenBSD build failures. r=caroline

Comment on attachment 9156979 [details]
Bug 1642883 - Rename MacroAssembler swap* methods to byteSwap* to fix OpenBSD build failures. r?caroline!

This is just renaming some functions to fix the build on a Tier 3 platform.

Attachment #9156979 - Flags: approval-mozilla-beta?
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

Comment on attachment 9156979 [details]
Bug 1642883 - Rename MacroAssembler swap* methods to byteSwap* to fix OpenBSD build failures. r?caroline!

Fixes Tier 3 build failures. Approved for 78.0b9.

Attachment #9156979 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

can confirm that 78.0b9 builds fine on OpenBSD, thanks!

Status: RESOLVED → VERIFIED
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: