commit: 7d7c5168294a4d90681c8d3ab6ac985c4eba1643
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 24 21:59:16 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 6 08:30:11 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d7c5168
cargo.eclass: Explicitly tell rustc not to strip binaries
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 <chewi <AT> gentoo.org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/cargo.eclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index ef927aac50cd..99a7959b22e2 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 MY_BUILD_RUSTFLAGS="-C linker=${LD_A[0]}"
+ local MY_BUILD_RUSTFLAGS="-C strip=none -C linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && MY_BUILD_RUSTFLAGS+="$(printf -- ' -C
link-arg=%s' "${LD_A[@]:1}")"
MY_BUILD_RUSTFLAGS+=" ${RUSTFLAGS} ${BUILD_RUSTFLAGS}"
tc-is-cross-compiler || MY_BUILD_RUSTFLAGS+=" ${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}
${TARGET_RUSTFLAGS}"
fi