Closed Bug 1951697 Opened 4 days ago Closed 1 day ago

Missing include (mozilla/Attributes.h) in build/unix/profiling/profiling.cpp

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox138 fixed)

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: elsandosgrande, Assigned: elsandosgrande, NeedInfo)

Details

Attachments

(2 files)

When building Firefox Nightly with libc++ on Linux — tested with libc++19 and both Clang 19 and GCC 14 — the following error occurs:

8 1:32.60 /var/tmp/portage/www-client/firefox-9999/work/firefox-9999/build/unix/profiling/profiling.cpp:40:1: error: unknown type name 'MOZ_RUNINIT'
8 1:32.60    40 | MOZ_RUNINIT int __llvm_profile_runtime = CustomRegisterRuntime();
8 1:32.60       | ^

After digging through the code on Searchfox and GitHub, I concluded that mfbt/Attributes.h is the only header which defines MOZ_RUNINIT and that there is thus a missing include in build/unix/profiling/profiling.cpp: #include "mozilla/Attributes.h"

Then, when trying to build Firefox Nightly with GCC 14 and libstdc++, I saw that I wasn't getting the aforementioned error. After digging a bit further with the help of GCC's preprocessor output (which I can only barely parse), I concluded that the aforementioned include was present in libstdc++ builds as a transitive include thanks to stl_wrappers magic: https://searchfox.org/mozilla-central/diff/13d864c116029fe5d067d589005f49c1c46f74b5/memory/mozalloc/throw_gcc.h#13


I chose the product based on https://firefox-source-docs.mozilla.org/mots/index.html#core-build-config and the component based on its description, that is I could not find a more specific component which seemed like a better fit. My apologies if I chose the wrong product and/or component.

Hi :gerard-majax !

Can you help me move this bug into a more proper component? I am asking you because you wrote the file build/unix/profiling/profiling.cpp Thank you.

Flags: needinfo?(lissyx+mozillians)

I'm not sure I'll ask around but build is likely the best place

Flags: needinfo?(lissyx+mozillians)
Product: Core → Firefox Build System
Flags: needinfo?(sguelton)
Assignee: nobody → sguelton
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee: sguelton → sandyvujakovicj
Attachment #9470049 - Attachment description: Bug 1951697 - Add missing include for MOZ_RUNINIT r=gerard-majax → Bug 1951697 - Add missing include for MOZ_RUNINIT r=gerard-majax!

Patch updated with the proper attribution

Flags: needinfo?(sguelton)
Pushed by alissy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/45979a46e612 Add missing include for MOZ_RUNINIT r=gerard-majax
Flags: needinfo?(sandyvujakovicj) → needinfo?(sguelton)
Pushed by sguelton@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6354ee4fbdc3 Add missing include for MOZ_RUNINIT r=gerard-majax
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: