From dc51935f7aae5f89d1ffecabef322680979952b8 Mon Sep 17 00:00:00 2001 From: Georgy Yakovlev Date: Wed, 8 Feb 2023 16:49:47 -0800 Subject: [PATCH] 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 Signed-off-by: Sam James --- eclass/cargo.eclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 2ff1f042ba795..70b6008d9cd8f 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -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[@]} "$@"