Closed Bug 1496027 Opened 6 years ago Closed 5 years ago

firefox-62 with --enable-webrtc cannot be compiled on linux/armhf

Categories

(Core :: WebRTC, defect, P5)

62 Branch
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: herrtimson, Unassigned)

Details

Attachments

(1 file)

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

Steps to reproduce:

compile firefox-62.0.2 on arm with CHOST=armv7-unknown-linux-gnueabihf 


Actual results:

the compile of webrtc fails with these multiple errors: 


298:38.93 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/ns_core.c:217:13: error: redefinition of 'NoiseEstimation' as different kind of symbol
298:38.93 static void NoiseEstimation(NoiseSuppressionC* self,
298:38.94             ^
298:38.95 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/nsx_core.h:175:16: note: previous definition is here
298:38.97 typedef void (*NoiseEstimation)(NoiseSuppressionFixedC* inst,
298:38.98                ^
298:39.11 In file included from /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/ff/media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_c_gn/Unified_c_udio_processing_c_gn0.c:29:
298:39.12 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/ns_core.c:1108:23: error: expected ')'
298:39.14   NoiseEstimation(self, magn, noise);
298:39.15                       ^
298:39.18 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/ns_core.c:1108:18: note: to match this '('
298:39.20   NoiseEstimation(self, magn, noise);
298:39.21                  ^
298:39.22 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/ns_core.c:1108:19: error: redefinition of 'self' with a different type: 'NoiseEstimation' (aka 'void (*)(struct NoiseSuppressionFixedC_ *, unsigned short *, unsigned int *, short *)') vs 'NoiseSuppressionC *' (aka 'struct NoiseSuppressionC_ *')
298:39.22   NoiseEstimation(self, magn, noise);
298:39.23                   ^
298:39.27 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/ns_core.c:1044:46: note: previous definition is here
298:39.28 void WebRtcNs_AnalyzeCore(NoiseSuppressionC* self, const float* speechFrame) {
298:39.28                                              ^
298:39.31 In file included from /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/ff/media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_c_gn/Unified_c_udio_processing_c_gn0.c:38:
298:39.31 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/nsx_core.c:303:13: error: conflicting types for 'UpdateNoiseEstimate'
298:39.32 static void UpdateNoiseEstimate(NoiseSuppressionFixedC* inst, int offset) {
298:39.32             ^
298:39.33 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/ns_core.c:801:13: note: previous definition is here
298:39.35 static void UpdateNoiseEstimate(NoiseSuppressionC* self,
298:39.36             ^
298:39.40 In file included from /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/ff/media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_c_gn/Unified_c_udio_processing_c_gn0.c:38:
298:39.41 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/nsx_core.c:437:41: error: too few arguments to function call, expected 5, have 2
298:39.42         UpdateNoiseEstimate(inst, offset);
298:39.43         ~~~~~~~~~~~~~~~~~~~             ^
298:39.46 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/ns_core.c:801:1: note: 'UpdateNoiseEstimate' declared here
298:39.49 static void UpdateNoiseEstimate(NoiseSuppressionC* self,
298:39.51 ^
298:39.52 In file included from /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/ff/media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_c_gn/Unified_c_udio_processing_c_gn0.c:38:
298:39.53 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/nsx_core.c:446:37: error: too few arguments to function call, expected 5, have 2
298:39.54     UpdateNoiseEstimate(inst, offset);
298:39.55     ~~~~~~~~~~~~~~~~~~~             ^
298:39.56 /var/tmp/portage/www-client/firefox-62.0.2/work/firefox-62.0.2/media/webrtc/trunk/webrtc/modules/audio_processing/ns/ns_core.c:801:1: note: 'UpdateNoiseEstimate' declared here
298:39.58 static void UpdateNoiseEstimate(NoiseSuppressionC* self,
298:39.59 ^



Expected results:

the compile should have completed with success
It seems that none of the files has been touched within a year, but as fare as I understood it the build system for webrtc has been updated to use gn now. Freebsd and aarch64 had some problems recently, have you added arm support yet or how is the situation? 

Toolchain is: 

gcc-7.3.0
glibc-2.26
binutils-2.30
rust/cargo-1.28.0
clang/llvm-6.0.1
Component: Untriaged → WebRTC: Audio/Video
Product: Firefox → Core
Dan, any thoughts on whether this should work or not?
Flags: needinfo?(dminor)
(In reply to tt_1 from comment #1)
> It seems that none of the files has been touched within a year, but as fare
> as I understood it the build system for webrtc has been updated to use gn
> now. Freebsd and aarch64 had some problems recently, have you added arm
> support yet or how is the situation? 
> 
> Toolchain is: 
> 
> gcc-7.3.0
> glibc-2.26
> binutils-2.30
> rust/cargo-1.28.0
> clang/llvm-6.0.1

Thank you for your report! Unfortunately we only have time and resources to maintain gn configurations for webrtc for "tier-1" platforms, basically the ones that we run in our CI. We're happy to take patches that add configurations for other platforms. The documentation is here: https://firefox-source-docs.mozilla.org/build/buildsystem/gn.html.

We're near the end of doing a webrtc.org update (Bug 1376873) so if you are interested in working on this I'd suggest waiting until that lands, or basing your work on top of it.
Status: UNCONFIRMED → NEW
Rank: 45
Component: WebRTC: Audio/Video → WebRTC
Ever confirmed: true
Flags: needinfo?(dminor)
Priority: -- → P5
Thanks for mentioning #1376873, I subscribed for it to get updates. 

Now, can you confirm that this is caused by the lack of support for arm in the gn files? 
Would I have to write a whole mighty json file or can I edit one that already exists? 

I may try to fix this on my own, but there is a lack of experience on my side and a lack of downspeed from my internet connection.
I think what is happening is that because we don't have a Linux on Arm configuration file in media/webrtc/gn-configs, you're getting a mismatch of preprocessor definitions for WEBRTC_NS_FLOAT, which is causing the error you are seeing.

If you don't want to go through the steps to generate a json file using gn, you might be able to adapt one of the other ones. It might be enough to copy arm_False_arm_freebsd.json to arm_False_arm_linux.json in media/webrtc/gn-configs and replace the references to FreeBsd with Linux and WEBRTC_BSD with WEBRTC_LINUX.

If you try that, running ./mach build-backend -b GnMozbuildWriter will regenerate the moz.build files and you can see if that fixes your build.
Hmm, I might be better off with using one of the linux templates and to take care of the cflags. I'll give it a try when I can afford some spare cycles, your suggesting to use ./mach build-backend will certainly be helpfull to cut down compile time. 

By the way, most of these json files have a reference/include pointing to /Users/dminor/src/firefox/.. or /home/dminor/src/firefox/.. , is this legit?
Yeah, there's a lot of noise in the json files. Those paths are ignored when we generate the moz.build files, but ideally we'd filter them out of the json files too.

Ubuntu has patches available to deal with this:

fix-armhf-webrtc-build.patch
webrtc-fix-compiler-flags-for-armhf.patch

can be found in:

https://launchpad.net/~ubuntu-mozilla-security/+archive/ubuntu/ppa/+sourcefiles/firefox/66.0.1+build1-0ubuntu0.18.04.1/firefox_66.0.1+build1-0ubuntu0.18.04.1.debian.tar.xz

don't know if they're acceptable for you, and if you're allowed to add them without getting permission from them.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME

this got somehow fixed along the way, firefox-68.1.0 and 69.0 are free of this problem.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: