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 3CB81159C96 for ; Wed, 24 Jul 2024 22:20:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1F2AFE2AE3; Wed, 24 Jul 2024 22:19:44 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 B579CE2ADC for ; Wed, 24 Jul 2024 22:19:43 +0000 (UTC) From: James Le Cuirot To: gentoo-dev Cc: James Le Cuirot Subject: [gentoo-dev] [PATCH 3/3 v2] cargo.eclass: Explicitly tell rustc not to strip binaries Date: Wed, 24 Jul 2024 23:18:27 +0100 Message-ID: <20240724221830.31469-7-chewi@gentoo.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240724221830.31469-3-chewi@gentoo.org> References: <20240724221830.31469-3-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: 6f3e6dc0-a827-40ff-ba16-8501149cf49b X-Archives-Hash: 12ca1032b4e28eb649d159932a561820 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 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