Skip to content

Commit 995c4da

Browse files
caneraltinbasakotavio
authored andcommitted
patch(chromium): filter out ARM-specific flags in Rust builds
Adds a patch to `filter_clang_args.py` to skip `-mbranch-protection` and `-mfpu=` flags when compiling Rust. These flags are specific to ARM clang and cause build issues on other architectures with Rust compiler. Upstream-Status: Inappropriate [specific to our build setup]
1 parent b9702bc commit 995c4da

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

meta-chromium/recipes-browser/chromium/chromium-gn.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ SRC_URI += "\
3434
file://0017-rust-Use-adler-instead-of-adler2.patch \
3535
file://0018-third_party-node-update_node_binaries-Update-nodejs-.patch \
3636
file://0019-Reduce-minimum-browser-window-width-to-480px.patch \
37+
file://0020-rust-filter-out-arm-specific-flags-from-rust-compile.patch \
3738
"
3839

3940
# Missing third_party sources.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From f29addf315e55f371c7c9a973002607a628ea3ea Mon Sep 17 00:00:00 2001
2+
From: Caner Altinbasak <cal@brightsign.biz>
3+
Date: Fri, 25 Jul 2025 13:00:14 +0100
4+
Subject: [PATCH] rust: filter out arm specific flags from rust compiler
5+
6+
Upstream-Status: Inappropriate [specific to our build setup]
7+
---
8+
build/rust/filter_clang_args.py | 5 +++++
9+
1 file changed, 5 insertions(+)
10+
11+
diff --git a/build/rust/filter_clang_args.py b/build/rust/filter_clang_args.py
12+
index 5a1843c0df..7fb4b49516 100644
13+
--- a/build/rust/filter_clang_args.py
14+
+++ b/build/rust/filter_clang_args.py
15+
@@ -24,6 +24,11 @@ def filter_clang_args(clangargs):
16+
pass
17+
elif args[i].startswith('-plugin-arg'):
18+
i += 2
19+
+ # Filter out ARM-specific flags that aren't supported on other architectures
20+
+ elif args[i].startswith('-mbranch-protection'):
21+
+ pass # Skip this argument
22+
+ elif args[i].startswith('-mfpu='):
23+
+ pass
24+
else:
25+
yield args[i]
26+
i += 1
27+
--
28+
2.39.5
29+

0 commit comments

Comments
 (0)