Closed Bug 1585470 Opened 5 years ago Closed 4 years ago

Android cpu-features.c included twice when building GeckoView with --disable-webrtc

Categories

(Core :: WebRTC, defect, P3)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox71 --- wontfix
firefox80 --- fixed

People

(Reporter: sysrqb, Assigned: sysrqb, NeedInfo)

Details

(Whiteboard: [tor 31915])

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce:

Build Firefox for Android with |--disable-webrtc|

Actual results:

Multiple definitions due to cpu-features.c inclusion in two libraries.

https://searchfox.org/mozilla-central/source/media/libaom/moz.build#92
https://searchfox.org/mozilla-central/source/media/libvpx/moz.build#102

Expected results:

It should compile without error.

36:05.43 /home/android/.mozbuild/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /home/andr
oid/tor-browser/obj-arm-linux-androideabi/toolkit/library/../../media/libaom/cpu-features.o: multiple definition of 'android_getCpuCount'                                                                   
36:05.43 /home/android/.mozbuild/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: /home/android/tor
-browser/obj-arm-linux-androideabi/toolkit/library/../../media/libvpx/cpu-features.o: previous definition here
36:05.43 /home/android/.mozbuild/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /home/andr
oid/tor-browser/obj-arm-linux-androideabi/toolkit/library/../../media/libaom/cpu-features.o: multiple definition of 'android_getCpuFamily'
36:05.43 /home/android/.mozbuild/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: /home/android/tor
-browser/obj-arm-linux-androideabi/toolkit/library/../../media/libvpx/cpu-features.o: previous definition here
[...]

We found excluding cpu-features.c from libaom was enough for solving this because that is conditional on not CONFIG['MOZ_WEBRTC'] where as libvpx is unconditional:
https://gitweb.torproject.org/tor-browser.git/commit/?h=tor-browser-68.1.0esr-9.0-2&id=d09248948db5152475ee419d6f07e0f971b5817d

Whiteboard: [tor 31915]

Moving this to the GeckoView product for triage.

Component: Audio/Video → General
Product: Firefox for Android → GeckoView
Version: Firefox 68 → unspecified
Component: General → WebRTC
OS: Unspecified → Android
Product: GeckoView → Core
Summary: Android cpu-features.c included twice → Android cpu-features.c included twice when building GeckoView with --disable-webrtc

Set to P3 for now, feel free to change it.

Priority: -- → P3

https://firefoxci.taskcluster-artifacts.net/RwHGwwZTSE2U358shSgJZg/0/public/logs/live_backing.log

[task 2020-04-24T20:08:05.012Z] 20:08:05     INFO -  /builds/worker/fetches/android-ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: /builds/worker/workspace/obj-build/toolkit/library/build/../../../media/libaom/cpu-features.o: multiple definition of 'android_getCpuCount'

I ran two try builds. One with the patch and webrtc included, and another with the patch and webrtc excluded. Both of them built and passed cppunit, mochitests, and web-platform-tests for android-x86, android-api-16, and linux-x64.

With patch and webrtc: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6e1ce5092bac373b5f331b738b6b33a4636aaaf3
With patch and without webrtc: https://treeherder.mozilla.org/#/jobs?repo=try&revision=98c6ec425736de48c6573264e210a9dd7618ce7a

I submitted the patch for review (I'm not sure who should review this): https://phabricator.services.mozilla.com/D73085

Assignee: nobody → sysrqb

Hi Ralph, I saw you're the last person who touched this config block. If you're not a good reviewer for this patch then can you suggest someone else? Thanks.

Flags: needinfo?(giles)

Hi glandium, do you know who I can flag for r?

I'll rebase and re-run try builds, too.

Flags: needinfo?(mh+mozilla)

Flag me.

Flags: needinfo?(mh+mozilla)
Attachment #9144376 - Attachment is obsolete: true

Finally getting back to this.

Try build with the libaom moz.build patch on top of m-c tip.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=bcab497de768bd76334b2e0eb197b640589aac09

Try build with libaom moz.build patch and disabling webrtc in mozconfig.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=3863c6ef779b46567fbecda580fb3d5e049c00d6

And a Try build showing m-c is still broken without the suggested patch.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7bc0fe986e4290f89726321247ec20d84449a402

Pushed by abutkovits@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/847a2421d079
Remove duplicate cpu-features.c definition when building GV without webrtc r=glandium
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: