Cross Compiling Firefox Raspberry Pi
Categories
(Firefox Build System :: General: Unsupported Platforms, enhancement, P5)
Tracking
(Not tracked)
People
(Reporter: pete, Unassigned)
Details
Attachments
(10 files)
Reporter | ||
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Updated•7 years ago
|
Reporter | ||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Reporter | ||
Comment 4•7 years ago
|
||
Updated•6 years ago
|
it's certainly possible to cross compile firefox-60esr, use these:
--disable-webrtc ; or use patches from debian/ubuntu
--disable-elfhack ; it may not work (depends on distro)
use gcc for compiling, and pass --disable-stylo ; this avoids clang/llvm hassle.
Also it needs more memory at runtime, and it's both slow with our without compared to the performance of a full Desktop.
feel free to ask if you're still in trouble.
Reporter | ||
Comment 6•5 years ago
|
||
Will do. Thanks for the tips. I plan on resuming this work this summer if time allows.
If you can't make it before the new firefox-68esr, you might want to read about #1542622
Reporter | ||
Comment 8•5 years ago
|
||
11:35.13 error[E0432]: unresolved import simd_funcs
11:35.13 --> /home/petejc/build/mozilla/third_party/rust/encoding_rs/src/x_user_defined.rs:16:13
11:35.13 |
11:35.13 16 | use simd_funcs::*;
11:35.13 | ^^^^^^^^^^ maybe a missing crate simd_funcs
?
Latest errors attempting to compile 68ESR release.
simd_funcs.rs is indeed on my system. Not sure why it's not importing.
well, I might help you, but can't unless you upload your full logs. It's certainly possible to make this work, I just cross compiled v68.3.0 half an hour ago.
Comment 11•5 years ago
|
||
you have to update your build host first, ubuntu 14.04 doesn't have recent enough toolchains.
Reporter | ||
Comment 12•5 years ago
|
||
Any suggestions?
Ubuntu 18.04?
Thanks
Comment 13•5 years ago
|
||
debian 10 is your best bet at the moment, given that the distro running on the rpi is a debian based distro.
you must be aware of dependencies.
Reporter | ||
Comment 14•5 years ago
|
||
Upgraded to Debain 10 installed arm toolchain and libs.
Getting same rust import error posted above.
Reporter | ||
Comment 15•5 years ago
|
||
Reporter | ||
Comment 16•5 years ago
•
|
||
Maybe I should use an older version of rust.
I am using 1.39 (latest)
[Nope, doesn't work.]
Reporter | ||
Comment 17•5 years ago
|
||
I commented out: --enable-rust-simd
To see if that will work.
Reporter | ||
Comment 18•5 years ago
|
||
Keep running into this error now.
Comment 19•5 years ago
|
||
That's due to an androidism in spidermonkey.
Basically it assumes that all arm is android, hence it relies on sys/user.h from Android headers.
use this patch to incoperate the missing bits from linux-headers: https://bugzilla.mozilla.org/show_bug.cgi?id=1526653#c20
Reporter | ||
Comment 20•5 years ago
|
||
Is there an arm patch for mdb.c?
Comment 21•5 years ago
|
||
Do you have that header installed, specifically for the use of cross compiling?
Reporter | ||
Comment 22•5 years ago
|
||
Ok, I think I see the problem.
Reporter | ||
Comment 23•5 years ago
|
||
This unresolved import simd_funcs
issue is persistent.
simd_funcs.rs is indeed present. Not sure why the import is failing here.
Comment 24•5 years ago
|
||
Make sure to have applied all patches from ubuntu, specifically for arm. I know you propably didn't, as the wasm bug you hit in #18 is fixed by a patch which is used by ubuntu. The rules/debian file will tell you which of the patches you need. Also make sure that your rustc is the same as used for the official ubuntu binary, for most new version of rust there's a bit to patch for the firefox source code tree.
Also it seems to me that your usage of clang is part of the problem. While it might be true that mozilla themselves and ubuntu prefere clang over gcc for building their binaries, it doesn't mean that cross compiling with the same patches and config options will be an easy task.
I added a screenshot from my own rpi2, with the proof that using gcc for compilation does give a working binary. But this is from gentoo, not ubuntu.
Reporter | ||
Comment 25•5 years ago
|
||
Will do thanks...
Reporter | ||
Comment 26•5 years ago
•
|
||
I added a screenshot from my own rpi2
Since you have successfully built FF68 for rpi, can you post your core patch and mozconfig files here?
That would be very helpful.
Thanks
Reporter | ||
Comment 27•5 years ago
|
||
Here is a good link on how to install Debian apt source.
https://wiki.debian.org/BuildingTutorial
I am looking at the source files and count 395 patch files.
I have always built mozilla directly and never used an OS distribution patched sources.
So this is new to me.
Comment 28•5 years ago
|
||
I must say that I find it really frustrating to see that you don't seem to have any idea how to build packages for your distro, but not sharing any valueable information with us to make your case understandable shows a serious lack of respect. I'm glad to help you out if I can with cross compile specific bugs, but be aware that it's not my job to solve your problems with understanding how your distro works. Please contact them in their irc, or find other ways of support to understand how to build packages. Then how to cross build packages.
It's 22. The number of patches in the patchset. It's beyond me how you can count 395.
Reporter | ||
Comment 29•5 years ago
•
|
||
I am almost finished compiling the debian 10 (buster) arm for rpi distro. I am a mozilla developer who builds mozilla directly from source on all platforms and like I said, I never worked with debian or any other Linux distro source packaging system. I read the doc I posted today and it became pretty clear how to proceed. I think this was all assumed.
When I verify this build has succeeded, I intend to document this process for others. Note, this is a mozilla bug that I filed so my context was not in the debian source build/packaging world. So from the start, I think there was a giant misconception here.
Anyway, I greatly appreciate your help. I should soon have a Debian patched arm build of firefox-esr-68.2.0 completed and successful. I can take it from there.
Again thanks for the help. It really is appreciated.
Peace
Reporter | ||
Comment 30•5 years ago
|
||
Reporter | ||
Comment 31•5 years ago
•
|
||
To Summarize
- I installed Debian 10 (buster) x86_64 to a VM
- I then installed the Raspberry Pi distribution of buster
- Using chroot, I then installed via apt
a. Firefox build dependencies
b. Firefox Debian source distribution - Then built the Debian cross compiled source for arm pi
- Verified on a pi system
This overall, is a baroque process which I will document in detail step by step. Also using the existing outdated documentation it became very confusing. For example using crosstool-ng is unnecessary. Also, installing mozilla build dependencies using ./mach bootstrap was also unnecessary as the correct toolchain can be installed via apt.
Comment 32•5 years ago
|
||
I'm glad you've made it, still it's kind of amusing to see the host and target both being arm, despite that you cross compiled the binary. You could propably relax the cflags a bit, those linking errors targeted by disabling schedule-insns were due to a bug somewhere in <gcc-6.4.0 I believe. Still having these in the setup might be a bug at debian.
Reporter | ||
Comment 33•5 years ago
•
|
||
Interesting, I was able to cross compile for raspi from an independent mercurial cloned FIREFOX_68_2_0esr_RELEASE with only two minor patches and a fairly simple .mozconfig file independent of the apt Debian source release. This is very good. Makes the process a lot easier for moz developers IMO.
Reporter | ||
Comment 34•3 years ago
|
||
Firefox91.4.0-esr running on Raspberry Pi.
Debian 10 Buster builds posted here: https://www.mozdevgroup.com/dropbox/firefox/91/raspi/
Reporter | ||
Updated•3 years ago
|
Updated•2 years ago
|
Description
•