Closed Bug 1592797 Opened 1 year ago Closed 1 year ago

Linker error (MediaKeys::ResolvePromiseWithResult undefined) when building under higher optimization levels

Categories

(Firefox for Android :: Audio/Video, defect, P3)

ARM
Android
defect

Tracking

()

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: acreskey, Assigned: acreskey)

References

Details

Attachments

(1 file)

In Bug 1591725 we're looking at building on Android with different optimization flags such as -O2.

I noticed the following linker error when building with -Os, -O2, and -O3:

/Users/acreskey/dev/firefox/src/mozilla-central/dom/media/eme/mediadrm/MediaDrmCDMProxy.cpp:297: error: undefined reference to 'void mozilla::dom::MediaKeys::ResolvePromiseWithResult<bool>(unsigned int, bool const&)'

It looks like this is failing because the template function is defined in the MediaKeys.cpp and isn't visible to MediaDrmCDMProxy.cpp's compilation unit.

I think a reasonable fix is to move the template definition from dom/media/eme/MediaKeys.cpp to dom/media/eme/MediaKeys.h (patch incoming).

An explicit definition of that specialization in the MediaKeys.cpp works too.

Seeing this linker error when building with optimization flags -O2 and others:
.../mozilla-central/dom/media/eme/mediadrm/MediaDrmCDMProxy.cpp:297: error: undefined reference to 'void mozilla::dom::MediaKeys::ResolvePromiseWithResult<bool>(unsigned int, bool const&)'

This patch moves the template definition from dom/media/eme/MediaKeys.cpp to dom/media/eme/MediaKeys.h

Blocks: 1591725
Assignee: nobody → acreskey
Status: NEW → ASSIGNED
Priority: -- → P3
Attachment #9105404 - Attachment description: Bug 1592797 - Fix MediaKeys linker error exposed with different optimization flags r=? → Bug 1592797 - Fix MediaKeys linker error exposed with different optimization flags r=johnlinp
Attachment #9105404 - Attachment description: Bug 1592797 - Fix MediaKeys linker error exposed with different optimization flags r=johnlinp → Bug 1592797 - Fix MediaKeys linker error exposed with different optimization flags r=
Attachment #9105404 - Attachment description: Bug 1592797 - Fix MediaKeys linker error exposed with different optimization flags r= → Bug 1592797 - Fix MediaKeys linker error exposed with different optimization flags r=edgar
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/5ee8c7c51c04
Fix MediaKeys linker error exposed with different optimization flags r=edgar
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
You need to log in before you can comment on or make changes to this bug.