Closed Bug 1792159 Opened 2 years ago Closed 2 years ago

Firefox 105.0 fails to build on i686 / GCC

Categories

(Core :: JavaScript Engine: JIT, defect, P1)

defect

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox105 --- wontfix
firefox106 --- wontfix
firefox107 --- fixed

People

(Reporter: stransky, Assigned: tcampbell)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Firefox 105.0 fails to build on i686 / GCC / Fedora 36:

Errors:
error: ‘MOZ_NEVER_INLINE’ does not name a type

 2:48.44 In file included from /builddir/build/BUILD/firefox-105.0.1/js/src/jit/AtomicOperations.h:14,
 2:48.44                  from /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.cpp:7,
 2:48.44                  from Unified_cpp_js_src_jit13.cpp:2:
 2:48.44 /builddir/build/BUILD/firefox-105.0.1/objdir/js/src/jit/AtomicOperationsGenerated.h:14:13: error: ‘MOZ_NEVER_INLINE’ does not name a type
 2:48.44    14 |             MOZ_NEVER_INLINE inline void AtomicFenceSeqCst() {
 2:48.44       |             ^~~~~~~~~~~~~~~~

error: ‘AtomicFenceSeqCst’ was not declared in this scope
2:48.64 52 | inline void js::jit::AtomicOperations::fenceSeqCst() { AtomicFenceSeqCst(); }

 2:48.64 /usr/bin/nasm -o dct_sse2.o -f elf32 -F dwarf -I/builddir/build/BUILD/firefox-105.0.1/media/libvpx/config/linux/ia32/ -DPIC -I./ -I/builddir/build/BUILD/firefox-105.0.1/media/libvpx/libvpx/   /builddir/build/BUILD/firefox-105.0.1/media/libvpx/libvpx/vp8/encoder/x86/dct_sse2.asm
 2:48.64 In file included from /builddir/build/BUILD/firefox-105.0.1/js/src/jit/AtomicOperations.h:345:
 2:48.64 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h: In static member function ‘static void js::jit::AtomicOperations::fenceSeqCst()’:
 2:48.64 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h:52:56: error: ‘AtomicFenceSeqCst’ was not declared in this scope
 2:48.64    52 | inline void js::jit::AtomicOperations::fenceSeqCst() { AtomicFenceSeqCst(); }
 2:48.64       |                                                        ^~~~~~~~~~~~~~~~~

error: ‘AtomicLoad8SeqCst’ was not declared in this scope

 2:48.64 /usr/bin/nasm -o dct_sse2.o -f elf32 -F dwarf -I/builddir/build/BUILD/firefox-105.0.1/media/libvpx/config/linux/ia32/ -DPIC -I./ -I/builddir/build/BUILD/firefox-105.0.1/media/libvpx/libvpx/   /builddir/build/BUILD/firefox-105.0.1/media/libvpx/libvpx/vp8/encoder/x86/dct_sse2.asm
 2:48.64 In file included from /builddir/build/BUILD/firefox-105.0.1/js/src/jit/AtomicOperations.h:345:
 2:48.64 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h: In static member function ‘static void js::jit::AtomicOperations::fenceSeqCst()’:
 2:48.64 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h:52:56: error: ‘AtomicFenceSeqCst’ was not declared in this scope
 2:48.64    52 | inline void js::jit::AtomicOperations::fenceSeqCst() { AtomicFenceSeqCst(); }
 2:48.64       |                                                        ^~~~~~~~~~~~~~~~~
 2:48.65 media/libvpx/fwalsh_sse2.o
 2:48.65 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h: In static member function ‘static T js::jit::AtomicOperations::loadSeqCst(T*) [with T = signed char]’:
 2:48.65 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h:72:29: error: ‘AtomicLoad8SeqCst’ was not declared in this scope
 2:48.65    72 | JIT_LOADOP(int8_t, uint8_t, AtomicLoad8SeqCst)
 2:48.65       |                             ^~~~~~~~~~~~~~~~~
 2:48.65 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h:57:15: note: in definition of macro ‘JIT_LOADOP’
 2:48.65    57 |     return (T)loadop((U*)addr);                    \
 2:48.65       |               ^~~~~~
 2:48.66 /usr/bin/nasm -o fwalsh_sse2.o -f elf32 -F dwarf -I/builddir/build/BUILD/firefox-105.0.1/media/libvpx/config/linux/ia32/ -DPIC -I./ -I/builddir/build/BUILD/firefox-105.0.1/media/libvpx/libvpx/   /builddir/build/BUILD/firefox-105.0.1/media/libvpx/libvpx/vp8/encoder/x86/fwalsh_sse2.asm
 2:48.67 media/libvpx/temporal_filter_apply_sse2.o
 2:48.67 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h: In static member function ‘static T js::jit::AtomicOperations::loadSeqCst(T*) [with T = unsigned char]’:
 2:48.67 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h:73:30: error: ‘AtomicLoad8SeqCst’ was not declared in this scope
 2:48.67    73 | JIT_LOADOP(uint8_t, uint8_t, AtomicLoad8SeqCst)
 2:48.67       |                              ^~~~~~~~~~~~~~~~~
 2:48.67 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h:57:15: note: in definition of macro ‘JIT_LOADOP’
 2:48.67    57 |     return (T)loadop((U*)addr);                    \
 2:48.67       |               ^~~~~~

error: ‘AtomicLoad32SeqCst’ was not declared in this scope

 2:48.70 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h:75:32: error: ‘AtomicLoad16SeqCst’ was not declared in this scope
 2:48.70    75 | JIT_LOADOP(uint16_t, uint16_t, AtomicLoad16SeqCst)
 2:48.70       |                                ^~~~~~~~~~~~~~~~~~
 2:48.70 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h:57:15: note: in definition of macro ‘JIT_LOADOP’
 2:48.70    57 |     return (T)loadop((U*)addr);                    \
 2:48.70       |               ^~~~~~
 2:48.71 media/libvpx/vp9_error_sse2.o
 2:48.71 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h: In static member function ‘static T js::jit::AtomicOperations::loadSeqCst(T*) [with T = int]’:
 2:48.71 /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.h:76:31: error: ‘AtomicLoad32SeqCst’ was not declared in this scope
Regressed by: 1756347

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

:jandem, since you are the author of the regressor, bug 1756347, could you take a look? Also, could you set the severity field?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jdemooij)

I get this error as well.

Looking at the full log

49:18.43 In file included from /builddir/build/BUILD/firefox-105.0.1/js/src/jit/AtomicOperations.h:14,
49:18.43                  from /builddir/build/BUILD/firefox-105.0.1/js/src/jit/shared/AtomicOperations-shared-jit.cpp:7,
49:18.43                  from Unified_cpp_js_src_jit13.cpp:2:
49:18.43 /builddir/build/BUILD/firefox-105.0.1/objdir/js/src/jit/AtomicOperationsGenerated.h:14:13: error: ‘MOZ_NEVER_INLINE’ does not name a type
49:18.43    14 |             MOZ_NEVER_INLINE inline void AtomicFenceSeqCst() {
49:18.43       |             ^~~~~~~~~~~~~~~~
49:18.43 /builddir/build/BUILD/firefox-105.0.1/objdir/js/src/jit/AtomicOperationsGenerated.h:14:13: note: the macro ‘MOZ_NEVER_INLINE’ had not yet been defined
49:18.43 In file included from /builddir/build/BUILD/firefox-105.0.1/objdir/dist/include/mozilla/Assertions.h:17,
49:18.43                  from /builddir/build/BUILD/firefox-105.0.1/js/src/vm/SharedMem.h:10,
49:18.43                  from /builddir/build/BUILD/firefox-105.0.1/js/src/jit/AtomicOperations.h:15:
49:18.43 /builddir/build/BUILD/firefox-105.0.1/objdir/dist/include/mozilla/Attributes.h:90: note: it was later defined here
49:18.43    90 | #  define MOZ_NEVER_INLINE MOZ_HAVE_NEVER_INLINE

there is the reference to Attributes.h:90

As a work-around, adding
#include "/builddir/build/BUILD/firefox-105.0.1/objdir/dist/include/mozilla/Attributes.h"
to the beginning of Unified_cpp_js_src_jit13.cpp fixed the error for me, and the build finishes.

BTW, ref: status-firefox -esr102: --- → affected, the error didn't occur for an esr102.3.0 i686 build.

This is a better option because it's patched at source and the build isn't interrupted by the failure.
The check_spidermonkey_style.py patch is needed because the #include path to Attributes.h doesn't comply with the rules set in that script.

--- js/src/jit/shared/AtomicOperations-shared-jit.cpp
+++ js/src/jit/shared/AtomicOperations-shared-jit.cpp
@@ -5,4 +5,9 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+// bug 1792159
+#if defined(__i386__) && defined(__GNUC__) && !defined(__clang__)
+#  include "../../../mfbt/Attributes.h"
+#endif
+
 #include "jit/AtomicOperations.h"
 
--- config/check_spidermonkey_style.py
+++ config/check_spidermonkey_style.py
@@ -68,2 +68,3 @@
         "jit/AtomicOperationsGenerated.h",  # generated in $OBJDIR
+        "../../../mfbt/Attributes.h",  # unrecognized path
         "jit/CacheIROpsGenerated.h",  # generated in $OBJDIR

The canonical way to deal with that include would just be to #include "mozilla/Attributes.h" in AtomicOperations-shared-jit.cpp which would avoid needing to touch check_spidermonkey_style.py. In that case could also avoid any guards and just have the include apply to all builds. Does that still fix the issue in your build configuration?

Thanks for that. I should have looked more closely at what include paths were being used.

I was also wary about including Attributes.h in builds for other architectures which don't have this error, or for clang which I don't use so don't know whether that would be affected.

I don't have a 105 build set up now, but this patch works for a 106.0b6/i686/gcc build in the js/src/jit directory, which fails similarly otherwise.

--- js/src/jit/shared/AtomicOperations-shared-jit.cpp
+++ js/src/jit/shared/AtomicOperations-shared-jit.cpp
@@ -6,2 +6,3 @@
 
+#include "mozilla/Attributes.h"  // bug 1792159
 #include "jit/AtomicOperations.h"

x86_64, aarch64, and armv7 jit builds complete ok with this patch. I can't comment at the moment on whether the Firefox build as a whole or the spidermonkey style checks are ok.

It is however a work-around and whatever change between 104 and 105 caused this error for an i686/gcc build is still not fixed.

On certain build configurations involving GCC, we use additional annotations
that are defined in Attributes.h so we must include the header first. For
consistency, include on all platforms since we use this header safely in many
places already.

Assignee: nobody → tcampbell
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P1
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/de384dc334c4
Add missing includes to AtomicOperationsGenerated.h r=sfink
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
Flags: needinfo?(jdemooij)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: