From 09d59da43630e66d4f7ae7145e121d06c81a2fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= 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 --- ...oo-add-with-extra-soversion-suffix-option.patch | 146 +++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 9999/0003-Gentoo-add-with-extra-soversion-suffix-option.patch (limited to '9999/0003-Gentoo-add-with-extra-soversion-suffix-option.patch') 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 + -- cgit v1.2.3