From 1b40c2dc50ed4e09d413563e0bbcd519f90f3c3d Mon Sep 17 00:00:00 2001 From: Matt Jolly Date: Wed, 15 Jan 2025 22:05:05 +1000 Subject: [PATCH] www-client/chromium: depend on compiler-rt-sanitizers[cfi] We enable CFI with USE=official when LTO is enabled. While most profiles enable USE=cfi anyway, we can be more specific and ensure that the USE is enabled when CFI is likely to be enabled - we can't do that based on LTO so USE=official will serve as a reasonable proxy. Since llvm/runtimes/compiler-rt-sanitizers[cfi] is not available on ppc64, special-case that arch and do not enable CFI. Closes: https://bugs.gentoo.org/946853 Signed-off-by: Matt Jolly --- .../chromium/chromium-130.0.6723.116-r1.ebuild | 18 +++++++++++------- .../chromium/chromium-131.0.6778.139.ebuild | 11 +++++++++-- .../chromium/chromium-131.0.6778.204.ebuild | 11 +++++++++-- .../chromium/chromium-131.0.6778.264.ebuild | 9 ++++++++- .../chromium/chromium-132.0.6834.83.ebuild | 9 ++++++++- .../chromium/chromium-133.0.6943.6.ebuild | 9 ++++++++- 6 files changed, 53 insertions(+), 14 deletions(-) diff --git a/www-client/chromium/chromium-130.0.6723.116-r1.ebuild b/www-client/chromium/chromium-130.0.6723.116-r1.ebuild index ae7bc679a437c..dd7163ac2a8ae 100644 --- a/www-client/chromium/chromium-130.0.6723.116-r1.ebuild +++ b/www-client/chromium/chromium-130.0.6723.116-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 2009-2024 Gentoo Authors +# Copyright 2009-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -175,11 +175,11 @@ BDEPEND=" qt5? ( dev-qt/qtcore:5 ) qt6? ( dev-qt/qtbase:6 ) ) - $(llvm_gen_dep " - llvm-core/clang:\${LLVM_SLOT} - llvm-core/llvm:\${LLVM_SLOT} - llvm-core/lld:\${LLVM_SLOT} - ") + $(llvm_gen_dep ' + llvm-core/clang:${LLVM_SLOT} + llvm-core/llvm:${LLVM_SLOT} + llvm-core/lld:${LLVM_SLOT} + ') pgo? ( >=dev-python/selenium-3.141.0 >=dev-util/web_page_replay_go-20220314 @@ -1073,7 +1073,11 @@ chromium_configure() { # Allow building against system libraries in official builds sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ tools/generate_shim_headers/generate_shim_headers.py || die - myconf_gn+=" is_cfi=${use_lto}" + if use ppc64; then + myconf_gn+=" is_cfi=no" # requires llvm-runtimes/compiler-rt-sanitizers[cfi] + else + myconf_gn+=" is_cfi=${use_lto}" + fi # Don't add symbols to build myconf_gn+=" symbol_level=0" fi diff --git a/www-client/chromium/chromium-131.0.6778.139.ebuild b/www-client/chromium/chromium-131.0.6778.139.ebuild index 2fbee807309f3..c543447a0c0af 100644 --- a/www-client/chromium/chromium-131.0.6778.139.ebuild +++ b/www-client/chromium/chromium-131.0.6778.139.ebuild @@ -1,4 +1,4 @@ -# Copyright 2009-2024 Gentoo Authors +# Copyright 2009-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -179,6 +179,9 @@ BDEPEND=" llvm-core/clang:${LLVM_SLOT} llvm-core/llvm:${LLVM_SLOT} llvm-core/lld:${LLVM_SLOT} + official? ( + !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] ) + ) ') pgo? ( >=dev-python/selenium-3.141.0 @@ -1085,7 +1088,11 @@ chromium_configure() { # Allow building against system libraries in official builds sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ tools/generate_shim_headers/generate_shim_headers.py || die - myconf_gn+=" is_cfi=${use_lto}" + if use ppc64; then + myconf_gn+=" is_cfi=no" # requires llvm-runtimes/compiler-rt-sanitizers[cfi] + else + myconf_gn+=" is_cfi=${use_lto}" + fi # Don't add symbols to build myconf_gn+=" symbol_level=0" fi diff --git a/www-client/chromium/chromium-131.0.6778.204.ebuild b/www-client/chromium/chromium-131.0.6778.204.ebuild index 9704b68b736c5..4c4e2fa9cc7cf 100644 --- a/www-client/chromium/chromium-131.0.6778.204.ebuild +++ b/www-client/chromium/chromium-131.0.6778.204.ebuild @@ -1,4 +1,4 @@ -# Copyright 2009-2024 Gentoo Authors +# Copyright 2009-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -179,6 +179,9 @@ BDEPEND=" llvm-core/clang:${LLVM_SLOT} llvm-core/llvm:${LLVM_SLOT} llvm-core/lld:${LLVM_SLOT} + official? ( + !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] ) + ) ') pgo? ( >=dev-python/selenium-3.141.0 @@ -1085,7 +1088,11 @@ chromium_configure() { # Allow building against system libraries in official builds sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ tools/generate_shim_headers/generate_shim_headers.py || die - myconf_gn+=" is_cfi=${use_lto}" + if use ppc64; then + myconf_gn+=" is_cfi=no" # requires llvm-runtimes/compiler-rt-sanitizers[cfi] + else + myconf_gn+=" is_cfi=${use_lto}" + fi # Don't add symbols to build myconf_gn+=" symbol_level=0" fi diff --git a/www-client/chromium/chromium-131.0.6778.264.ebuild b/www-client/chromium/chromium-131.0.6778.264.ebuild index adda2b0c6e605..5259fc3e51335 100644 --- a/www-client/chromium/chromium-131.0.6778.264.ebuild +++ b/www-client/chromium/chromium-131.0.6778.264.ebuild @@ -179,6 +179,9 @@ BDEPEND=" llvm-core/clang:${LLVM_SLOT} llvm-core/llvm:${LLVM_SLOT} llvm-core/lld:${LLVM_SLOT} + official? ( + !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] ) + ) ') pgo? ( >=dev-python/selenium-3.141.0 @@ -1085,7 +1088,11 @@ chromium_configure() { # Allow building against system libraries in official builds sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ tools/generate_shim_headers/generate_shim_headers.py || die - myconf_gn+=" is_cfi=${use_lto}" + if use ppc64; then + myconf_gn+=" is_cfi=no" # requires llvm-runtimes/compiler-rt-sanitizers[cfi] + else + myconf_gn+=" is_cfi=${use_lto}" + fi # Don't add symbols to build myconf_gn+=" symbol_level=0" fi diff --git a/www-client/chromium/chromium-132.0.6834.83.ebuild b/www-client/chromium/chromium-132.0.6834.83.ebuild index f663dc7a02a8b..80e260d2af88a 100644 --- a/www-client/chromium/chromium-132.0.6834.83.ebuild +++ b/www-client/chromium/chromium-132.0.6834.83.ebuild @@ -178,6 +178,9 @@ BDEPEND=" llvm-core/clang:${LLVM_SLOT} llvm-core/llvm:${LLVM_SLOT} llvm-core/lld:${LLVM_SLOT} + official? ( + !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] ) + ) ') pgo? ( >=dev-python/selenium-3.141.0 @@ -1095,7 +1098,11 @@ chromium_configure() { # Allow building against system libraries in official builds sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ tools/generate_shim_headers/generate_shim_headers.py || die - myconf_gn+=" is_cfi=${use_lto}" + if use ppc64; then + myconf_gn+=" is_cfi=no" # requires llvm-runtimes/compiler-rt-sanitizers[cfi] + else + myconf_gn+=" is_cfi=${use_lto}" + fi # Don't add symbols to build myconf_gn+=" symbol_level=0" fi diff --git a/www-client/chromium/chromium-133.0.6943.6.ebuild b/www-client/chromium/chromium-133.0.6943.6.ebuild index bc418143d04ce..d52caeb0683f8 100644 --- a/www-client/chromium/chromium-133.0.6943.6.ebuild +++ b/www-client/chromium/chromium-133.0.6943.6.ebuild @@ -187,6 +187,9 @@ BDEPEND=" llvm-core/clang:${LLVM_SLOT} llvm-core/llvm:${LLVM_SLOT} llvm-core/lld:${LLVM_SLOT} + official? ( + !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] ) + ) ') pgo? ( >=dev-python/selenium-3.141.0 @@ -1118,7 +1121,11 @@ chromium_configure() { # Allow building against system libraries in official builds sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ tools/generate_shim_headers/generate_shim_headers.py || die - myconf_gn+=" is_cfi=${use_lto}" + if use ppc64; then + myconf_gn+=" is_cfi=no" # requires llvm-runtimes/compiler-rt-sanitizers[cfi] + else + myconf_gn+=" is_cfi=${use_lto}" + fi # Don't add symbols to build myconf_gn+=" symbol_level=0" fi