Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Emerging firefox-60.0.1 on arm64 (patches)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 409

PostPosted: Sun Jun 03, 2018 1:29 pm    Post subject: Emerging firefox-60.0.1 on arm64 (patches) Reply with quote

Hello,

to get the current in-tree firefox-60.0.1 to build on arm64, two additional patches are required. These are both afaik accepted upstream at Mozilla, so the next point release should automatically work, but if you want to get something running now, the following may be of interest.

First, there is an issue where www-client/firefox-60.0.1 tries to build various sse2-optimized sources, which obviously fails on arm64. This is Gentoo bug #657146, and Mozilla bug #1434589.
The following is the relevant part of the (much larger) patch submitted on the Mozilla bug report thread (the original patch also adds ppc64 support):
Code:
diff -r 2b504eb4567d -r 2a266219f547 media/webrtc/trunk/moz.build
--- a/media/webrtc/trunk/moz.build   Wed May 23 13:03:58 2018 +1200
+++ b/media/webrtc/trunk/moz.build   Sun May 27 22:21:07 2018 -0700
@@ -143,12 +143,8 @@
 if CONFIG["OS_TARGET"] == "Linux":
 
     DIRS += [
-        "/media/webrtc/trunk/webrtc/common_audio/common_audio_sse2_gn",
-        "/media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_sse2_gn",
-        "/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn",
         "/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_gn",
         "/media/webrtc/trunk/webrtc/modules/desktop_capture/primitives_gn",
-        "/media/webrtc/trunk/webrtc/modules/video_processing/video_processing_sse2_gn",
         "/media/webrtc/trunk/webrtc/system_wrappers/cpu_features_linux_gn",
         "/media/webrtc/trunk/webrtc/video_engine/video_engine_gn"
     ]
@@ -185,6 +181,24 @@
         "/media/webrtc/trunk/webrtc/modules/video_processing/video_processing_neon_gn"
     ]
 
+if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":
+
+    DIRS += [
+        "/media/webrtc/trunk/webrtc/common_audio/common_audio_sse2_gn",
+        "/media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_sse2_gn",
+        "/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn",
+        "/media/webrtc/trunk/webrtc/modules/video_processing/video_processing_sse2_gn"
+    ]
+
+if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux":
+
+    DIRS += [
+        "/media/webrtc/trunk/webrtc/common_audio/common_audio_sse2_gn",
+        "/media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_sse2_gn",
+        "/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn",
+        "/media/webrtc/trunk/webrtc/modules/video_processing/video_processing_sse2_gn"
+    ]
+
 if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android":
 
     DIRS += [


The second issue is that some skia code fails to build under gcc (6.4.0, at any rate), producing "error: ‘vcvt_f16_f32’ was not declared in this scope". This is Mozilla bug # 1453892, for which the patch is:
Code:
From: Mike Hommey <mh+mozilla@glandium.org>
Date: Sat, 19 May 2018 12:03:56 +0900
Subject: Bug 1462868 - Fix Skia build on arm64 linux with GCC. r?lsalzman

---
 gfx/skia/skia/src/jumper/SkJumper_stages.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gfx/skia/skia/src/jumper/SkJumper_stages.cpp b/gfx/skia/skia/src/jumper/SkJumper_stages.cpp
index 19b6cd694aa6..36792390dece 100644
--- a/gfx/skia/skia/src/jumper/SkJumper_stages.cpp
+++ b/gfx/skia/skia/src/jumper/SkJumper_stages.cpp
@@ -666,7 +666,7 @@ SI F approx_powf(F x, F y) {
 }
 
 SI F from_half(U16 h) {
-#if defined(__aarch64__) && !defined(SK_BUILD_FOR_GOOGLE3)  // Temporary workaround for some Google3 builds.
+#if defined(JUMPER_IS_NEON) && !defined(SK_BUILD_FOR_GOOGLE3)  // Temporary workaround for some Google3 builds.
     return vcvt_f32_f16(h);
 
 #elif defined(JUMPER_IS_HSW) || defined(JUMPER_IS_AVX512)
@@ -686,7 +686,7 @@ SI F from_half(U16 h) {
 }
 
 SI U16 to_half(F f) {
-#if defined(__aarch64__) && !defined(SK_BUILD_FOR_GOOGLE3)  // Temporary workaround for some Google3 builds.
+#if defined(JUMPER_IS_NEON) && !defined(SK_BUILD_FOR_GOOGLE3)  // Temporary workaround for some Google3 builds.
     return vcvt_f16_f32(f);
 
 #elif defined(JUMPER_IS_HSW) || defined(JUMPER_IS_AVX512)


To apply these, create the directory /etc/portage/patches/www-client/firefox-60.0.1, and then save the first patch above as (e.g.) Bug-1434589-Fix-sse2-dependency-for-linux.patch and the second patch above as (e.g.) Bug-1453892-Fix-Skia-build-on-arm64-linux-with-GCC.patch within that directory (for more details on using /etc/portage/patches, please see these notes).

Then emerge firefox-60.0.1 again, it should build cleanly this time.

If you'd prefer to use a binary package, I have one available for firefox-60.0.1 on arm64 here. I have also pushed a patched www-client/firefox-60.0.1 ebuild to the rpi3-overlay used by the gentoo-on-rpi3-64bit image, so if you are using this image, on your next weekly genup run firefox should upgrade automatically to 60.0.1 (using the binhost binary package).
_________________
Regards,

sakaki
Back to top
View user's profile Send private message
Maleita
Apprentice
Apprentice


Joined: 16 Sep 2004
Posts: 246
Location: Brasil -> São Paulo->Campinas

PostPosted: Mon Jun 04, 2018 12:58 am    Post subject: firefox-bin Reply with quote

install firefox-bin
Back to top
View user's profile Send private message
bobbymcgee
n00b
n00b


Joined: 12 Apr 2018
Posts: 55

PostPosted: Mon Jun 04, 2018 2:41 am    Post subject: Re: firefox-bin Reply with quote

Maleita wrote:
install firefox-bin


is that thank you in Portuguese?

Seriously though, thanks for your work Sakaki.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22853

PostPosted: Mon Jun 04, 2018 3:34 am    Post subject: Re: firefox-bin Reply with quote

Maleita wrote:
install firefox-bin
Could you explain why you think that is good advice here? This is a thread about ARM, a CPU family that cannot run x86/amd64 code. www-client/firefox-bin is keyworded -* ~amd64 ~x86, because no Gentoo maintainer has provided a prebuilt ARM Firefox. Thus, install firefox-bin is impossible for ARM users.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54638
Location: 56N 3W

PostPosted: Mon Jun 04, 2018 3:01 pm    Post subject: Reply with quote

Hu,

firefox-bin pulls the upstream binary build. If it didn't, we could not call it firefox, nor use the firefox logo.
If there is an upstream -bin for arm64, then the firefox-bin ebuild could be expanded to arm64.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54638
Location: 56N 3W

PostPosted: Mon Jun 04, 2018 4:34 pm    Post subject: Reply with quote

Sakaki,

Thank you.

I can confirm that both patches are required with gcc-7.3 too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum