summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2021-07-20 21:12:38 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2024-08-05 09:14:29 +0200
commitf3ee0de2c6fb3556274fb8b4cead255b6e6bfe94 (patch)
tree6341be1c95fd850bf17440d83af54cf55067c032
parentGentoo: libiberty: install PIC version of libiberty.a (diff)
downloadbinutils-gdb-f3ee0de2c6fb3556274fb8b4cead255b6e6bfe94.tar.gz
binutils-gdb-f3ee0de2c6fb3556274fb8b4cead255b6e6bfe94.tar.bz2
binutils-gdb-f3ee0de2c6fb3556274fb8b4cead255b6e6bfe94.zip
Gentoo: add --with-extra-soversion-suffix= option
--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 <slyfox@gentoo.org> Ported to binutils 2.37 by Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r--bfd/Makefile.am5
-rw-r--r--bfd/Makefile.in4
-rwxr-xr-xbfd/configure13
-rw-r--r--bfd/configure.ac7
4 files changed, 29 insertions, 0 deletions
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 0dc733eaba9..5bd636d931a 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -64,6 +64,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
@@ -999,6 +1001,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 b3d97d478ea..38209d1b234 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -348,6 +348,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@
@@ -2471,6 +2472,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 9fe9cf6919f..8aa1aad1256 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -701,6 +701,7 @@ WARN_CFLAGS
REPORT_BUGS_TEXI
REPORT_BUGS_TO
PKGVERSION
+EXTRA_SOVERSION_SUFFIX
DEBUGDIR
ENABLE_BFD_64_BIT_FALSE
ENABLE_BFD_64_BIT_TRUE
@@ -842,6 +843,7 @@ enable_secureplt
enable_separate_code
enable_leading_mingw64_underscores
with_separate_debug_dir
+with_extra_soversion_suffix
with_pkgversion
with_bugurl
enable_werror
@@ -1530,6 +1532,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
@@ -12082,6 +12086,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 6bcfd1b7368..dde0a3af03e 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -167,6 +167,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/])