Closed Bug 1399315 Opened 2 years ago Closed 2 years ago

xpcom/string/precompiled_templates.cpp fails to build non-unified

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: cpearce, Assigned: froydnj)

References

Details

Attachments

(2 files)

xpcom/string/precompiled_templates.cpp doesn't build with unified build disabled.

I get lots of errors such if I disable unified build, such as:

 0:01.69 /home/cpearce/src/firefox/xpcom/string/precompiled_templates.cpp: In instantiation of 'int Compare(const mozilla::detail::nsTStringRepr<CharT>&, const mozilla::detail::nsTStringRepr<CharT>&, const nsTStringComparator<T>&) [with T = char]':
 0:01.69 /home/cpearce/src/firefox/xpcom/string/precompiled_templates.cpp:55:47:   required from here
 0:01.70 /home/cpearce/src/firefox/xpcom/string/precompiled_templates.cpp:55:47: error: explicit instantiation of 'int Compare(const mozilla::detail::nsTStringRepr<CharT>&, const mozilla::detail::nsTStringRepr<CharT>&, const nsTStringComparator<T>&) [with T = char]' but no definition available [-fpermissive]


Full error log attached.

I'm building on Linux with gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406.
I see this on clang builds for Android (bug 1163171, in progress) too.
Ah, this is because of NS_FASTCALL mismatches.
Assignee: nobody → nfroyd
The template declaration and definition of Compare use NS_FASTCALL,
while the explicit instantiation of Compare does not, which produces
complaints from newer compilers.  Add NS_FASTCALL to the explicit
instantiation so that things match up.

My Android x86 build on try seems happy with this change.
Attachment #8907786 - Flags: review?(erahm)
Blocks: 1393230
Comment on attachment 8907786 [details] [diff] [review]
declare explicit instantiations of Compare as NS_FASTCALL

Review of attachment 8907786 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for tracking this down Nathan.
Attachment #8907786 - Flags: review?(erahm) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/93d73e654498
declare explicit instantiations of Compare as NS_FASTCALL; r=erahm
https://hg.mozilla.org/mozilla-central/rev/93d73e654498
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Blocks: 1163171
You need to log in before you can comment on or make changes to this bug.