From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 814291580E0 for ; Tue, 03 Jun 2025 21:02:37 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 6558B3430F7 for ; Tue, 03 Jun 2025 21:02:37 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 1FF871103C1; Tue, 03 Jun 2025 21:02:34 +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)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 1B7931103C1 for ; Tue, 03 Jun 2025 21:02:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 smtp.gentoo.org (Postfix) with ESMTPS id A07543430FF for ; Tue, 03 Jun 2025 21:02:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 12CEA27C2 for ; Tue, 03 Jun 2025 21:02:32 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1748984534.b724e677e39eaa790380a2a13ab264a9b23e2572.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/estrip X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: b724e677e39eaa790380a2a13ab264a9b23e2572 X-VCS-Branch: master Date: Tue, 03 Jun 2025 21:02:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0d1cc922-7af1-4a8a-828b-81f4169a073c X-Archives-Hash: efbd2c64a1afe0bd6858bbffdf3425be commit: b724e677e39eaa790380a2a13ab264a9b23e2572 Author: Sam James gentoo org> AuthorDate: Thu May 8 10:35:09 2025 +0000 Commit: Sam James gentoo org> CommitDate: Tue Jun 3 21:02:14 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b724e677 estrip: salt build IDs even with FEATURES=-installsources We've historically only needed debugedit for FEATURES=installsources but if we're going to enable build IDs, we need to salt them in general for splitdebug. This is done in a followup commit to the original salting as the implementation could be cleaner and I think it's easier to rework then if required. Bug: https://bugs.gentoo.org/549672 Bug: https://bugs.gentoo.org/953869 Signed-off-by: Sam James gentoo.org> Part-of: https://github.com/gentoo/portage/pull/1436 Closes: https://github.com/gentoo/portage/pull/1436 Signed-off-by: Sam James gentoo.org> bin/estrip | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/bin/estrip b/bin/estrip index e587c08994..b8647e5a25 100755 --- a/bin/estrip +++ b/bin/estrip @@ -338,9 +338,26 @@ save_elf_debug() { # Symlink so we can read the name back. __try_symlink "${dst}" "${inode_debug}" - # If we don't already have build-id from debugedit, look it up + # If we don't already have build-id from debugedit, look it up. + # This should only happen with FEATURES=-installsources, as + # it's done in save_elf_sources. if [[ -z ${buildid} ]] ; then - # convert the readelf output to something useful + if [[ ${path_of[debugedit]} ]]; then + # Salt the build ID to avoid collisions on + # bundled libraries. + buildid=$("${path_of[debugedit]}" -i \ + -s "${CATEGORY}/${PF}:${SLOT}" \ + "${x}") + elif ! contains_word buildid "${warned_for[debugedit]}"; then + warned_for[debugedit]+=" buildid" + ewarn "FEATURES=splitdebug is enabled but the debugedit binary could not be found" + ewarn "This feature will not work correctly with build IDs unless debugedit is installed!" + fi + fi + + # If we (still) don't already have build-id from debugedit, look it up. + if [[ -z ${buildid} ]] ; then + # Convert the readelf output to something useful buildid=$("${path_of[readelf]}" -n "${src}" 2>/dev/null | awk '/Build ID:/{ print $NF; exit }') fi