From 09d59da43630e66d4f7ae7145e121d06c81a2fdc Mon Sep 17 00:00:00 2001 From: "Andreas K. Hüttel" Date: Sat, 15 Jan 2022 23:19:42 +0100 Subject: Update patches for binutils 2.38 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas K. Hüttel --- ...-ld-add-support-for-poisoned-system-direc.patch | 42 ++--- ...iberty-install-PIC-version-of-libiberty.a.patch | 8 +- ...oo-add-with-extra-soversion-suffix-option.patch | 146 ++++++++++++++++ ...des-link-against-libbfd.la-for-rpath-deps.patch | 49 ------ ...ss-hash-style-sysv-to-ld-in-the-testsuite.patch | 61 +++++++ ...oo-add-with-extra-soversion-suffix-option.patch | 146 ---------------- ...-also-libctf-optionally-a-gentoo-specific.patch | 193 +++++++++++++++++++++ 9999/0006-Gentoo-Pass-hash-style-sysv.patch | 61 ------- ...0006-Gentoo-XFAIL-15-broken-ld.gold-tests.patch | 77 ++++++++ ...ibctf-optionally-a-gentoo-specific-sovers.patch | 177 ------------------- ...-soversion-suffix-then-we-also-use-the-bd.patch | 111 ------------ 9999/0020-XFAIL-15-broken-ld.gold-tests.patch | 77 -------- 12 files changed, 502 insertions(+), 646 deletions(-) create mode 100644 9999/0003-Gentoo-add-with-extra-soversion-suffix-option.patch delete mode 100644 9999/0003-Gentoo-opcodes-link-against-libbfd.la-for-rpath-deps.patch create mode 100644 9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch delete mode 100644 9999/0004-Gentoo-add-with-extra-soversion-suffix-option.patch create mode 100644 9999/0005-Gentoo-Give-also-libctf-optionally-a-gentoo-specific.patch delete mode 100644 9999/0006-Gentoo-Pass-hash-style-sysv.patch create mode 100644 9999/0006-Gentoo-XFAIL-15-broken-ld.gold-tests.patch delete mode 100644 9999/0007-Give-also-libctf-optionally-a-gentoo-specific-sovers.patch delete mode 100644 9999/0008-If-we-use-a-soversion-suffix-then-we-also-use-the-bd.patch delete mode 100644 9999/0020-XFAIL-15-broken-ld.gold-tests.patch diff --git a/9999/0001-Gentoo-gold-ld-add-support-for-poisoned-system-direc.patch b/9999/0001-Gentoo-gold-ld-add-support-for-poisoned-system-direc.patch index f7443bf..0dc4cf1 100644 --- a/9999/0001-Gentoo-gold-ld-add-support-for-poisoned-system-direc.patch +++ b/9999/0001-Gentoo-gold-ld-add-support-for-poisoned-system-direc.patch @@ -1,7 +1,7 @@ -From 8a82f64de912f26e840b20eec9d8a463fd0e242b Mon Sep 17 00:00:00 2001 +From 322deede0713506f899ee7f284a7c82ba1ec1cf7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 20 Jul 2021 21:08:31 +0200 -Subject: [PATCH 1/6] Gentoo: gold/ld: add support for poisoned system +Subject: [PATCH 1/6] Gentoo: gold/ld: add support for poisoned system directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -43,7 +43,7 @@ Ported to binutils 2.37 Andreas K. Hütte 11 files changed, 146 insertions(+) diff --git a/gold/options.cc b/gold/options.cc -index 5a55bd8ba6d..f7940c75f5a 100644 +index 04be98a3e39..64439f8af7a 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -1355,6 +1355,39 @@ General_options::finalize() @@ -87,7 +87,7 @@ index 5a55bd8ba6d..f7940c75f5a 100644 if (this->shared() && this->is_static()) gold_fatal(_("-shared and -static are incompatible")); diff --git a/gold/options.h b/gold/options.h -index 757ebf18fec..490b4cbd7d4 100644 +index 9509a445e8e..a3d76b294cd 100644 --- a/gold/options.h +++ b/gold/options.h @@ -1394,6 +1394,13 @@ class General_options @@ -119,10 +119,10 @@ index 26d55a00d47..ffad464783c 100644 #undef EXTRA_SHLIB_EXTENSION diff --git a/ld/configure b/ld/configure -index c197aaef3cb..882263aa43f 100755 +index f5c329c1f12..41ec6ca73ac 100755 --- a/ld/configure +++ b/ld/configure -@@ -829,6 +829,7 @@ with_lib_path +@@ -831,6 +831,7 @@ with_lib_path enable_targets enable_64_bit_bfd with_sysroot @@ -130,7 +130,7 @@ index c197aaef3cb..882263aa43f 100755 enable_gold enable_got enable_compressed_debug_sections -@@ -1498,6 +1499,8 @@ Optional Features: +@@ -1500,6 +1501,8 @@ Optional Features: --enable-checking enable run-time checks --enable-targets alternative target configurations --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) @@ -139,7 +139,7 @@ index c197aaef3cb..882263aa43f 100755 --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-got= GOT handling scheme (target, single, negative, multigot) -@@ -15236,7 +15239,18 @@ else +@@ -15333,7 +15336,18 @@ else fi @@ -159,10 +159,10 @@ index c197aaef3cb..882263aa43f 100755 # Check whether --enable-got was given. if test "${enable_got+set}" = set; then : diff --git a/ld/configure.ac b/ld/configure.ac -index 8ea97c43cd4..0f246db67d8 100644 +index 7f4cff079b7..57d1abff870 100644 --- a/ld/configure.ac +++ b/ld/configure.ac -@@ -106,6 +106,16 @@ AC_SUBST(use_sysroot) +@@ -102,6 +102,16 @@ AC_SUBST(use_sysroot) AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) @@ -180,7 +180,7 @@ index 8ea97c43cd4..0f246db67d8 100644 dnl "install_as_default" is set to false if gold is the default linker. dnl "installed_linker" is the installed BFD linker name. diff --git a/ld/ld.h b/ld/ld.h -index 35fafebfaed..4152278b8f4 100644 +index f3086bf30de..90cf1ca51e5 100644 --- a/ld/ld.h +++ b/ld/ld.h @@ -162,6 +162,13 @@ typedef struct @@ -198,10 +198,10 @@ index 35fafebfaed..4152278b8f4 100644 enum endian_enum endian; diff --git a/ld/ld.texi b/ld/ld.texi -index dd8f571d4e4..0aee4a4e9f1 100644 +index fc75e9b3625..f7d46117bab 100644 --- a/ld/ld.texi +++ b/ld/ld.texi -@@ -2863,6 +2863,24 @@ string identifying the original linked file does not change. +@@ -2892,6 +2892,24 @@ string identifying the original linked file does not change. Passing @code{none} for @var{style} disables the setting from any @code{--build-id} options earlier on the command line. @@ -227,7 +227,7 @@ index dd8f571d4e4..0aee4a4e9f1 100644 @c man end diff --git a/ld/ldfile.c b/ld/ldfile.c -index 9d0af06f1f6..f4a83acca93 100644 +index 731ae5f7aed..6b67e29041b 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -117,6 +117,26 @@ ldfile_add_library_path (const char *name, bool cmdline) @@ -258,10 +258,10 @@ index 9d0af06f1f6..f4a83acca93 100644 /* Try to open a BFD for a lang_input_statement. */ diff --git a/ld/ldlex.h b/ld/ldlex.h -index 9e8bf5fb835..3baed822a22 100644 +index bc58fea73cc..cf1b015a420 100644 --- a/ld/ldlex.h +++ b/ld/ldlex.h -@@ -148,6 +148,9 @@ enum option_values +@@ -149,6 +149,9 @@ enum option_values OPTION_PRINT_OUTPUT_FORMAT, OPTION_PRINT_SYSROOT, OPTION_IGNORE_UNRESOLVED_SYMBOL, @@ -272,7 +272,7 @@ index 9e8bf5fb835..3baed822a22 100644 OPTION_POP_STATE, OPTION_DISABLE_MULTIPLE_DEFS_ABS, diff --git a/ld/ldmain.c b/ld/ldmain.c -index 42660eb9a3c..c78009b760c 100644 +index ea72b14a301..706ec9ce26e 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -321,6 +321,13 @@ main (int argc, char **argv) @@ -290,10 +290,10 @@ index 42660eb9a3c..c78009b760c 100644 /* We initialize DEMANGLING based on the environment variable COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the diff --git a/ld/lexsup.c b/ld/lexsup.c -index 00274c500d0..a19cce9967c 100644 +index 5acc47ed5a0..e78df2daf29 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c -@@ -566,6 +566,18 @@ static const struct ld_option ld_options[] = +@@ -571,6 +571,18 @@ static const struct ld_option ld_options[] = OPTION_IGNORE_UNRESOLVED_SYMBOL}, '\0', N_("SYMBOL"), N_("Unresolved SYMBOL will not cause an error or warning"), TWO_DASHES }, @@ -312,7 +312,7 @@ index 00274c500d0..a19cce9967c 100644 { {"push-state", no_argument, NULL, OPTION_PUSH_STATE}, '\0', NULL, N_("Push state of flags governing input file handling"), TWO_DASHES }, -@@ -1643,6 +1655,18 @@ parse_args (unsigned argc, char **argv) +@@ -1659,6 +1671,18 @@ parse_args (unsigned argc, char **argv) } break; @@ -332,5 +332,5 @@ index 00274c500d0..a19cce9967c 100644 input_flags.pushed = xmemdup (&input_flags, sizeof (input_flags), -- -2.31.1 +2.34.1 diff --git a/9999/0002-Gentoo-libiberty-install-PIC-version-of-libiberty.a.patch b/9999/0002-Gentoo-libiberty-install-PIC-version-of-libiberty.a.patch index 4d5ed11..72b99c0 100644 --- a/9999/0002-Gentoo-libiberty-install-PIC-version-of-libiberty.a.patch +++ b/9999/0002-Gentoo-libiberty-install-PIC-version-of-libiberty.a.patch @@ -1,4 +1,4 @@ -From 6536761c1e2756ec39fdc33c400757be3744510c Mon Sep 17 00:00:00 2001 +From 887d52771263fc6b8260b873e104bc57d54b3f5c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 7 Jan 2005 00:15:53 -0500 Subject: [PATCH 2/6] Gentoo: libiberty: install PIC version of libiberty.a @@ -18,10 +18,10 @@ general are fairly low, and we'd rather have things work for all of them. 1 file changed, 1 insertion(+) diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in -index d19e14a2aca..cd02be1c2fb 100644 +index abef3c4601b..9dfb6b6d2b0 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in -@@ -257,6 +257,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) +@@ -258,6 +258,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(AR) $(AR_FLAGS) $(TARGETLIB) \ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ $(RANLIB) $(TARGETLIB); \ @@ -30,5 +30,5 @@ index d19e14a2aca..cd02be1c2fb 100644 else true; fi; \ if [ x"$(NOASANFLAG)" != x ]; then \ -- -2.31.1 +2.34.1 diff --git a/9999/0003-Gentoo-add-with-extra-soversion-suffix-option.patch b/9999/0003-Gentoo-add-with-extra-soversion-suffix-option.patch new file mode 100644 index 0000000..b2b0bb5 --- /dev/null +++ b/9999/0003-Gentoo-add-with-extra-soversion-suffix-option.patch @@ -0,0 +1,146 @@ +From 820a68dff1ec2eb3836727ced1b5b74bd31daa28 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Tue, 20 Jul 2021 21:12:38 +0200 +Subject: [PATCH 3/6] Gentoo: add --with-extra-soversion-suffix= option +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--with-extra-soversion-suffix= will allow Gentoo to +distinct libbfd.so and libopcodes.so to have more precise +SONAME. + +Today --enable-targets=all and --enable-64-bit-bfd change +libbfd.so ABI: +--enable-targets=all adds new symbols to the library +--enable-64-bit-bfd modifies BFD_ARCH_SIZE default and +changes sizes of integer parameters and fields to most +APIs. + +--with-extra-soversion-suffix= will allow Gentoo to inject +additional keys into SONAME to indicate ABI change and avoid +hard to diagnose crashes when user reinstalls libbfd.so +built with different flags (see https://bugs.gentoo.org/663690). + +Bug: https://bugs.gentoo.org/666100 +Signed-off-by: Sergei Trofimovich + +Ported to binutils 2.37 Andreas K. Hüttel +--- + bfd/Makefile.am | 5 +++++ + bfd/Makefile.in | 4 ++++ + bfd/configure | 13 +++++++++++++ + bfd/configure.ac | 7 +++++++ + 4 files changed, 29 insertions(+) + +diff --git a/bfd/Makefile.am b/bfd/Makefile.am +index 10dd765bec8..e3d97adfbb3 100644 +--- a/bfd/Makefile.am ++++ b/bfd/Makefile.am +@@ -59,6 +59,8 @@ bfdinclude_HEADERS += $(INCDIR)/plugin-api.h + LIBDL = @lt_cv_dlopen_libs@ + endif + ++EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ ++ + # bfd.h goes here, for now + BFD_H = bfd.h + +@@ -987,6 +989,9 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in + bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ + bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ + fi ;\ ++ if test x"$(EXTRA_SOVERSION_SUFFIX)" != x ; then \ ++ bfd_soversion="$${bfd_soversion}.$(EXTRA_SOVERSION_SUFFIX)" ;\ ++ fi ;\ + $(SED) -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ + -e "s,@bfd_version_package@,$$bfd_version_package," \ +diff --git a/bfd/Makefile.in b/bfd/Makefile.in +index f5313a2ad6f..c8cfc0474f2 100644 +--- a/bfd/Makefile.in ++++ b/bfd/Makefile.in +@@ -319,6 +319,7 @@ ECHO_T = @ECHO_T@ + EGREP = @EGREP@ + EXEEXT = @EXEEXT@ + EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ ++EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ + FGREP = @FGREP@ + GENCAT = @GENCAT@ + GMSGFMT = @GMSGFMT@ +@@ -2104,6 +2105,9 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in + bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ + bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ + fi ;\ ++ if test x"$(EXTRA_SOVERSION_SUFFIX)" != x ; then \ ++ bfd_soversion="$${bfd_soversion}.$(EXTRA_SOVERSION_SUFFIX)" ;\ ++ fi ;\ + $(SED) -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ + -e "s,@bfd_version_package@,$$bfd_version_package," \ +diff --git a/bfd/configure b/bfd/configure +index b09702f26e1..7a7c1229c99 100755 +--- a/bfd/configure ++++ b/bfd/configure +@@ -696,6 +696,7 @@ WARN_CFLAGS + REPORT_BUGS_TEXI + REPORT_BUGS_TO + PKGVERSION ++EXTRA_SOVERSION_SUFFIX + DEBUGDIR + ENABLE_BFD_64_BIT_FALSE + ENABLE_BFD_64_BIT_TRUE +@@ -837,6 +838,7 @@ enable_secureplt + enable_separate_code + enable_leading_mingw64_underscores + with_separate_debug_dir ++with_extra_soversion_suffix + with_pkgversion + with_bugurl + enable_werror +@@ -1513,6 +1515,8 @@ Optional Packages: + --with-separate-debug-dir=DIR + Look for global separate debug info in DIR + [[default=LIBDIR/debug]] ++ --with-extra-soversion-suffix=SUFFIX ++ Append '.SUFFIX' to SONAME [default=] + --with-pkgversion=PKG Use PKG in the version string in place of "GNU + Binutils" + --with-bugurl=URL Direct users to URL to report a bug +@@ -12013,6 +12017,15 @@ fi + + + ++EXTRA_SOVERSION_SUFFIX= ++ ++# Check whether --with-extra-soversion-suffix was given. ++if test "${with_extra_soversion_suffix+set}" = set; then : ++ withval=$with_extra_soversion_suffix; EXTRA_SOVERSION_SUFFIX="${withval}" ++fi ++ ++ ++ + + + # Check whether --with-pkgversion was given. +diff --git a/bfd/configure.ac b/bfd/configure.ac +index a9078965c40..3406c071fe7 100644 +--- a/bfd/configure.ac ++++ b/bfd/configure.ac +@@ -168,6 +168,13 @@ AC_ARG_WITH(separate-debug-dir, + [DEBUGDIR="${withval}"]) + AC_SUBST(DEBUGDIR) + ++EXTRA_SOVERSION_SUFFIX= ++AC_ARG_WITH(extra-soversion-suffix, ++ AS_HELP_STRING([--with-extra-soversion-suffix=SUFFIX], ++ [Append '.SUFFIX' to SONAME [[default=]]]), ++[EXTRA_SOVERSION_SUFFIX="${withval}"]) ++AC_SUBST(EXTRA_SOVERSION_SUFFIX) ++ + ACX_PKGVERSION([GNU Binutils]) + ACX_BUGURL([https://sourceware.org/bugzilla/]) + +-- +2.34.1 + diff --git a/9999/0003-Gentoo-opcodes-link-against-libbfd.la-for-rpath-deps.patch b/9999/0003-Gentoo-opcodes-link-against-libbfd.la-for-rpath-deps.patch deleted file mode 100644 index f3c9f8e..0000000 --- a/9999/0003-Gentoo-opcodes-link-against-libbfd.la-for-rpath-deps.patch +++ /dev/null @@ -1,49 +0,0 @@ -From c55536c61ec7e4c2e983e15f51f56f7a7c340889 Mon Sep 17 00:00:00 2001 -From: Mike Frysinger -Date: Tue, 5 Jul 2016 20:24:00 +0545 -Subject: [PATCH 3/6] Gentoo: opcodes: link against libbfd.la for rpath deps - -The reason opcodes doesn't link against libbfd.la is to workaround a -libtool bug where it uses installed -L paths ahead of DESTDIR paths. -The downside is that the library itself lacks rpath tags to find the -right version of libbfd.so. - -Since Gentoo has patched the libtool bug for a while, we don't need -the workaround. Use the .la file so we get the rpath tags. - -URL: https://bugs.gentoo.org/563934 -(cherry picked from commit 662586237b0b00ee881e79b56f6234ff36e8bfe6) ---- - opcodes/configure | 2 +- - opcodes/configure.ac | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/opcodes/configure b/opcodes/configure -index a3da5987f1b..22a05245286 100755 ---- a/opcodes/configure -+++ b/opcodes/configure -@@ -12142,7 +12142,7 @@ if test "$enable_shared" = "yes"; then - SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl ${SHARED_LIBADD}" - ;; - *) -- SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so ${SHARED_LIBADD}" -+ SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}" - ;; - esac - SHARED_DEPENDENCIES="../bfd/libbfd.la" -diff --git a/opcodes/configure.ac b/opcodes/configure.ac -index e564f067334..fb6254cd69d 100644 ---- a/opcodes/configure.ac -+++ b/opcodes/configure.ac -@@ -203,7 +203,7 @@ if test "$enable_shared" = "yes"; then - SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl ${SHARED_LIBADD}" - ;; - *) -- SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so ${SHARED_LIBADD}" -+ SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}" - ;; - esac - SHARED_DEPENDENCIES="../bfd/libbfd.la" --- -2.31.1 - diff --git a/9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch b/9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch new file mode 100644 index 0000000..2ac5053 --- /dev/null +++ b/9999/0004-Gentoo-Pass-hash-style-sysv-to-ld-in-the-testsuite.patch @@ -0,0 +1,61 @@ +From 6e5bb8fa8e5f409e12098a922de72f6bdcc99603 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= +Date: Tue, 20 Jul 2021 21:15:24 +0200 +Subject: [PATCH 4/6] Gentoo: Pass --hash-style=sysv to ld in the testsuite + +--- + binutils/testsuite/lib/binutils-common.exp | 2 +- + ld/testsuite/lib/ld-lib.exp | 16 ++++++++++++++-- + 2 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp +index 93603b0be68..83ae1307f2a 100644 +--- a/binutils/testsuite/lib/binutils-common.exp ++++ b/binutils/testsuite/lib/binutils-common.exp +@@ -1303,7 +1303,7 @@ proc run_dump_test { name {extra_options {}} } { + + # Add -L$srcdir/$subdir so that the linker command can use + # linker scripts in the source directory. +- set cmd "$LD $ld_extra_opt $LDFLAGS -L$srcdir/$subdir \ ++ set cmd "$LD --hash-style=sysv $ld_extra_opt $LDFLAGS -L$srcdir/$subdir \ + $opts(ld) -o $objfile $objfiles $opts(ld_after_inputfiles)" + + # If needed then check for, or add a -Map option. +diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp +index 5c7771f7221..ff9ee6a425c 100644 +--- a/ld/testsuite/lib/ld-lib.exp ++++ b/ld/testsuite/lib/ld-lib.exp +@@ -171,7 +171,7 @@ proc default_ld_relocate { ld target objects } { + global HOSTING_EMU + + remote_file host delete $target +- return [run_host_cmd_yesno "$ld" "$HOSTING_EMU -o $target -r $objects"] ++ return [run_host_cmd_yesno "$ld" "$HOSTING_EMU --hash-style=sysv -o $target -r $objects"] + } + + # Check to see if ld is being invoked with a non-endian output format +@@ -202,8 +202,20 @@ proc default_ld_link { ld target objects } { + set flags [big_or_little_endian] + } + ++ # Hilariously, this procedure is called sometimes with $CC and sometimes ++ # with $ld as parameter. If we want to change the default behaviour, we ++ # need to take the different option formats into account. ++ # We check the $ld parameter for ++ # - ld-new -> we're working with the new linker ++ # - otherwise -> we're likely working with the system compiler ++ if {[regexp {ld-new$} $ld]} { ++ set gentoosysv "--hash-style=sysv" ++ } else { ++ set gentoosysv "-Wl,--hash-style=sysv" ++ } ++ + remote_file host delete $target +- set exec_output [run_host_cmd "$ld" "$flags -o $target $objects"] ++ set exec_output [run_host_cmd "$ld" "$gentoosysv $flags -o $target $objects"] + set exec_output [prune_warnings $exec_output] + + # We don't care if we get a warning about a non-existent start +-- +2.34.1 + diff --git a/9999/0004-Gentoo-add-with-extra-soversion-suffix-option.patch b/9999/0004-Gentoo-add-with-extra-soversion-suffix-option.patch deleted file mode 100644 index 1051543..0000000 --- a/9999/0004-Gentoo-add-with-extra-soversion-suffix-option.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 235f1f862fb9bf77e2b9f62c24db0ca801c4a057 Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich -Date: Tue, 20 Jul 2021 21:12:38 +0200 -Subject: [PATCH 4/6] Gentoo: add --with-extra-soversion-suffix= option -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - ---with-extra-soversion-suffix= will allow Gentoo to -distinct libbfd.so and libopcodes.so to have more precise -SONAME. - -Today --enable-targets=all and --enable-64-bit-bfd change -libbfd.so ABI: ---enable-targets=all adds new symbols to the library ---enable-64-bit-bfd modifies BFD_ARCH_SIZE default and -changes sizes of integer parameters and fields to most -APIs. - ---with-extra-soversion-suffix= will allow Gentoo to inject -additional keys into SONAME to indicate ABI change and avoid -hard to diagnose crashes when user reinstalls libbfd.so -built with different flags (see https://bugs.gentoo.org/663690). - -Bug: https://bugs.gentoo.org/666100 -Signed-off-by: Sergei Trofimovich - -Ported to binutils 2.37 Andreas K. Hüttel ---- - bfd/Makefile.am | 5 +++++ - bfd/Makefile.in | 4 ++++ - bfd/configure | 13 +++++++++++++ - bfd/configure.ac | 7 +++++++ - 4 files changed, 29 insertions(+) - -diff --git a/bfd/Makefile.am b/bfd/Makefile.am -index ed2f701805d..dab3bfc8ed7 100644 ---- a/bfd/Makefile.am -+++ b/bfd/Makefile.am -@@ -59,6 +59,8 @@ bfdinclude_HEADERS += $(INCDIR)/plugin-api.h - LIBDL = @lt_cv_dlopen_libs@ - endif - -+EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ -+ - # bfd.h goes here, for now - BFD_H = bfd.h - -@@ -952,6 +954,9 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in - bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ - bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ - fi ;\ -+ if test x"$(EXTRA_SOVERSION_SUFFIX)" != x ; then \ -+ bfd_soversion="$${bfd_soversion}.$(EXTRA_SOVERSION_SUFFIX)" ;\ -+ fi ;\ - $(SED) -e "s,@bfd_version@,$$bfd_version," \ - -e "s,@bfd_version_string@,$$bfd_version_string," \ - -e "s,@bfd_version_package@,$$bfd_version_package," \ -diff --git a/bfd/Makefile.in b/bfd/Makefile.in -index 12807d99760..572df143487 100644 ---- a/bfd/Makefile.in -+++ b/bfd/Makefile.in -@@ -318,6 +318,7 @@ ECHO_T = @ECHO_T@ - EGREP = @EGREP@ - EXEEXT = @EXEEXT@ - EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -+EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ - FGREP = @FGREP@ - GENCAT = @GENCAT@ - GMSGFMT = @GMSGFMT@ -@@ -2063,6 +2064,9 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in - bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ - bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ - fi ;\ -+ if test x"$(EXTRA_SOVERSION_SUFFIX)" != x ; then \ -+ bfd_soversion="$${bfd_soversion}.$(EXTRA_SOVERSION_SUFFIX)" ;\ -+ fi ;\ - $(SED) -e "s,@bfd_version@,$$bfd_version," \ - -e "s,@bfd_version_string@,$$bfd_version_string," \ - -e "s,@bfd_version_package@,$$bfd_version_package," \ -diff --git a/bfd/configure b/bfd/configure -index 41586f00f93..f0acf160913 100755 ---- a/bfd/configure -+++ b/bfd/configure -@@ -696,6 +696,7 @@ WARN_CFLAGS - REPORT_BUGS_TEXI - REPORT_BUGS_TO - PKGVERSION -+EXTRA_SOVERSION_SUFFIX - DEBUGDIR - PLUGINS_FALSE - PLUGINS_TRUE -@@ -835,6 +836,7 @@ enable_secureplt - enable_separate_code - enable_leading_mingw64_underscores - with_separate_debug_dir -+with_extra_soversion_suffix - with_pkgversion - with_bugurl - enable_werror -@@ -1511,6 +1513,8 @@ Optional Packages: - --with-separate-debug-dir=DIR - Look for global separate debug info in DIR - [[default=LIBDIR/debug]] -+ --with-extra-soversion-suffix=SUFFIX -+ Append '.SUFFIX' to SONAME [default=] - --with-pkgversion=PKG Use PKG in the version string in place of "GNU - Binutils" - --with-bugurl=URL Direct users to URL to report a bug -@@ -11913,6 +11917,15 @@ fi - - - -+EXTRA_SOVERSION_SUFFIX= -+ -+# Check whether --with-extra-soversion-suffix was given. -+if test "${with_extra_soversion_suffix+set}" = set; then : -+ withval=$with_extra_soversion_suffix; EXTRA_SOVERSION_SUFFIX="${withval}" -+fi -+ -+ -+ - - - # Check whether --with-pkgversion was given. -diff --git a/bfd/configure.ac b/bfd/configure.ac -index fec067b2135..8c9ef9a04c0 100644 ---- a/bfd/configure.ac -+++ b/bfd/configure.ac -@@ -169,6 +169,13 @@ AC_ARG_WITH(separate-debug-dir, - [DEBUGDIR="${withval}"]) - AC_SUBST(DEBUGDIR) - -+EXTRA_SOVERSION_SUFFIX= -+AC_ARG_WITH(extra-soversion-suffix, -+ AS_HELP_STRING([--with-extra-soversion-suffix=SUFFIX], -+ [Append '.SUFFIX' to SONAME [[default=]]]), -+[EXTRA_SOVERSION_SUFFIX="${withval}"]) -+AC_SUBST(EXTRA_SOVERSION_SUFFIX) -+ - ACX_PKGVERSION([GNU Binutils]) - ACX_BUGURL([https://www.sourceware.org/bugzilla/]) - --- -2.31.1 - diff --git a/9999/0005-Gentoo-Give-also-libctf-optionally-a-gentoo-specific.patch b/9999/0005-Gentoo-Give-also-libctf-optionally-a-gentoo-specific.patch new file mode 100644 index 0000000..871812a --- /dev/null +++ b/9999/0005-Gentoo-Give-also-libctf-optionally-a-gentoo-specific.patch @@ -0,0 +1,193 @@ +From f4db43e58d2f3a6e66b15ff2b25ac6850199399b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= +Date: Sat, 24 Jul 2021 15:20:16 +0200 +Subject: [PATCH 5/6] Gentoo: Give also libctf optionally a gentoo-specific + soversion + +--- + libctf/Makefile.am | 14 +++++++++++++- + libctf/Makefile.in | 9 ++++++++- + libctf/configure | 35 +++++++++++++++++++++++++++++++++-- + libctf/configure.ac | 10 ++++++++++ + 4 files changed, 64 insertions(+), 4 deletions(-) + +diff --git a/libctf/Makefile.am b/libctf/Makefile.am +index 27e90f0ba36..4990a20efa3 100644 +--- a/libctf/Makefile.am ++++ b/libctf/Makefile.am +@@ -26,6 +26,9 @@ info_TEXINFOS = + DISTCLEANFILES = + MAINTAINERCLEANFILES = + ++EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ ++BFD_VERSION = @BFD_VERSION@ ++ + # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is + # -I../zlib, unless we were configured with --with-system-zlib, in which + # case both are empty. +@@ -46,8 +49,17 @@ include_HEADERS = + noinst_LTLIBRARIES = libctf.la libctf-nobfd.la + endif + ++# libctf by default uses libtool versioning. Unfortunately that keeps us from adding ++# a supplement to the soversion. So we need to switch tracks and be creative. ++ ++if HAVE_EXTRA_SOVERSION_SUFFIX ++gentoo_ctf_soversion = "$(BFD_VERSION).$(EXTRA_SOVERSION_SUFFIX)" ++else ++gentoo_ctf_soversion = 0.0.0 ++endif ++ + libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB) +-libctf_ldflags_nover = -version-info 0:0:0 @SHARED_LDFLAGS@ ++libctf_ldflags_nover = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ + libctf_nobfd_la_LDFLAGS = $(libctf_ldflags_nover) @VERSION_FLAGS_NOBFD@ + libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1 + libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c \ +diff --git a/libctf/Makefile.in b/libctf/Makefile.in +index 3b5ab73324e..10029107a05 100644 +--- a/libctf/Makefile.in ++++ b/libctf/Makefile.in +@@ -381,6 +381,7 @@ AUTOCONF = @AUTOCONF@ + AUTOHEADER = @AUTOHEADER@ + AUTOMAKE = @AUTOMAKE@ + AWK = @AWK@ ++BFD_VERSION = @BFD_VERSION@ + CATALOGS = @CATALOGS@ + CATOBJEXT = @CATOBJEXT@ + CC = @CC@ +@@ -403,6 +404,7 @@ EXEEXT = @EXEEXT@ + + # Setup the testing framework, if you have one + EXPECT = expect ++EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ + FGREP = @FGREP@ + GENCAT = @GENCAT@ + GMSGFMT = @GMSGFMT@ +@@ -540,8 +542,13 @@ AM_CFLAGS = -std=gnu99 @ac_libctf_warn_cflags@ @warn@ @c_warn@ @WARN_PEDANTIC@ @ + @INSTALL_LIBBFD_FALSE@include_HEADERS = + @INSTALL_LIBBFD_TRUE@include_HEADERS = $(INCDIR)/ctf.h $(INCDIR)/ctf-api.h + @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libctf.la libctf-nobfd.la ++@HAVE_EXTRA_SOVERSION_SUFFIX_FALSE@gentoo_ctf_soversion = 0.0.0 ++ ++# libctf by default uses libtool versioning. Unfortunately that keeps us from adding ++# a supplement to the soversion. So we need to switch tracks and be creative. ++@HAVE_EXTRA_SOVERSION_SUFFIX_TRUE@gentoo_ctf_soversion = "$(BFD_VERSION).$(EXTRA_SOVERSION_SUFFIX)" + libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB) +-libctf_ldflags_nover = -version-info 0:0:0 @SHARED_LDFLAGS@ ++libctf_ldflags_nover = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ + libctf_nobfd_la_LDFLAGS = $(libctf_ldflags_nover) @VERSION_FLAGS_NOBFD@ + libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1 + libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c \ +diff --git a/libctf/configure b/libctf/configure +index c56ac218213..623e71477b3 100755 +--- a/libctf/configure ++++ b/libctf/configure +@@ -646,6 +646,10 @@ BUILD_INFO_FALSE + BUILD_INFO_TRUE + NEED_CTF_QSORT_R_FALSE + NEED_CTF_QSORT_R_TRUE ++BFD_VERSION ++HAVE_EXTRA_SOVERSION_SUFFIX_FALSE ++HAVE_EXTRA_SOVERSION_SUFFIX_TRUE ++EXTRA_SOVERSION_SUFFIX + ENABLE_LIBCTF_HASH_DEBUGGING_FALSE + ENABLE_LIBCTF_HASH_DEBUGGING_TRUE + zlibinc +@@ -807,6 +811,7 @@ enable_maintainer_mode + enable_install_libbfd + with_system_zlib + enable_libctf_hash_debugging ++with_extra_soversion_suffix + ' + ac_precious_vars='build_alias + host_alias +@@ -1464,6 +1469,8 @@ Optional Packages: + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-system-zlib use installed libz ++ --with-extra-soversion-suffix=SUFFIX ++ Append '.SUFFIX' to SONAME [[default=]] + + Some influential environment variables: + CC C compiler command +@@ -11629,7 +11636,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11632 "configure" ++#line 11639 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11735,7 +11742,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11738 "configure" ++#line 11745 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -12942,6 +12949,26 @@ else + fi + + ++EXTRA_SOVERSION_SUFFIX= ++ ++# Check whether --with-extra-soversion-suffix was given. ++if test "${with_extra_soversion_suffix+set}" = set; then : ++ withval=$with_extra_soversion_suffix; EXTRA_SOVERSION_SUFFIX="${withval}" ++fi ++ ++ ++ if test -n "${with_extra_soversion_suffix}"; then ++ HAVE_EXTRA_SOVERSION_SUFFIX_TRUE= ++ HAVE_EXTRA_SOVERSION_SUFFIX_FALSE='#' ++else ++ HAVE_EXTRA_SOVERSION_SUFFIX_TRUE='#' ++ HAVE_EXTRA_SOVERSION_SUFFIX_FALSE= ++fi ++ ++ ++BFD_VERSION=$(${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p') ++ ++ + # Similar to GDB_AC_CHECK_BFD. + OLD_CFLAGS=$CFLAGS + OLD_LDFLAGS=$LDFLAGS +@@ -13834,6 +13861,10 @@ if test -z "${ENABLE_LIBCTF_HASH_DEBUGGING_TRUE}" && test -z "${ENABLE_LIBCTF_HA + as_fn_error $? "conditional \"ENABLE_LIBCTF_HASH_DEBUGGING\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi ++if test -z "${HAVE_EXTRA_SOVERSION_SUFFIX_TRUE}" && test -z "${HAVE_EXTRA_SOVERSION_SUFFIX_FALSE}"; then ++ as_fn_error $? "conditional \"HAVE_EXTRA_SOVERSION_SUFFIX\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 ++fi + + if test -z "${NEED_CTF_QSORT_R_TRUE}" && test -z "${NEED_CTF_QSORT_R_FALSE}"; then + as_fn_error $? "conditional \"NEED_CTF_QSORT_R\" was never defined. +diff --git a/libctf/configure.ac b/libctf/configure.ac +index 4996edd5b70..103fc8b9d33 100644 +--- a/libctf/configure.ac ++++ b/libctf/configure.ac +@@ -78,6 +78,16 @@ if test "${enable_libctf_hash_debugging}" = yes; then + fi + AM_CONDITIONAL(ENABLE_LIBCTF_HASH_DEBUGGING, test "${enable_libctf_hash_debugging}" = yes) + ++EXTRA_SOVERSION_SUFFIX= ++AC_ARG_WITH(extra-soversion-suffix, ++ AS_HELP_STRING([--with-extra-soversion-suffix=SUFFIX], ++ [Append '.SUFFIX' to SONAME [[default=]]]), ++[EXTRA_SOVERSION_SUFFIX="${withval}"]) ++AC_SUBST(EXTRA_SOVERSION_SUFFIX) ++AM_CONDITIONAL([HAVE_EXTRA_SOVERSION_SUFFIX], [test -n "${with_extra_soversion_suffix}"]) ++ ++AC_SUBST(BFD_VERSION, $(${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'), [Version of the accompanying bfd linker]) ++ + # Similar to GDB_AC_CHECK_BFD. + OLD_CFLAGS=$CFLAGS + OLD_LDFLAGS=$LDFLAGS +-- +2.34.1 + diff --git a/9999/0006-Gentoo-Pass-hash-style-sysv.patch b/9999/0006-Gentoo-Pass-hash-style-sysv.patch deleted file mode 100644 index 41b6a33..0000000 --- a/9999/0006-Gentoo-Pass-hash-style-sysv.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 905bf3c180f4f7fd07024eb9ff7851898593f3f8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= -Date: Tue, 20 Jul 2021 21:15:24 +0200 -Subject: [PATCH 6/6] Gentoo: Pass --hash-style=sysv to ld in the testsuite - ---- - binutils/testsuite/lib/binutils-common.exp | 2 +- - ld/testsuite/lib/ld-lib.exp | 16 ++++++++++++++-- - 2 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp -index 59e25df99b0..401a05b5c32 100644 ---- a/binutils/testsuite/lib/binutils-common.exp -+++ b/binutils/testsuite/lib/binutils-common.exp -@@ -1279,7 +1279,7 @@ proc run_dump_test { name {extra_options {}} } { - - # Add -L$srcdir/$subdir so that the linker command can use - # linker scripts in the source directory. -- set cmd "$LD $ld_extra_opt $LDFLAGS -L$srcdir/$subdir \ -+ set cmd "$LD --hash-style=sysv $ld_extra_opt $LDFLAGS -L$srcdir/$subdir \ - $opts(ld) -o $objfile $objfiles $opts(ld_after_inputfiles)" - - # If needed then check for, or add a -Map option. -diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp -index 8fd14afc63e..adbeaa3bd08 100644 ---- a/ld/testsuite/lib/ld-lib.exp -+++ b/ld/testsuite/lib/ld-lib.exp -@@ -167,7 +167,7 @@ proc default_ld_relocate { ld target objects } { - global HOSTING_EMU - - remote_file host delete $target -- return [run_host_cmd_yesno "$ld" "$HOSTING_EMU -o $target -r $objects"] -+ return [run_host_cmd_yesno "$ld" "$HOSTING_EMU --hash-style=sysv -o $target -r $objects"] - } - - # Check to see if ld is being invoked with a non-endian output format -@@ -198,8 +198,20 @@ proc default_ld_link { ld target objects } { - set flags [big_or_little_endian] - } - -+ # Hilariously, this procedure is called sometimes with $CC and sometimes -+ # with $ld as parameter. If we want to change the default behaviour, we -+ # need to take the different option formats into account. -+ # We check the $ld parameter for -+ # - ld-new -> we're working with the new linker -+ # - otherwise -> we're likely working with the system compiler -+ if {[regexp {ld-new$} $ld]} { -+ set gentoosysv "--hash-style=sysv" -+ } else { -+ set gentoosysv "-Wl,--hash-style=sysv" -+ } -+ - remote_file host delete $target -- set exec_output [run_host_cmd "$ld" "$flags -o $target $objects"] -+ set exec_output [run_host_cmd "$ld" "$gentoosysv $flags -o $target $objects"] - set exec_output [prune_warnings $exec_output] - - # We don't care if we get a warning about a non-existent start --- -2.31.1 - diff --git a/9999/0006-Gentoo-XFAIL-15-broken-ld.gold-tests.patch b/9999/0006-Gentoo-XFAIL-15-broken-ld.gold-tests.patch new file mode 100644 index 0000000..b9435e9 --- /dev/null +++ b/9999/0006-Gentoo-XFAIL-15-broken-ld.gold-tests.patch @@ -0,0 +1,77 @@ +From 66686e75515c742e573d25b74ce324e3d1acad08 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= +Date: Sat, 31 Jul 2021 01:18:18 +0200 +Subject: [PATCH 6/6] Gentoo: XFAIL 15 broken ld.gold tests + +It seems like either the tests or ld.gold in general cannot handle +compilers built with --enable-default-pie. No fix yet, so let's ignore +these test failures for the moment. For details see the linked bugs. + +Bug: https://bugs.gentoo.org/684046 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22755 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27303 +--- + gold/testsuite/Makefile.am | 6 ++++++ + gold/testsuite/Makefile.in | 16 ++++++++++++---- + 2 files changed, 18 insertions(+), 4 deletions(-) + +diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am +index 38e54818f48..85c94d40660 100644 +--- a/gold/testsuite/Makefile.am ++++ b/gold/testsuite/Makefile.am +@@ -1,5 +1,11 @@ + # Process this file with automake to generate Makefile.in + ++# Gentoo, https://bugs.gentoo.org/684046 ++XFAIL_TESTS = exception_separate_shared_12_test exception_separate_shared_21_test \ ++ weak_undef_test initpri3a justsyms_exec script_test_2 script_test_1 \ ++ justsyms binary_test script_test_3 tls_phdrs_script_test script_test_12i \ ++ dynamic_list_2 incremental_test_2 incremental_test_5 ++ + # As far as I can tell automake testing support assumes that the build + # system and the host system are the same. So these tests will not + # work when building with a cross-compiler. +diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in +index 7b4b7832d38..765c2b73140 100644 +--- a/gold/testsuite/Makefile.in ++++ b/gold/testsuite/Makefile.in +@@ -15,10 +15,6 @@ + @SET_MAKE@ + + # Process this file with automake to generate Makefile.in +- +-# As far as I can tell automake testing support assumes that the build +-# system and the host system are the same. So these tests will not +-# work when building with a cross-compiler. + VPATH = @srcdir@ + am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ +@@ -94,6 +90,14 @@ POST_UNINSTALL = : + build_triplet = @build@ + host_triplet = @host@ + target_triplet = @target@ ++XFAIL_TESTS = exception_separate_shared_12_test$(EXEEXT) \ ++ exception_separate_shared_21_test$(EXEEXT) \ ++ weak_undef_test$(EXEEXT) initpri3a$(EXEEXT) \ ++ justsyms_exec$(EXEEXT) script_test_2$(EXEEXT) \ ++ script_test_1$(EXEEXT) justsyms$(EXEEXT) binary_test$(EXEEXT) \ ++ script_test_3$(EXEEXT) tls_phdrs_script_test$(EXEEXT) \ ++ script_test_12i$(EXEEXT) dynamic_list_2$(EXEEXT) \ ++ incremental_test_2$(EXEEXT) incremental_test_5$(EXEEXT) + check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ + $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \ + $(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \ +@@ -2742,6 +2746,10 @@ top_srcdir = @top_srcdir@ + zlibdir = @zlibdir@ + zlibinc = @zlibinc@ + ++# As far as I can tell automake testing support assumes that the build ++# system and the host system are the same. So these tests will not ++# work when building with a cross-compiler. ++ + # Ignore warning about AM_PROG_CC_C_O due to large_CFLAGS + AUTOMAKE_OPTIONS = foreign -Wno-portability + +-- +2.34.1 + diff --git a/9999/0007-Give-also-libctf-optionally-a-gentoo-specific-sovers.patch b/9999/0007-Give-also-libctf-optionally-a-gentoo-specific-sovers.patch deleted file mode 100644 index 6f1c6b3..0000000 --- a/9999/0007-Give-also-libctf-optionally-a-gentoo-specific-sovers.patch +++ /dev/null @@ -1,177 +0,0 @@ -From d3cd41f5c7e405a8db5e85a7be9dfc42d44ef1b8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= -Date: Sat, 24 Jul 2021 15:20:16 +0200 -Subject: [PATCH 1/2] Give also libctf optionally a gentoo-specific soversion - ---- - libctf/Makefile.am | 13 ++++++++++++- - libctf/Makefile.in | 8 +++++++- - libctf/configure | 31 +++++++++++++++++++++++++++++-- - libctf/configure.ac | 8 ++++++++ - 4 files changed, 56 insertions(+), 4 deletions(-) - -diff --git a/libctf/Makefile.am b/libctf/Makefile.am -index e586d25fb37..eabc7fa8394 100644 ---- a/libctf/Makefile.am -+++ b/libctf/Makefile.am -@@ -21,6 +21,8 @@ ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd - - AUTOMAKE_OPTIONS = dejagnu foreign no-texinfo.tex - -+EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ -+ - # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is - # -I../zlib, unless we were configured with --with-system-zlib, in which - # case both are empty. -@@ -41,8 +43,17 @@ include_HEADERS = - noinst_LTLIBRARIES = libctf.la libctf-nobfd.la - endif - -+# libctf by default uses libtool versioning. Unfortunately that keeps us from adding -+# a supplement to the soversion. So we need to switch tracks and be creative. -+ -+if HAVE_EXTRA_SOVERSION_SUFFIX -+gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX) -+else -+gentoo_ctf_soversion = 0.0.0 -+endif -+ - libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB) --libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@ -+libctf_nobfd_la_LDFLAGS = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ @VERSION_FLAGS@ - libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1 - libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c \ - ctf-hash.c ctf-labels.c ctf-dedup.c ctf-link.c ctf-lookup.c \ -diff --git a/libctf/Makefile.in b/libctf/Makefile.in -index 5cfa100f9cc..b528781af97 100644 ---- a/libctf/Makefile.in -+++ b/libctf/Makefile.in -@@ -338,6 +338,7 @@ EXEEXT = @EXEEXT@ - - # Setup the testing framework, if you have one - EXPECT = expect -+EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ - FGREP = @FGREP@ - GENCAT = @GENCAT@ - GMSGFMT = @GMSGFMT@ -@@ -469,8 +470,13 @@ AM_CFLAGS = -std=gnu99 @ac_libctf_warn_cflags@ @warn@ @c_warn@ @WARN_PEDANTIC@ @ - @INSTALL_LIBBFD_FALSE@include_HEADERS = - @INSTALL_LIBBFD_TRUE@include_HEADERS = $(INCDIR)/ctf.h $(INCDIR)/ctf-api.h - @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libctf.la libctf-nobfd.la -+@HAVE_EXTRA_SOVERSION_SUFFIX_FALSE@gentoo_ctf_soversion = 0.0.0 -+ -+# libctf by default uses libtool versioning. Unfortunately that keeps us from adding -+# a supplement to the soversion. So we need to switch tracks and be creative. -+@HAVE_EXTRA_SOVERSION_SUFFIX_TRUE@gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX) - libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB) --libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@ -+libctf_nobfd_la_LDFLAGS = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ @VERSION_FLAGS@ - libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1 - libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c \ - ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-dedup.c \ -diff --git a/libctf/configure b/libctf/configure -index 82bcf13a606..e961f637a69 100755 ---- a/libctf/configure -+++ b/libctf/configure -@@ -643,6 +643,9 @@ CTF_LIBADD - SHARED_LDFLAGS - NEED_CTF_QSORT_R_FALSE - NEED_CTF_QSORT_R_TRUE -+HAVE_EXTRA_SOVERSION_SUFFIX_FALSE -+HAVE_EXTRA_SOVERSION_SUFFIX_TRUE -+EXTRA_SOVERSION_SUFFIX - ENABLE_LIBCTF_HASH_DEBUGGING_FALSE - ENABLE_LIBCTF_HASH_DEBUGGING_TRUE - zlibinc -@@ -804,6 +807,7 @@ enable_maintainer_mode - enable_install_libbfd - with_system_zlib - enable_libctf_hash_debugging -+with_extra_soversion_suffix - ' - ac_precious_vars='build_alias - host_alias -@@ -1461,6 +1465,8 @@ Optional Packages: - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-system-zlib use installed libz -+ --with-extra-soversion-suffix=SUFFIX -+ Append '.SUFFIX' to SONAME [[default=]] - - Some influential environment variables: - CC C compiler command -@@ -11586,7 +11592,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11589 "configure" -+#line 11607 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11692,7 +11698,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11695 "configure" -+#line 11713 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12899,6 +12905,23 @@ else - fi - - -+EXTRA_SOVERSION_SUFFIX= -+ -+# Check whether --with-extra-soversion-suffix was given. -+if test "${with_extra_soversion_suffix+set}" = set; then : -+ withval=$with_extra_soversion_suffix; EXTRA_SOVERSION_SUFFIX="${withval}" -+fi -+ -+ -+ if test -n "${with_extra_soversion_suffix}"; then -+ HAVE_EXTRA_SOVERSION_SUFFIX_TRUE= -+ HAVE_EXTRA_SOVERSION_SUFFIX_FALSE='#' -+else -+ HAVE_EXTRA_SOVERSION_SUFFIX_TRUE='#' -+ HAVE_EXTRA_SOVERSION_SUFFIX_FALSE= -+fi -+ -+ - # Similar to GDB_AC_CHECK_BFD. - OLD_CFLAGS=$CFLAGS - OLD_LDFLAGS=$LDFLAGS -@@ -13657,6 +13680,10 @@ if test -z "${ENABLE_LIBCTF_HASH_DEBUGGING_TRUE}" && test -z "${ENABLE_LIBCTF_HA - as_fn_error $? "conditional \"ENABLE_LIBCTF_HASH_DEBUGGING\" was never defined. - Usually this means the macro was only invoked conditionally." "$LINENO" 5 - fi -+if test -z "${HAVE_EXTRA_SOVERSION_SUFFIX_TRUE}" && test -z "${HAVE_EXTRA_SOVERSION_SUFFIX_FALSE}"; then -+ as_fn_error $? "conditional \"HAVE_EXTRA_SOVERSION_SUFFIX\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi - - if test -z "${NEED_CTF_QSORT_R_TRUE}" && test -z "${NEED_CTF_QSORT_R_FALSE}"; then - as_fn_error $? "conditional \"NEED_CTF_QSORT_R\" was never defined. -diff --git a/libctf/configure.ac b/libctf/configure.ac -index 80644b89d67..f7e6180afd8 100644 ---- a/libctf/configure.ac -+++ b/libctf/configure.ac -@@ -77,6 +77,14 @@ if test "${enable_libctf_hash_debugging}" = yes; then - fi - AM_CONDITIONAL(ENABLE_LIBCTF_HASH_DEBUGGING, test "${enable_libctf_hash_debugging}" = yes) - -+EXTRA_SOVERSION_SUFFIX= -+AC_ARG_WITH(extra-soversion-suffix, -+ AS_HELP_STRING([--with-extra-soversion-suffix=SUFFIX], -+ [Append '.SUFFIX' to SONAME [[default=]]]), -+[EXTRA_SOVERSION_SUFFIX="${withval}"]) -+AC_SUBST(EXTRA_SOVERSION_SUFFIX) -+AM_CONDITIONAL([HAVE_EXTRA_SOVERSION_SUFFIX], [test -n "${with_extra_soversion_suffix}"]) -+ - # Similar to GDB_AC_CHECK_BFD. - OLD_CFLAGS=$CFLAGS - OLD_LDFLAGS=$LDFLAGS --- -2.31.1 - diff --git a/9999/0008-If-we-use-a-soversion-suffix-then-we-also-use-the-bd.patch b/9999/0008-If-we-use-a-soversion-suffix-then-we-also-use-the-bd.patch deleted file mode 100644 index b88f50e..0000000 --- a/9999/0008-If-we-use-a-soversion-suffix-then-we-also-use-the-bd.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 235448cc5c53641417e17fd39ced95a21053c8ca Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= -Date: Sat, 24 Jul 2021 19:25:32 +0200 -Subject: [PATCH 2/2] If we use a soversion suffix, then we also use the bdf - version as soversion - ---- - libctf/Makefile.am | 3 ++- - libctf/Makefile.in | 3 ++- - libctf/configure | 8 ++++++-- - libctf/configure.ac | 2 ++ - 4 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/libctf/Makefile.am b/libctf/Makefile.am -index eabc7fa8394..e1304e8e89b 100644 ---- a/libctf/Makefile.am -+++ b/libctf/Makefile.am -@@ -22,6 +22,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd - AUTOMAKE_OPTIONS = dejagnu foreign no-texinfo.tex - - EXTRA_SOVERSION_SUFFIX = @EXTRA_SOVERSION_SUFFIX@ -+BFD_VERSION = @BFD_VERSION@ - - # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is - # -I../zlib, unless we were configured with --with-system-zlib, in which -@@ -47,7 +48,7 @@ endif - # a supplement to the soversion. So we need to switch tracks and be creative. - - if HAVE_EXTRA_SOVERSION_SUFFIX --gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX) -+gentoo_ctf_soversion = "$(BFD_VERSION).$(EXTRA_SOVERSION_SUFFIX)" - else - gentoo_ctf_soversion = 0.0.0 - endif -diff --git a/libctf/Makefile.in b/libctf/Makefile.in -index b528781af97..18d482411e8 100644 ---- a/libctf/Makefile.in -+++ b/libctf/Makefile.in -@@ -316,6 +316,7 @@ AUTOCONF = @AUTOCONF@ - AUTOHEADER = @AUTOHEADER@ - AUTOMAKE = @AUTOMAKE@ - AWK = @AWK@ -+BFD_VERSION = @BFD_VERSION@ - CATALOGS = @CATALOGS@ - CATOBJEXT = @CATOBJEXT@ - CC = @CC@ -@@ -474,7 +475,7 @@ AM_CFLAGS = -std=gnu99 @ac_libctf_warn_cflags@ @warn@ @c_warn@ @WARN_PEDANTIC@ @ - - # libctf by default uses libtool versioning. Unfortunately that keeps us from adding - # a supplement to the soversion. So we need to switch tracks and be creative. --@HAVE_EXTRA_SOVERSION_SUFFIX_TRUE@gentoo_ctf_soversion = 0.0.0.$(EXTRA_SOVERSION_SUFFIX) -+@HAVE_EXTRA_SOVERSION_SUFFIX_TRUE@gentoo_ctf_soversion = "$(BFD_VERSION).$(EXTRA_SOVERSION_SUFFIX)" - libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB) - libctf_nobfd_la_LDFLAGS = -release $(gentoo_ctf_soversion) @SHARED_LDFLAGS@ @VERSION_FLAGS@ - libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1 -diff --git a/libctf/configure b/libctf/configure -index e961f637a69..520d3a5cb3e 100755 ---- a/libctf/configure -+++ b/libctf/configure -@@ -643,6 +643,7 @@ CTF_LIBADD - SHARED_LDFLAGS - NEED_CTF_QSORT_R_FALSE - NEED_CTF_QSORT_R_TRUE -+BFD_VERSION - HAVE_EXTRA_SOVERSION_SUFFIX_FALSE - HAVE_EXTRA_SOVERSION_SUFFIX_TRUE - EXTRA_SOVERSION_SUFFIX -@@ -11592,7 +11593,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11607 "configure" -+#line 11608 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11698,7 +11699,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11713 "configure" -+#line 11714 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12922,6 +12923,9 @@ else - fi - - -+BFD_VERSION=$(${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p') -+ -+ - # Similar to GDB_AC_CHECK_BFD. - OLD_CFLAGS=$CFLAGS - OLD_LDFLAGS=$LDFLAGS -diff --git a/libctf/configure.ac b/libctf/configure.ac -index f7e6180afd8..5306e5499ec 100644 ---- a/libctf/configure.ac -+++ b/libctf/configure.ac -@@ -85,6 +85,8 @@ AC_ARG_WITH(extra-soversion-suffix, - AC_SUBST(EXTRA_SOVERSION_SUFFIX) - AM_CONDITIONAL([HAVE_EXTRA_SOVERSION_SUFFIX], [test -n "${with_extra_soversion_suffix}"]) - -+AC_SUBST(BFD_VERSION, $(${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'), [Version of the accompanying bfd linker]) -+ - # Similar to GDB_AC_CHECK_BFD. - OLD_CFLAGS=$CFLAGS - OLD_LDFLAGS=$LDFLAGS --- -2.31.1 - diff --git a/9999/0020-XFAIL-15-broken-ld.gold-tests.patch b/9999/0020-XFAIL-15-broken-ld.gold-tests.patch deleted file mode 100644 index 777390f..0000000 --- a/9999/0020-XFAIL-15-broken-ld.gold-tests.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 6f9a3d6ffa2bcf91bc047055848591dab77c0f11 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= -Date: Sat, 31 Jul 2021 01:18:18 +0200 -Subject: [PATCH] Gentoo: XFAIL 15 broken ld.gold tests - -It seems like either the tests or ld.gold in general cannot handle -compilers built with --enable-default-pie. No fix yet, so let's ignore -these test failures for the moment. For details see the linked bugs. - -Bug: https://bugs.gentoo.org/684046 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22755 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27303 ---- - gold/testsuite/Makefile.am | 6 ++++++ - gold/testsuite/Makefile.in | 16 ++++++++++++---- - 2 files changed, 18 insertions(+), 4 deletions(-) - -diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am -index 38e54818f48..85c94d40660 100644 ---- a/gold/testsuite/Makefile.am -+++ b/gold/testsuite/Makefile.am -@@ -1,5 +1,11 @@ - # Process this file with automake to generate Makefile.in - -+# Gentoo, https://bugs.gentoo.org/684046 -+XFAIL_TESTS = exception_separate_shared_12_test exception_separate_shared_21_test \ -+ weak_undef_test initpri3a justsyms_exec script_test_2 script_test_1 \ -+ justsyms binary_test script_test_3 tls_phdrs_script_test script_test_12i \ -+ dynamic_list_2 incremental_test_2 incremental_test_5 -+ - # As far as I can tell automake testing support assumes that the build - # system and the host system are the same. So these tests will not - # work when building with a cross-compiler. -diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in -index 7b4b7832d38..765c2b73140 100644 ---- a/gold/testsuite/Makefile.in -+++ b/gold/testsuite/Makefile.in -@@ -15,10 +15,6 @@ - @SET_MAKE@ - - # Process this file with automake to generate Makefile.in -- --# As far as I can tell automake testing support assumes that the build --# system and the host system are the same. So these tests will not --# work when building with a cross-compiler. - VPATH = @srcdir@ - am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ -@@ -94,6 +90,14 @@ POST_UNINSTALL = : - build_triplet = @build@ - host_triplet = @host@ - target_triplet = @target@ -+XFAIL_TESTS = exception_separate_shared_12_test$(EXEEXT) \ -+ exception_separate_shared_21_test$(EXEEXT) \ -+ weak_undef_test$(EXEEXT) initpri3a$(EXEEXT) \ -+ justsyms_exec$(EXEEXT) script_test_2$(EXEEXT) \ -+ script_test_1$(EXEEXT) justsyms$(EXEEXT) binary_test$(EXEEXT) \ -+ script_test_3$(EXEEXT) tls_phdrs_script_test$(EXEEXT) \ -+ script_test_12i$(EXEEXT) dynamic_list_2$(EXEEXT) \ -+ incremental_test_2$(EXEEXT) incremental_test_5$(EXEEXT) - check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ - $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \ - $(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \ -@@ -2742,6 +2746,10 @@ top_srcdir = @top_srcdir@ - zlibdir = @zlibdir@ - zlibinc = @zlibinc@ - -+# As far as I can tell automake testing support assumes that the build -+# system and the host system are the same. So these tests will not -+# work when building with a cross-compiler. -+ - # Ignore warning about AM_PROG_CC_C_O due to large_CFLAGS - AUTOMAKE_OPTIONS = foreign -Wno-portability - --- -2.31.1 - -- cgit v1.2.3-65-gdbad