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 9ccd482e6b2d1..2a71b6c938fb6 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -548,13 +548,13 @@ cargo_env() {
        # RUSTFLAGS. The given linker cannot include any arguments, so split 
these
        # into link-args along with LDFLAGS. Also include external RUSTFLAGS.
        local LD_A=( ${HOST_CC} ${BUILD_LDFLAGS} )
-       declare -x CARGO_BUILD_RUSTFLAGS="${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS} 
-C linker=${LD_A[0]}"
+       declare -x CARGO_BUILD_RUSTFLAGS="-C strip=none ${RUSTFLAGS} 
${CARGO_BUILD_RUSTFLAGS} -C linker=${LD_A[0]}"
        [[ ${#LD_A[@]} -gt 1 ]] && declare CARGO_BUILD_RUSTFLAGS+="$(printf -- 
' -C link-arg=%s' "${LD_A[@]:1}")"

        if tc-is-cross-compiler; then
                declare -x CARGO_BUILD_TARGET=$(rust_abi)
                local TRIPLE=${CARGO_BUILD_TARGET//-/_} LD_A=( $(tc-getCC) 
${LDFLAGS} )
-               declare -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="${RUSTFLAGS} 
${CARGO_TARGET_RUSTFLAGS} -C linker=${LD_A[0]}"
+               declare -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="-C strip=none 
${RUSTFLAGS} ${CARGO_TARGET_RUSTFLAGS} -C linker=${LD_A[0]}"
                [[ ${#LD_A[@]} -gt 1 ]] && declare 
CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
        else
                CARGO_BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
--
2.45.2

Reply via email to