From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 115E8159C96 for ; Thu, 25 Jul 2024 18:07:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 520BC2BC055; Thu, 25 Jul 2024 18:06:37 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0BD9A2BC052 for ; Thu, 25 Jul 2024 18:06:37 +0000 (UTC) From: James Le Cuirot To: gentoo-dev Cc: rust@gentoo.org, python@gentoo.org, James Le Cuirot Subject: [gentoo-dev] [PATCH 4/6] cargo.eclass: Explicitly tell rustc not to strip binaries Date: Thu, 25 Jul 2024 19:02:17 +0100 Message-ID: <20240725180612.19453-5-chewi@gentoo.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240725180612.19453-1-chewi@gentoo.org> References: <20240725180612.19453-1-chewi@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 656f89b1-46bb-488f-a3aa-2db8fbb3fafd X-Archives-Hash: 7112417ab2d05be1f223e9c52d59ed48 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 --- 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