Skip to content

Commit

Permalink
chromium: [PATCH] Revert "Set Rust symbol visibility to hidden when ..."
Browse files Browse the repository at this point in the history
This reverts chromium commit ee3900fd57b3c580aefff15c64052904d81b7760.
* Change-Id: https://crrev.com/c/5966273

Fixes the following compilation error:

```
| FAILED: obj/third_party/rust/ryu/v1/lib/libryu_lib.rlib
[...]
| error: unknown unstable option: `default-visibility`
```

This patch will be dropped once Rust >= 1.83 is available, which
includes:
* rust-lang/rust#130005 [0]
* rust-lang/rust#131519 [1]

Note that currently meta-lts-mixins [2] provides the following versions:
* kirkstone: `1.80.1`
* scarthgap: `1.81.0`

[0] rust-lang/rust#130005
[1] rust-lang/rust#131519
[2] https://git.yoctoproject.org/meta-lts-mixins

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
  • Loading branch information
adalessandro committed Feb 10, 2025
1 parent 79350e7 commit 7204798
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions meta-chromium/recipes-browser/chromium/chromium-gn.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ SRC_URI += "\
file://0010-Don-t-require-profiler_builtins.rlib.patch \
file://0011-Disable-crabbyavif-to-fix-build-errors.patch \
file://0012-Revert-Allow-and-use-std-hardware_destructive_interf.patch \
file://0013-Revert-Set-Rust-symbol-visibility-to-hidden-when-C-s.patch \
"
# ARM/AArch64-specific patches.
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0001-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From 6302ea4936e24232af4d50257b94a079471063cf Mon Sep 17 00:00:00 2001
From: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Date: Thu, 14 Nov 2024 22:23:28 -0300
Subject: [PATCH] Revert "Set Rust symbol visibility to hidden when C++ symbols
are"

This reverts chromium commit ee3900fd57b3c580aefff15c64052904d81b7760.
* Change-Id: https://crrev.com/c/5966273

Fixes the following compilation error:

```
| FAILED: obj/third_party/rust/ryu/v1/lib/libryu_lib.rlib
[...]
| error: unknown unstable option: `default-visibility`
```

This patch will be dropped once Rust >= 1.83 is available, which
includes:
* rust-lang/rust#130005 [0]
* rust-lang/rust#131519 [1]

Note that currently meta-lts-mixins [2] provides the following versions:
* kirkstone: `1.80.1`
* scarthgap: `1.81.0`

[0] https://github.com/rust-lang/rust/pull/130005
[1] https://github.com/rust-lang/rust/pull/131519
[2] https://git.yoctoproject.org/meta-lts-mixins

Upstream-Status: Inappropriate [specific to older versions of rust]
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
build/config/gcc/BUILD.gn | 1 -
build/sanitizers/asan_suppressions.cc | 13 +++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/build/config/gcc/BUILD.gn b/build/config/gcc/BUILD.gn
index a659210b196aa..147ebfc53426c 100644
--- a/build/config/gcc/BUILD.gn
+++ b/build/config/gcc/BUILD.gn
@@ -32,7 +32,6 @@ declare_args() {
# See http://gcc.gnu.org/wiki/Visibility
config("symbol_visibility_hidden") {
cflags = [ "-fvisibility=hidden" ]
- rustflags = [ "-Zdefault-visibility=hidden" ]

# Visibility attribute is not supported on AIX.
if (current_os != "aix") {
diff --git a/build/sanitizers/asan_suppressions.cc b/build/sanitizers/asan_suppressions.cc
index bfbd4b792a919..f0557be762c40 100644
--- a/build/sanitizers/asan_suppressions.cc
+++ b/build/sanitizers/asan_suppressions.cc
@@ -15,6 +15,19 @@
// // http://crbug.com/178677
// "interceptor_via_lib:libsqlite3.so\n"
char kASanDefaultSuppressions[] =
+ // https://crbug.com/1471542 false positive odr violations from Rust code.
+ "odr_violation:^core::\n"
+ "odr_violation:^object::\n"
+ "odr_violation:^std::io::\n"
+ "odr_violation:^serde::\n"
+ "odr_violation:^serde_json_lenient::\n"
+ "odr_violation:^std::panicking::\n"
+ "odr_violation:^std::thread::Builder::\n"
+ "odr_violation:^read_fonts::tables::\n"
+ "odr_violation:^std_detect::detect::cache::\n"
+ "odr_violation:^alloc::sync::\n"
+ "odr_violation:^log::\n"
+
// End of suppressions.
// PLEASE READ ABOVE BEFORE ADDING NEW SUPPRESSIONS.
""; // Please keep this semicolon.

0 comments on commit 7204798

Please sign in to comment.