cargo.eclass: filter out lto flags for C/CXX compilers

we do it in src_compile to avoid excessive flag stripping in projects
using cargo.eclass just to fetch crates.

Bug: https://bugs.gentoo.org/903908
Closes: https://bugs.gentoo.org/893658
Closes: https://bugs.gentoo.org/910220
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Georgy Yakovlev
2023-02-08 16:49:47 -08:00
committed by Sam James
parent d4277ad4e6
commit dc51935f7a

View File

@@ -43,7 +43,7 @@ case ${EAPI} in
;;
esac
inherit multiprocessing toolchain-funcs
inherit flag-o-matic multiprocessing toolchain-funcs
[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND}"
@@ -513,6 +513,7 @@ cargo_src_compile() {
[[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
die "FATAL: please call cargo_gen_config before using ${FUNCNAME}"
filter-lto
tc-export AR CC CXX PKG_CONFIG
set -- cargo build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"