commit:     955fd16c7f4bb915f6ba5531443b8df8fb220632
Author:     Stephan Hartmann <sultan <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  3 18:19:31 2022 +0000
Commit:     Stephan Hartmann <sultan <AT> gentoo <DOT> org>
CommitDate: Mon Jan  3 18:20:18 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=955fd16c

www-client/chromium: fix build on arm64 with clang (M97)

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Stephan Hartmann <sultan <AT> gentoo.org>

 www-client/chromium/chromium-97.0.4692.71.ebuild   |  3 +-
 .../files/chromium-97-arm64-mte-clang.patch        | 34 ++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/www-client/chromium/chromium-97.0.4692.71.ebuild 
b/www-client/chromium/chromium-97.0.4692.71.ebuild
index bf72c0ce4bb4..65119a3ae012 100644
--- a/www-client/chromium/chromium-97.0.4692.71.ebuild
+++ b/www-client/chromium/chromium-97.0.4692.71.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2009-2021 Gentoo Authors
+# Copyright 2009-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -231,6 +231,7 @@ src_prepare() {
                "${WORKDIR}/patches"
                "${FILESDIR}/chromium-93-InkDropHost-crash.patch"
                "${FILESDIR}/chromium-96-EnumTable-crash.patch"
+               "${FILESDIR}/chromium-97-arm64-mte-clang.patch"
                "${FILESDIR}/chromium-glibc-2.34.patch"
                
"${FILESDIR}/chromium-use-oauth2-client-switches-as-default.patch"
                "${FILESDIR}/chromium-shim_headers.patch"

diff --git a/www-client/chromium/files/chromium-97-arm64-mte-clang.patch 
b/www-client/chromium/files/chromium-97-arm64-mte-clang.patch
new file mode 100644
index 000000000000..e86110bfb0ea
--- /dev/null
+++ b/www-client/chromium/files/chromium-97-arm64-mte-clang.patch
@@ -0,0 +1,34 @@
+From c04406585217092f85f3188dab4875b7be78af1d Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <sth...@googlemail.com>
+Date: Thu, 02 Dec 2021 16:56:39 +0000
+Subject: [PATCH] base: enable mte via -Xclang instead
+
+-march is fragile as it may get overridden later on by
+e.g. distributors.
+
+Bug: 1137393
+Change-Id: Ia6b98491ef6f955929d0699e9f435844de48e1da
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3310965
+Reviewed-by: Kentaro Hara <hara...@chromium.org>
+Commit-Queue: Stephan Hartmann <sth...@googlemail.com>
+Cr-Commit-Position: refs/heads/main@{#947530}
+---
+
+diff --git a/base/BUILD.gn b/base/BUILD.gn
+index df6293d..eaa02b7 100644
+--- a/base/BUILD.gn
++++ b/base/BUILD.gn
+@@ -104,7 +104,12 @@
+     # but they're not backwards compatible. Use base::CPU::has_mte()
+     # beforehand to confirm or use indirect functions (ifuncs) to select
+     # an MTE-specific implementation at dynamic link-time.
+-    cflags = [ "-march=armv8-a+memtag" ]
++    cflags = [
++      "-Xclang",
++      "-target-feature",
++      "-Xclang",
++      "+mte",
++    ]
+   }
+ }
+ 

Reply via email to