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 <kangie@gentoo.org>
This commit is contained in:
Matt Jolly
2025-01-16 18:00:17 +10:00
parent a39523498c
commit 1b40c2dc50
6 changed files with 53 additions and 14 deletions
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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