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

Closes: https://bugs.gentoo.org/893658
Signed-off-by: Georgy Yakovlev <gyakov...@gentoo.org>
---
 eclass/cargo.eclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 00b8078f80ea..27ccee1295b3 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -49,7 +49,7 @@ case "${EAPI:-0}" in
                ;;
 esac
 
-inherit multiprocessing toolchain-funcs
+inherit flag-o-matic multiprocessing toolchain-funcs
 
 if [[ ! ${CARGO_OPTIONAL} ]]; then
        BDEPEND="${RUST_DEPEND}"
@@ -525,6 +525,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 --profile gentoo ${ECARGO_ARGS[@]} "$@"
-- 
2.39.1


Reply via email to