Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 681036 - >=www-client/firefox-66.0-r1 fails to compile on arm with: ../js/src/wasm/WasmSignalHandlers.cpp:520:19: error: field 'ufp' has incomplete type 'user_vfp'
Summary: >=www-client/firefox-66.0-r1 fails to compile on arm with: ../js/src/wasm/Was...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-20 14:19 UTC by tt_1
Modified: 2021-08-15 16:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
compressed build.log (firefox-66.0-f1-arm.log.gz,103.44 KB, application/gzip)
2019-03-20 14:21 UTC, tt_1
Details
emerge --info from cross-emerge (cross-emerge-info,4.88 KB, text/plain)
2019-03-20 14:25 UTC, tt_1
Details
arm fp reg patch plucked from debian gitlab (firefox-68.0.2-arm-fp-wasm-fixes.patch,607 bytes, patch)
2019-09-21 17:15 UTC, Steve Arnold
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2019-03-20 14:19:22 UTC
emerging new firefox-66.0-r1 ebuild for arm fails with this beauty: 

 1:10.89 In file included from /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/www-client/firefox-66.0-r1/work/firefox-66.0/ff/js/src/wasm/Unified_cpp_js_src_wasm2.cpp:29:
 1:10.89 /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/www-client/firefox-66.0-r1/work/firefox-66.0/js/src/wasm/WasmSignalHandlers.cpp:520:19: error: field 'ufp' has incomplete type 'user_vfp'
 1:10.89    struct user_vfp ufp;
 1:10.89                    ^~~
 1:10.89 /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/www-client/firefox-66.0-r1/work/firefox-66.0/js/src/wasm/WasmSignalHandlers.cpp:520:10: note: forward declaration of 'struct user_vfp'
 1:10.89    struct user_vfp ufp;
 1:10.89           ^~~~~~~~
 1:10.89 /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/www-client/firefox-66.0-r1/work/firefox-66.0/js/src/wasm/WasmSignalHandlers.cpp:521:23: error: field 'ufp_exc' has incomplete type 'user_vfp_exc'
 1:10.89    struct user_vfp_exc ufp_exc;
 1:10.89                        ^~~~~~~
 1:10.89 /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/www-client/firefox-66.0-r1/work/firefox-66.0/js/src/wasm/WasmSignalHandlers.cpp:521:10: note: forward declaration of 'struct user_vfp_exc'
 1:10.89    struct user_vfp_exc ufp_exc;
 1:10.89           ^~~~~~~~~~~~
 1:10.89 gmake[4]: *** [/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/www-client/firefox-66.0-r1/work/firefox-66.0/config/rules.mk:1108: Unified_cpp_js_src_wasm2.o] Error 1

this is a cross-compile, but it shouldn't matter.
Comment 1 tt_1 2019-03-20 14:21:34 UTC
Created attachment 569968 [details]
compressed build.log

the full build log
Comment 2 tt_1 2019-03-20 14:23:49 UTC
Basically this happens as the build tries to inherit headers which are only present on android. 

patch to fix it, from #1526653:

https://hg.mozilla.org/mozilla-central/rev/322de2cc8019
Comment 3 tt_1 2019-03-20 14:25:37 UTC
Created attachment 569970 [details]
emerge --info from cross-emerge

if someone's interested into the emerge --info, here it is
Comment 4 Larry the Git Cow gentoo-dev 2019-03-20 15:52:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5548320f5a3160b9134274850f6ea76e90ad5fa

commit d5548320f5a3160b9134274850f6ea76e90ad5fa
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-03-20 15:49:51 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-03-20 15:51:59 +0000

    www-client/firefox: unbreak arm
    
    Add some patches to fix building on arm.
    
    Closes: https://bugs.gentoo.org/681036
    Closes: https://bugs.gentoo.org/678204
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 www-client/firefox/Manifest               | 2 +-
 www-client/firefox/firefox-66.0-r1.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 5 tt_1 2019-03-22 08:40:36 UTC
Upstream closed their bug as fixed, but the patch isn't sufficent for fixing the compile. An extended fix would be: 

diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
index 488d897..a4a76ee 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -243,7 +243,6 @@ using mozilla::DebugOnly;
 // emulation here.
 
 #if defined(__linux__) && defined(__arm__)
-#  define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS
 #endif
 
 #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS


or it could be: https://archlinuxarm.org/packages/armv7h/firefox/files/arm.patch
Comment 6 tt_1 2019-09-12 19:04:58 UTC
there's a proposed fix from debian, which I think copies over the correct defines from the linux kernel header files: 

https://salsa.debian.org/mozilla-team/firefox/commit/fd6847c9416f9eebde636e21d794d25d1be8791d

still no upstream patch
Comment 7 Steve Arnold archtester gentoo-dev 2019-09-21 17:13:45 UTC
I just tested the "disable" fix, and also made a patch like that debian one, and both allow firefox to compile.  The missing structs are apparently only in the android bionic libc, so I have no idea where they get "not in all linux distros" or "tier 3" since android/bionic is *not* linux or a distro...

Anyway, firefox will *not* build on arm without a fix, so we could really use a patch in the tree for this; the debian approach seems fine.
Comment 8 Steve Arnold archtester gentoo-dev 2019-09-21 17:15:23 UTC
Created attachment 590540 [details, diff]
arm fp reg patch plucked from debian gitlab
Comment 9 David Flogeras 2019-09-26 16:30:06 UTC
Hit this on armv7a (cubieboard2) compiling firefox-68.1.0.  The attached patch worked for me.
Comment 10 tt_1 2019-09-26 16:42:18 UTC
Do you think you could head over to mozbugtracker and help me to annoy a few of their dev's? It seems that this is a bit of a deadlock situation, concerning android vs gnu headers and license issues.
Comment 11 David Flogeras 2019-10-07 10:44:17 UTC
Sorry, I forgot to subscribe.  Do you mean me?  I'd happily add a +1 if you point me at a bug.
Comment 12 tt_1 2019-10-09 21:32:40 UTC
yeah, I meant you. It is mozbg #1526653, as it's mentioned in the see also section of this bug. The problem with this bug is, that it would need to add defines from the gnu linux header files to the firefox code, which would create a license issue for mozilla, and so they rejected that idea. Fair enough, but the corresponding android header files are identical. This all comes down to the mozilla policy of not caring too much about arm targets other than android.
Comment 13 David Flogeras 2019-10-10 10:06:29 UTC
Right, I missed that somehow.

Just added my $0.02 to the upstream bug, for what it's worth.
Comment 14 tt_1 2019-12-20 19:35:00 UTC
there's a proper patch in the patchset of firefox-71.0, but upstream still doesn't care :(
Comment 15 David Heidelberg (okias) 2020-01-04 12:50:50 UTC
(In reply to tt_1 from comment #14)
> there's a proper patch in the patchset of firefox-71.0, but upstream still
> doesn't care :(

so you did managed to build it on armhf ? or armv7 ?
Comment 16 tt_1 2020-01-04 12:57:53 UTC
sure, with said patch from debian it's no problem on armv7a-unknown-linux-gnueabihf, but upstream is relucant to fix the mess they created in the first place.
Comment 17 David Heidelberg (okias) 2020-01-04 14:52:18 UTC
I found out, that my CPU has armv7 support, so that's enough :P Only Rpi1 and RpiZero has pure armhf, which probably no-one will use for browsing internet with Firefox.
Comment 18 Thomas Deutschmann (RETIRED) gentoo-dev 2020-10-10 20:36:53 UTC
Is this still an issue with >=www-client/firefox-78.3.1?
Comment 19 tt_1 2020-10-11 05:39:51 UTC
the upstream bug is still unresolved, so yes this is still a problem with thunderbird, firefox and spidermonkey

upstream claims it's some sort of licensing issue for why they don't want to merge the patch, and maybe it will turn into a permabug therefore :-/
Comment 20 Thomas Deutschmann (RETIRED) gentoo-dev 2020-10-11 11:34:50 UTC
But we are shipping a patch for this, right?
Comment 21 tt_1 2020-10-11 12:15:15 UTC
that's correct
Comment 22 Thomas Deutschmann (RETIRED) gentoo-dev 2020-10-11 13:47:59 UTC
OK, so I would like to keep this bug as resolved because the issue is addressed in Gentoo's package and the patch we carry has a reference to this bug.
Comment 23 tt_1 2021-08-06 17:11:49 UTC
upstream has fixed this now for good, the patches are in two seperate bugs - the order matters and is correct this way:

https://bugzilla.mozilla.org/show_bug.cgi?id=1723930
https://bugzilla.mozilla.org/show_bug.cgi?id=1587757

I'll ask for a backport to the 91.0-esr branch
Comment 24 tt_1 2021-08-15 16:32:57 UTC
(In reply to tt_1 from comment #23)
> upstream has fixed this now for good, the patches are in two seperate bugs -
> the order matters and is correct this way:
> 
> https://bugzilla.mozilla.org/show_bug.cgi?id=1723930
> https://bugzilla.mozilla.org/show_bug.cgi?id=1587757
> 
> I'll ask for a backport to the 91.0-esr branch

third patch needed to fix wasm
https://bugzilla.mozilla.org/show_bug.cgi?id=1724475


all three relevant patches are already backported and merged into firefox-91esr, so for firefox-91.1.0 the 0011* patch should be removed from the patchset.