commit:     2faf4a38f838781e56696dcca483ebe3acccb094
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  3 23:49:24 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb  3 23:51:32 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2faf4a38

eclass/tests: dot-a: adapt to binutils trunk changes

GNU Binutils 2.46 will let us corrupt archives in some special cases
because GCC's compare-lto needs that (PR33801).

I think it actually worked okay for both our case and GCC's before
Alan's 9adb8ba865f2aebc6f4d7cc74df64ea200959b3a but I can't find a fault
with that either, so adapt to the new reality which hopefully works
for everybody now.

Bug: https://sourceware.org/PR33801
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/tests/dot-a.sh | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/eclass/tests/dot-a.sh b/eclass/tests/dot-a.sh
index cfd79112472a..4e55c40f0712 100755
--- a/eclass/tests/dot-a.sh
+++ b/eclass/tests/dot-a.sh
@@ -479,9 +479,10 @@ test_strip_lto() {
                cp foo.a foo.a.bak || return 1
                $(tc-getSTRIP) --enable-deterministic-archives -p -d foo.a || 
return 1
 
-               # They should NOT differ after stripping because it
-               # can't be safely stripped without special arguments.
-               cmp -s foo.a foo.a.bak || return 1
+               # The file may differ slightly with newer GNU Binutils (PR33801)
+               # so just make sure it's not totally corrupted.
+               $(tc-getCC) ${CFLAGS} ${LDFLAGS} main.c foo.a -o main || return 
1
+               ./main &>/dev/null || return 1
 
                return 0
        ) || ret=1
@@ -669,9 +670,10 @@ test_strip_index() {
                cp foo.a foo.a.bak || return 1
                $(tc-getSTRIP) --enable-deterministic-archives -p 
--strip-unneeded foo.a || return 1
 
-               # They should NOT differ after stripping because it
-               # can't be safely stripped without special arguments.
-               cmp -s foo.a foo.a.bak || return 1
+               # The file may differ slightly with newer GNU Binutils (PR33801)
+               # so just make sure it's not totally corrupted.
+               $(tc-getCC) ${CFLAGS} ${LDFLAGS} main.c foo.a -o main || return 
1
+               ./main &>/dev/null || return 1
 
                return 0
        ) || ret=1

Reply via email to