commit:     89468b4dc0cf1ac417a1f3fb499693dc0c86e2fa
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue May  6 07:22:07 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue May  6 08:45:09 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89468b4d

eclass/tests: tweak dot-a.sh tests for binutils

I'm not sure if I made a mistake when testing this before or if it changed
when the strip patch did, but the new behaviour is fine too with the
latest patch for Binutils.

I think what happened is that the patch changed to only mangle with -R ...
where ... is for LTO sections, which is fine for us. But doing this in a
separate commit so I can revert it easily if needed.

See https://sourceware.org/bugzilla/show_bug.cgi?id=21479#c13.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/tests/dot-a.sh | 45 ---------------------------------------------
 1 file changed, 45 deletions(-)

diff --git a/eclass/tests/dot-a.sh b/eclass/tests/dot-a.sh
index de60c4dc7605..6a01ce5798b8 100755
--- a/eclass/tests/dot-a.sh
+++ b/eclass/tests/dot-a.sh
@@ -9,45 +9,6 @@ source version-funcs.sh || exit
 
 inherit dot-a
 
-_strip_is_gnu() {
-       local name=$($(tc-getSTRIP) --version 2>&1 | head -n 1)
-
-       if ! [[ ${name} =~ ^GNU.*strip ]] ; then
-               return 1
-       fi
-
-       return 0
-}
-
-_check_binutils_version() {
-       local tool=$1
-       # Convert this:
-       # ```
-       # GNU ld (Gentoo 2.38 p4) 2.38
-       # Copyright (C) 2022 Free Software Foundation, Inc.
-       # This program is free software; you may redistribute it under the 
terms of
-       # the GNU General Public License version 3 or (at your option) a later 
version.
-       # This program has absolutely no warranty.
-       # ```
-       #
-       # into...
-       # ```
-       # 2.38
-       # ```
-       local ver=$(${tool} --version 2>&1 | head -n 1 | rev | cut -d' ' -f1 | 
rev)
-
-       if ! [[ ${ver} =~ [0-9].[0-9][0-9](.[0-9]?) ]] ; then
-               # Skip if unrecognised format so we don't pass something
-               # odd into ver_cut.
-               return
-       fi
-
-       ver_major=$(ver_cut 1 "${ver}")
-       ver_minor=$(ver_cut 2 "${ver}")
-       ver_extra=$(ver_cut 3 "${ver}")
-       echo ${ver_major}.${ver_minor}${ver_extra:+.${ver_extra}}
-}
-
 _create_test_progs() {
        cat <<-EOF > a.c
        int foo();
@@ -154,9 +115,6 @@ test_strip_lto_bytecode() {
                # strip-lto-bytecode will error out early with LLVM,
                # so stop the test here.
                tc-is-clang && return 0
-               # strip with >= GNU Binutils 2.45 won't corrupt the archive:
-               # https://sourceware.org/PR21479
-               _strip_is_gnu && ver_test $(_check_binutils_version 
$(tc-getSTRIP)) -gt 2.44 && return 0
 
                $(tc-getCC) ${CFLAGS} a.c -o a.o -c 2>/dev/null || return 1
 
@@ -195,9 +153,6 @@ test_strip_lto_bytecode() {
                # strip-lto-bytecode will error out early with LLVM,
                # so stop the test here.
                tc-is-clang && return 0
-               # strip with >= GNU Binutils 2.45 won't corrupt the archive:
-               # https://sourceware.org/PR21479
-               _strip_is_gnu && ver_test $(_check_binutils_version 
$(tc-getSTRIP)) -gt 2.44 && return 0
 
                $(tc-getCC) ${CFLAGS} a.c -o a.o -c 2>/dev/null || return 1
                $(tc-getAR) q test.a a.o 2>/dev/null || return 1

Reply via email to