[gcc6] PGO builds fail with undefined reference to `gfxShapedWord* gfxFont::GetShapedWord ...

RESOLVED FIXED in Firefox 57

Status

()

Core
Graphics: Text
RESOLVED FIXED
10 months ago
10 months ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

unspecified
mozilla57
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox57 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

10 months ago
INFO -  ../../gfx/thebes/Unified_cpp_gfx_thebes1.o: In function `gfxTextRun::SetSpaceGlyph(gfxFont*, mozilla::gfx::DrawTarget*, unsigned int, mozilla::gfx::ShapedTextFlags)':
INFO -  /home/worker/workspace/build/src/gfx/thebes/gfxTextRun.cpp:1624: undefined reference to `gfxShapedWord* gfxFont::GetShapedWord<unsigned char>(mozilla::gfx::DrawTarget*, unsigned char const*, unsigned int, unsigned int, mozilla::unicode::Script, bool, int, mozilla::gfx::ShapedTextFlags, gfxFontShaper::RoundingFlags, gfxTextPerfMetrics*)'
INFO -  /home/worker/workspace/build/src/gcc/bin/ld: libxul.so: hidden symbol `_ZN7gfxFont13GetShapedWordIhEEP13gfxShapedWordPN7mozilla3gfx10DrawTargetEPKT_jjNS3_7unicode6ScriptEbiNS4_15ShapedTextFlagsEN13gfxFontShaper13RoundingFlagsEP18gfxTextPerfMetrics' isn't defined
INFO -  /home/worker/workspace/build/src/gcc/bin/ld: final link failed: Bad value
INFO -  collect2: error: ld returned 1 exit status
INFO -  /home/worker/workspace/build/src/config/rules.mk:717: recipe for target 'libxul.so' failed
(Assignee)

Comment 1

10 months ago
The reason this happens is that there's a template method declared in gfxFont.h and defined in gfxFont.cpp, and used in both gfxFont.cpp and gfxTextRun.cpp. The split was done 3 years ago, and we've been lucky until now, that the instantiation of the template in gfxFont.cpp was not optimized out... until GCC 6 PGO, which, apparently, happily inlines the function in gfxFont.cpp, such that there's nothing left for gfxTextRun to find.
Assignee: mh+mozilla → nobody
Blocks: 1066043
Component: Build Config → Graphics: Text
So is the proper approach to have an explicit instantiation of the method (like I see we already have for SplitAndInitTextRun, at https://dxr.mozilla.org/mozilla-central/rev/5322c03f4c8587fe526172d3f87160031faa6d75/gfx/thebes/gfxFont.cpp#3115)?

(We'd only need to do this for the <uint8_t> version of the method, afaics, as that's the one gfxTextRun uses.)
(Assignee)

Comment 3

10 months ago
Yes, or move the template to the header.

Note that I did try the explicit instantiation, and it failed to build:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=fddc9e6782dfb141dfe0a02b5e3bc949c32e81d2

But maybe I botched it?
Comment hidden (mozreview-request)
(Assignee)

Updated

10 months ago
Assignee: nobody → mh+mozilla

Comment 6

10 months ago
mozreview-review
Comment on attachment 8896247 [details]
Bug 1389436 - Explicitly instantiate gfxFont::GetShapedWord<uint8_t> for its use in gfxTextRun.cpp.

https://reviewboard.mozilla.org/r/167540/#review172718
Attachment #8896247 - Flags: review?(jfkthame) → review+

Comment 7

10 months ago
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/97dae871389b
Explicitly instantiate gfxFont::GetShapedWord<uint8_t> for its use in gfxTextRun.cpp. r=jfkthame

Comment 8

10 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/97dae871389b
Status: NEW → RESOLVED
Last Resolved: 10 months ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
(Assignee)

Updated

10 months ago
Duplicate of this bug: 1332788
You need to log in before you can comment on or make changes to this bug.