Most projects don't strip binaries in release mode by default, but there
are exceptions like app-misc/broot.

Signed-off-by: James Le Cuirot <ch...@gentoo.org>
---
 eclass/cargo.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 6ea37ec5e4e4b..84f72168fbb3c 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -267,7 +267,7 @@ cargo_gen_config() {
        # with USE=nightly. There is no simple way around this.
        tc-export_build_env
        local LD_A=( $(tc-getBUILD_CC) ${BUILD_LDFLAGS} )
-       local BUILD_RUSTFLAGS="-C linker=${LD_A[0]}"
+       local BUILD_RUSTFLAGS="-C strip=none -C linker=${LD_A[0]}"
        [[ ${#LD_A[@]} -gt 1 ]] && BUILD_RUSTFLAGS+="$(printf -- ' -C 
link-arg=%s' "${LD_A[@]:1}")"
        BUILD_RUSTFLAGS+=" ${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS}"
        tc-is-cross-compiler || BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
@@ -564,7 +564,7 @@ cargo_env() {
                local -x CARGO_BUILD_TARGET=$(rust_abi)
                local TRIPLE=${CARGO_BUILD_TARGET//-/_}
                local TRIPLE=${TRIPLE^^} LD_A=( $(tc-getCC) ${LDFLAGS} )
-               local -x CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS="-C 
linker=${LD_A[0]}"
+               local -x CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS="-C strip=none -C 
linker=${LD_A[0]}"
                [[ ${#LD_A[@]} -gt 1 ]] && local 
CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
                local CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS+=" ${RUSTFLAGS} 
${CARGO_TARGET_RUSTFLAGS}"
        fi
-- 
2.45.2


Reply via email to