Hi,

I have been building chromium for (and on) an armhf machine for more
than a year using the first two of the attached patches (rebased onto
debian/46.0.2490.71-1). I also suffered from the OOM issue during
linking, but I solved it by disabling generating debug symbols (not in
included in the patches!). I will test the new binutils tonight.

Until recently I was unable to build chromium using clang. That is, it
works, but maps.google.com did not. I tracked down the problem and
submitted a patch upstream, see [V8:2140#c24]. Pending approval I've
included the patch in the debian package as well (third patch).

You can also find the patches on [github-pkg-chromium].

[V8:2140#c24]: https://code.google.com/p/v8/issues/detail?id=2140#c24
[github-pkg-chromium]:
https://github.com/joostvanzwieten/pkg-chromium/compare/armhf?expand=1

Best, Joost
From 7d4888a469a1df7dc04de386fe58cf3488bc0b9c Mon Sep 17 00:00:00 2001
From: Joost van Zwieten <joostvanzwie...@gmail.com>
Date: Sun, 24 Aug 2014 23:46:07 +0200
Subject: [PATCH 1/3] enable armhf

---
 debian/control |  6 +++---
 debian/rules   | 10 ++++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 5172532..cfe66a8 100644
--- a/debian/control
+++ b/debian/control
@@ -84,7 +84,7 @@ Build-Depends:
 Standards-Version: 3.9.6
 
 Package: chromium
-Architecture: i386 amd64
+Architecture: i386 amd64 armhf
 Built-Using: ${Built-Using}
 Depends:
  ${misc:Depends},
@@ -105,7 +105,7 @@ Description: web browser
  This package contains the web browser component.
 
 Package: chromium-dbg
-Architecture: i386 amd64
+Architecture: i386 amd64 armhf
 Section: debug
 Priority: extra
 Built-Using: ${Built-Using}
@@ -134,7 +134,7 @@ Description: web browser - language packs
  ro, ru, sk, sl, sr, sv, sw, ta, te, th, tr, uk, vi, zh-CN, zh-TW
 
 Package: chromedriver
-Architecture: i386 amd64
+Architecture: i386 amd64 armhf
 Depends:
  ${misc:Depends},
  ${shlibs:Depends},
diff --git a/debian/rules b/debian/rules
index cb86461..edd45eb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -83,6 +83,16 @@ defines+=use_system_icu=0 \
 #  can't use system nss since net/third_party/nss is heavily patched
 #  can't use system ots (open text *summarizer*) since that's not google's ots (open text *sanitizer*)
 
+ifeq (armhf,$(DEB_HOST_ARCH))
+# arm_version=7, arm_neon=0 selects arm_arch=armv7-a, arm_tune=generic-armv7-a, arm_fpu=vfpv3-d16
+# webrtc is not compatible with arm_neon=0
+defines+=sysroot= \
+         target_arch=arm \
+         arm_version=7 \
+         arm_neon=0 \
+         enable_webrtc=0
+endif
+
 # make gyp a little more informative
 options+=--check \
          --debug=includes \
-- 
2.6.1

From aa7b29e2fbb008e6104a531fb0ed6042fedd39d3 Mon Sep 17 00:00:00 2001
From: Joost van Zwieten <joostvanzwie...@gmail.com>
Date: Wed, 3 Dec 2014 10:04:27 +0100
Subject: [PATCH 2/3] disable sse2 message for arm platforms

---
 debian/scripts/chromium | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/scripts/chromium b/debian/scripts/chromium
index 28f2854..a0b5c9e 100644
--- a/debian/scripts/chromium
+++ b/debian/scripts/chromium
@@ -31,7 +31,7 @@ For more information, please read and possibly provide input to their
 bug tracking system at http://crbug.com/348761.";
 
 # Check whether this system supports sse2
-if test -z "$(grep sse2 /proc/cpuinfo)"; then
+if test -z "$(grep sse2 /proc/cpuinfo)" -a -z "$(uname -m | grep arm)"; then
   xmessage "$nosse2"
   exit 1
 fi
-- 
2.6.1

From 16ccedf6f23220a42793b84f3c84617260cfaf4c Mon Sep 17 00:00:00 2001
From: Joost van Zwieten <joostvanzwie...@gmail.com>
Date: Mon, 2 Nov 2015 22:54:47 +0100
Subject: [PATCH 3/3] fix detection of ARM hard float ABI with clang

Bug reported upstream [2140#c24].  Pending approval applying the patch here.

[2140#c24] https://code.google.com/p/v8/issues/detail?id=2140#c24
---
 ...etection-of-ARM-hard-float-ABI-with-clang.patch | 48 ++++++++++++++++++++++
 debian/patches/series                              |  2 +
 2 files changed, 50 insertions(+)
 create mode 100644 debian/patches/fix-detection-of-ARM-hard-float-ABI-with-clang.patch

diff --git a/debian/patches/fix-detection-of-ARM-hard-float-ABI-with-clang.patch b/debian/patches/fix-detection-of-ARM-hard-float-ABI-with-clang.patch
new file mode 100644
index 0000000..aee0246
--- /dev/null
+++ b/debian/patches/fix-detection-of-ARM-hard-float-ABI-with-clang.patch
@@ -0,0 +1,48 @@
+From b4d5d97f6a1446babda7cebcb039ed7fef7b73fd Mon Sep 17 00:00:00 2001
+From: Joost van Zwieten <joostvanzwie...@gmail.com>
+Date: Mon, 2 Nov 2015 21:47:21 +0100
+Subject: [PATCH] fix detection of ARM hard float ABI with clang
+
+The Linux version of `base::OS::ArmUsingHardFloat`, defined in
+`src/base/platform/platform-linux.cc`, always returns `false` when compiling V8
+with Clang, regardless of the target float ABI.  When targeting ARMv7 with hard
+float ABI this results in faulty `fast_exp` and `fast_sqrt` functions,
+generated using masm in `src/arm/codegen-arm.cc`.
+
+As the behavior of Clang equals the latest versions of GCC, use the same test
+when we are being compiled by Clang.
+---
+ src/base/platform/platform-linux.cc | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/v8/src/base/platform/platform-linux.cc b/v8/src/base/platform/platform-linux.cc
+index a4b742a..b210ece 100644
+--- a/v8/src/base/platform/platform-linux.cc
++++ b/v8/src/base/platform/platform-linux.cc
+@@ -61,10 +61,10 @@ namespace base {
+ #ifdef __arm__
+ 
+ bool OS::ArmUsingHardFloat() {
+-  // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify
+-  // the Floating Point ABI used (PCS stands for Procedure Call Standard).
+-  // We use these as well as a couple of other defines to statically determine
+-  // what FP ABI used.
++  // Clang and GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to
++  // specify the Floating Point ABI used (PCS stands for Procedure Call
++  // Standard).  We use these as well as a couple of other defines to
++  // statically determine what FP ABI used.
+   // GCC versions 4.4 and below don't support hard-fp.
+   // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or
+   // __ARM_PCS_VFP.
+@@ -72,7 +72,7 @@ bool OS::ArmUsingHardFloat() {
+ #define GCC_VERSION (__GNUC__ * 10000                                          \
+                      + __GNUC_MINOR__ * 100                                    \
+                      + __GNUC_PATCHLEVEL__)
+-#if GCC_VERSION >= 40600
++#if GCC_VERSION >= 40600 || defined(__clang__)
+ #if defined(__ARM_PCS_VFP)
+   return true;
+ #else
+-- 
+2.6.1
+
diff --git a/debian/patches/series b/debian/patches/series
index d035781..c853cba 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,3 +14,5 @@ system/nspr.patch
 system/clang.patch
 system/ffmpeg.patch
 webui.patch
+
+fix-detection-of-ARM-hard-float-ABI-with-clang.patch
-- 
2.6.1

Reply via email to