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 EB5A51581CA for ; Fri, 13 Jun 2025 08:00:30 +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) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id D72EC34244C for ; Fri, 13 Jun 2025 08:00:30 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id C7CB81104DB; Fri, 13 Jun 2025 08:00:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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 bobolink.gentoo.org (Postfix) with ESMTPS id BA5CD1104DB for ; Fri, 13 Jun 2025 08:00:29 +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 5CFF134244C for ; Fri, 13 Jun 2025 08:00:29 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C62B02356 for ; Fri, 13 Jun 2025 08:00:27 +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: <1749801618.de322e0131b4407afb7385397f39b22e96330104.sam@gentoo> Subject: [gentoo-commits] proj/toolchain/binutils-patches:master commit in: 9999/ X-VCS-Repository: proj/toolchain/binutils-patches X-VCS-Files: 9999/0006-objcopy-Correctly-check-archive-element-for-LTO-IR.patch X-VCS-Directories: 9999/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: de322e0131b4407afb7385397f39b22e96330104 X-VCS-Branch: master Date: Fri, 13 Jun 2025 08:00:27 +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: b96b6f43-c4e5-41b2-ae61-c71fd4d5f0bd X-Archives-Hash: 0232eb48f0d679caf2a773b8a7689e42 commit: de322e0131b4407afb7385397f39b22e96330104 Author: Sam James gentoo org> AuthorDate: Fri Jun 13 07:59:51 2025 +0000 Commit: Sam James gentoo org> CommitDate: Fri Jun 13 08:00:18 2025 +0000 URL: https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=de322e01 9999: fix strip on static libraries Bug: https://bugs.gentoo.org/957882 Bug: https://sourceware.org/PR33078 Signed-off-by: Sam James gentoo.org> ...orrectly-check-archive-element-for-LTO-IR.patch | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/9999/0006-objcopy-Correctly-check-archive-element-for-LTO-IR.patch b/9999/0006-objcopy-Correctly-check-archive-element-for-LTO-IR.patch new file mode 100644 index 0000000..21ada0d --- /dev/null +++ b/9999/0006-objcopy-Correctly-check-archive-element-for-LTO-IR.patch @@ -0,0 +1,128 @@ +From 0d8ad139ab054df15fddd5613826d9f6aeb44f0f Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Fri, 13 Jun 2025 08:20:49 +0800 +Subject: [PATCH] objcopy: Correctly check archive element for LTO IR + +Pass archive element, instead of archive, to bfd_plugin_target_p to check +for LTO IR in archive element. + + PR binutils/33078 + * objcopy.c (copy_archive): Correctly check archive element for + LTO IR. + * testsuite/binutils-all/objcopy.exp (strip_test_archive): New. + Run strip_test_archive. + +Signed-off-by: H.J. Lu +--- + binutils/objcopy.c | 2 +- + binutils/testsuite/binutils-all/objcopy.exp | 82 +++++++++++++++++++++ + 2 files changed, 83 insertions(+), 1 deletion(-) + +diff --git a/binutils/objcopy.c b/binutils/objcopy.c +index a973789b1d5..366e1079d82 100644 +--- a/binutils/objcopy.c ++++ b/binutils/objcopy.c +@@ -3770,7 +3770,7 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, + + #if BFD_SUPPORTS_PLUGINS + /* Copy LTO IR file as unknown object. */ +- if (bfd_plugin_target_p (ibfd->xvec)) ++ if (bfd_plugin_target_p (this_element->xvec)) + ok_object = false; + else + #endif +diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp +index cf94570642c..dd0dfd2e5c2 100644 +--- a/binutils/testsuite/binutils-all/objcopy.exp ++++ b/binutils/testsuite/binutils-all/objcopy.exp +@@ -661,6 +661,88 @@ proc strip_test_with_saving_a_symbol { } { + + strip_test_with_saving_a_symbol + ++# Test stripping an archive. ++ ++proc strip_test_archive { } { ++ global AR ++ global CC ++ global STRIP ++ global STRIPFLAGS ++ global srcdir ++ global subdir ++ ++ set test "strip -g on archive" ++ ++ if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog.o object debug] != "" } { ++ untested $test ++ return ++ } ++ ++ set stripobjfile tmpdir/striptestprog.o ++ set stripobjarchive testprog.o ++ if [is_remote host] { ++ set archive libstrip.a ++ set objfile [remote_download host tmpdir/testprog.o] ++ remote_file host delete $archive ++ remote_file host delete $stripobjfile ++ remote_file host delete $stripobjarchive ++ } else { ++ set archive tmpdir/libstrip.a ++ set objfile tmpdir/testprog.o ++ remote_file build delete $stripobjfile ++ remote_file build delete $stripobjarchive ++ } ++ ++ remote_file build delete tmpdir/libstrip.a ++ ++ set exec_output [binutils_run $STRIP "-g -o $stripobjfile $objfile"] ++ set exec_output [prune_warnings $exec_output] ++ if ![string equal "" $exec_output] { ++ fail $test ++ return ++ } ++ ++ set exec_output [binutils_run $AR "rc $archive ${objfile}"] ++ set exec_output [prune_warnings $exec_output] ++ if ![string equal "" $exec_output] { ++ fail $test ++ return ++ } ++ ++ set exec_output [binutils_run $STRIP "-g $archive"] ++ set exec_output [prune_warnings $exec_output] ++ if ![string equal "" $exec_output] { ++ fail $test ++ return ++ } ++ ++ set exec_output [binutils_run $AR "x $archive"] ++ set exec_output [prune_warnings $exec_output] ++ if ![string equal "" $exec_output] { ++ fail $test ++ return ++ } ++ ++ if [is_remote host] { ++ set stripobjfile [remote_download host $stripobjfile] ++ set stripobjarchive [remote_download host $stripobjarchive] ++ } ++ ++ send_log "cmp $stripobjarchive $stripobjfile\n" ++ verbose "cmp $stripobjarchive $stripobjfile" ++ set status [remote_exec build cmp "$stripobjarchive $stripobjfile"] ++ set exec_output [lindex $status 1] ++ set exec_output [prune_warnings $exec_output] ++ ++ if [string equal "" $exec_output] then { ++ pass $test ++ } else { ++ fail $test ++ } ++} ++ ++strip_test_archive ++ + # Build a final executable. + + set exe [exeext] +-- +2.49.0