Closed Bug 1841197 Opened 1 year ago Closed 1 year ago

[mips] SkWriteBuffer.cpp:171:21: error: expected unqualified-id before numeric constant

Categories

(Core :: Graphics, defect)

Other
Unspecified
defect

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- fixed
firefox114 --- wontfix
firefox115 --- wontfix
firefox116 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

With GCC:

/<<PKGBUILDDIR>>/gfx/skia/skia/src/core/SkWriteBuffer.cpp: In member function ‘virtual void SkBinaryWriteBuffer::writeImage(const SkImage*)’:
/<<PKGBUILDDIR>>/gfx/skia/skia/src/core/SkWriteBuffer.cpp:171:21: error: expected unqualified-id before numeric constant
  171 |     const SkMipmap* mips = as_IB(image)->onPeekMips();
      |                     ^~~~
In file included from Unified_cpp_gfx_skia11.cpp:56:
/<<PKGBUILDDIR>>/gfx/skia/skia/src/core/SkWriteBuffer.cpp:191:40: error: base operand of ‘->’ is not a pointer
  191 |         this->writeDataAsByteArray(mips->serialize().get());
      |                                        ^~

With clang, which makes it clearer what's wrong:

[task 2023-06-30T00:20:01.558Z] 00:20:01    ERROR -  /builds/worker/checkouts/gecko/gfx/skia/skia/src/core/SkWriteBuffer.cpp:171:21: error: expected unqualified-id
[task 2023-06-30T00:20:01.558Z] 00:20:01     INFO -      const SkMipmap* mips = as_IB(image)->onPeekMips();
[task 2023-06-30T00:20:01.558Z] 00:20:01     INFO -                      ^
[task 2023-06-30T00:20:01.559Z] 00:20:01     INFO -  <built-in>:381:14: note: expanded from macro 'mips'
[task 2023-06-30T00:20:01.559Z] 00:20:01     INFO -  #define mips 1
[task 2023-06-30T00:20:01.559Z] 00:20:01     INFO -               ^
[task 2023-06-30T00:20:01.559Z] 00:20:01     INFO -  In file included from Unified_cpp_gfx_skia11.cpp:56:
[task 2023-06-30T00:20:01.560Z] 00:20:01    ERROR -  /builds/worker/checkouts/gecko/gfx/skia/skia/src/core/SkWriteBuffer.cpp:191:42: error: member reference type 'int' is not a pointer
[task 2023-06-30T00:20:01.560Z] 00:20:01     INFO -          this->writeDataAsByteArray(mips->serialize().get());
[task 2023-06-30T00:20:01.560Z] 00:20:01     INFO -                                     ~~~~  ^
[task 2023-06-30T00:20:01.561Z] 00:20:01     INFO -  11 warnings and 2 errors generated.

Could you please provide more information about what platform you're trying to build on, or at least where the "mips" define is coming from?

Superficially, it would seem like this is because you are building on a MIPS platform.

I would rather not have to invasively change Skia source files, since they're third-party.

Can the mips preprocessor macro just be undefined on the command-line flags?

Flags: needinfo?(mh+mozilla)
Severity: -- → S4
Hardware: Unspecified → Other

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

As per the bug title, it's happening when building for MIPS.
As per the clang error, it's a builtin preprocessor macro. Passing -Umips on the compiler command line could work, assuming nothing actively uses the macro in system headers (they should be using one with an underscore)

Assignee: nobody → mh+mozilla
Flags: needinfo?(mh+mozilla)
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/b60e2de427dd Undefine the mips builtin macro on mips in skia. r=gfx-reviewers,lsalzman

Comment on attachment 9341855 [details]
Bug 1841197 - Undefine the mips builtin macro on mips in skia.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Build failure on tier-3 (mips) builds
  • User impact if declined: See above
  • Fix Landed on Version: 116
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): NPOTB

Beta/Release Uplift Approval Request

  • User impact if declined: Build failure on tier-3 (mips) builds
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): NPOTB
  • String changes made/needed: N/A
  • Is Android affected?: No
Attachment #9341855 - Flags: approval-mozilla-release?
Attachment #9341855 - Flags: approval-mozilla-esr115?
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
Attachment #9341855 - Flags: approval-mozilla-release?

Comment on attachment 9341855 [details]
Bug 1841197 - Undefine the mips builtin macro on mips in skia.

Approved for 115.1esr.

Attachment #9341855 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: