commit: 8bb4f43e00c17d69cf12ef7c802b40336f02678f Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Mon Nov 3 12:22:08 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Mon Nov 3 12:22:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=8bb4f43e
2.45: add Let's use directories for X.Y.9999 until we drop them from tree. Signed-off-by: Sam James <sam <AT> gentoo.org> ...iberty-install-PIC-version-of-libiberty.a.patch | 35 ++++ ...oo-add-with-extra-soversion-suffix-option.patch | 167 +++++++++++++++++++ ...-also-libctf-optionally-a-gentoo-specific.patch | 178 +++++++++++++++++++++ ...ilar-libiberty-fix-as-in-7d53105d-for-lib.patch | 87 ++++++++++ 4 files changed, 467 insertions(+) diff --git a/2.45/0001-Gentoo-libiberty-install-PIC-version-of-libiberty.a.patch b/2.45/0001-Gentoo-libiberty-install-PIC-version-of-libiberty.a.patch new file mode 100644 index 0000000..a1e4219 --- /dev/null +++ b/2.45/0001-Gentoo-libiberty-install-PIC-version-of-libiberty.a.patch @@ -0,0 +1,35 @@ +From 4ebcb339f9d678aef53596022a3e6125dfed109a Mon Sep 17 00:00:00 2001 +Message-ID: <4ebcb339f9d678aef53596022a3e6125dfed109a.1758805647.git....@gentoo.org> +From: Mike Frysinger <[email protected]> +Date: Fri, 7 Jan 2005 00:15:53 -0500 +Subject: [PATCH 1/4] Gentoo: libiberty: install PIC version of libiberty.a + +This will install a PIC version of libiberty.a by overwriting the non-PIC +version of libiberty.a while compiling. We do this because there is no +shared version of libiberty for random apps to link against which means if +someone wants to use this in a shared library or PIE, they're out of luck. +It's arguable whether people should be able to use this in a shared lib, +but usage in PIE should be fine. You could argue that this penalizes the +non-PIE users, but the counter point is that people using this library in +general are fairly low, and we'd rather have things work for all of them. + +(cherry picked from commit 112aff9ad3e2675556370c4281117a6df0a879d9) +--- + libiberty/Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in +index d507f27a9ef..51fefcb31c2 100644 +--- a/libiberty/Makefile.in ++++ b/libiberty/Makefile.in +@@ -260,6 +260,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) + $(AR) $(AR_FLAGS) $(TARGETLIB) \ + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ + $(RANLIB) $(TARGETLIB); \ ++ cp $(TARGETLIB) ../ ; \ + cd ..; \ + else true; fi; \ + if [ x"$(NOASANFLAG)" != x ]; then \ +-- +2.51.0 + diff --git a/2.45/0002-Gentoo-add-with-extra-soversion-suffix-option.patch b/2.45/0002-Gentoo-add-with-extra-soversion-suffix-option.patch new file mode 100644 index 0000000..10b4901 --- /dev/null +++ b/2.45/0002-Gentoo-add-with-extra-soversion-suffix-option.patch @@ -0,0 +1,167 @@ +From 366a426d48c8ef40810ff0d275b73f86243d50f5 Mon Sep 17 00:00:00 2001 +Message-ID: <366a426d48c8ef40810ff0d275b73f86243d50f5.1758805647.git....@gentoo.org> +In-Reply-To: <4ebcb339f9d678aef53596022a3e6125dfed109a.1758805647.git....@gentoo.org> +References: <4ebcb339f9d678aef53596022a3e6125dfed109a.1758805647.git....@gentoo.org> +From: Sergei Trofimovich <[email protected]> +Date: Tue, 20 Jul 2021 21:12:38 +0200 +Subject: [PATCH 2/4] 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 <[email protected]> + +Ported to binutils 2.37 by Andreas K. Hüttel <[email protected]> +--- + bfd/Makefile.am | 5 +++++ + bfd/Makefile.in | 4 ++++ + bfd/configure | 17 +++++++++++++++-- + bfd/configure.ac | 7 +++++++ + 4 files changed, 31 insertions(+), 2 deletions(-) + +diff --git a/bfd/Makefile.am b/bfd/Makefile.am +index 3c3243269f1..719d5f2bb52 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 + +@@ -993,6 +995,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 6d1944c2664..07b1084f6b7 100644 +--- a/bfd/Makefile.in ++++ b/bfd/Makefile.in +@@ -349,6 +349,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@ +@@ -2464,6 +2465,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 d07f9e926e4..013353a2b59 100755 +--- a/bfd/configure ++++ b/bfd/configure +@@ -701,6 +701,7 @@ WARN_CFLAGS + REPORT_BUGS_TEXI + REPORT_BUGS_TO + PKGVERSION ++EXTRA_SOVERSION_SUFFIX + DEBUGDIR + PLUGINS_FALSE + PLUGINS_TRUE +@@ -841,6 +842,7 @@ enable_secureplt + enable_separate_code + enable_leading_mingw64_underscores + with_separate_debug_dir ++with_extra_soversion_suffix + with_pkgversion + with_bugurl + enable_werror +@@ -1529,6 +1531,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 +@@ -11528,7 +11532,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11531 "configure" ++#line 11535 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11634,7 +11638,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11637 "configure" ++#line 11641 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -12394,6 +12398,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 4fb3bf41f34..b52eba399f1 100644 +--- a/bfd/configure.ac ++++ b/bfd/configure.ac +@@ -163,6 +163,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.51.0 + diff --git a/2.45/0003-Gentoo-Give-also-libctf-optionally-a-gentoo-specific.patch b/2.45/0003-Gentoo-Give-also-libctf-optionally-a-gentoo-specific.patch new file mode 100644 index 0000000..81d3d05 --- /dev/null +++ b/2.45/0003-Gentoo-Give-also-libctf-optionally-a-gentoo-specific.patch @@ -0,0 +1,178 @@ +From 07128aa7ebc4a73170d4cebc036c9c64b7529f6e Mon Sep 17 00:00:00 2001 +Message-ID: <07128aa7ebc4a73170d4cebc036c9c64b7529f6e.1758805647.git....@gentoo.org> +In-Reply-To: <4ebcb339f9d678aef53596022a3e6125dfed109a.1758805647.git....@gentoo.org> +References: <4ebcb339f9d678aef53596022a3e6125dfed109a.1758805647.git....@gentoo.org> +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <[email protected]> +Date: Sat, 24 Jul 2021 15:20:16 +0200 +Subject: [PATCH 3/4] Gentoo: Give also libctf optionally a gentoo-specific + soversion + +--- + libctf/Makefile.am | 14 +++++++++++++- + libctf/Makefile.in | 9 ++++++++- + libctf/configure | 31 +++++++++++++++++++++++++++++++ + libctf/configure.ac | 10 ++++++++++ + 4 files changed, 62 insertions(+), 2 deletions(-) + +diff --git a/libctf/Makefile.am b/libctf/Makefile.am +index 6e136220497..12301277275 100644 +--- a/libctf/Makefile.am ++++ b/libctf/Makefile.am +@@ -31,6 +31,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. +@@ -51,8 +54,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 7c309b1fc04..c71e22d1b72 100644 +--- a/libctf/Makefile.in ++++ b/libctf/Makefile.in +@@ -432,6 +432,7 @@ AUTOCONF = @AUTOCONF@ + AUTOHEADER = @AUTOHEADER@ + AUTOMAKE = @AUTOMAKE@ + AWK = @AWK@ ++BFD_VERSION = @BFD_VERSION@ + CATALOGS = @CATALOGS@ + CATOBJEXT = @CATOBJEXT@ + CC = @CC@ +@@ -454,6 +455,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@ +@@ -606,8 +608,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 becb131103a..5179121719c 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 +@@ -822,6 +826,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 +@@ -1488,6 +1493,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 +@@ -16657,6 +16664,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 +@@ -17560,6 +17587,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 62e62250c80..5266b1381df 100644 +--- a/libctf/configure.ac ++++ b/libctf/configure.ac +@@ -84,6 +84,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.51.0 + diff --git a/2.45/0004-Apply-a-similar-libiberty-fix-as-in-7d53105d-for-lib.patch b/2.45/0004-Apply-a-similar-libiberty-fix-as-in-7d53105d-for-lib.patch new file mode 100644 index 0000000..f59e780 --- /dev/null +++ b/2.45/0004-Apply-a-similar-libiberty-fix-as-in-7d53105d-for-lib.patch @@ -0,0 +1,87 @@ +From c888b2e67d8e45c20aac1912ff9cd34cbea48d9e Mon Sep 17 00:00:00 2001 +Message-ID: <c888b2e67d8e45c20aac1912ff9cd34cbea48d9e.1758805647.git....@gentoo.org> +In-Reply-To: <4ebcb339f9d678aef53596022a3e6125dfed109a.1758805647.git....@gentoo.org> +References: <4ebcb339f9d678aef53596022a3e6125dfed109a.1758805647.git....@gentoo.org> +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <[email protected]> +Date: Wed, 22 Feb 2023 20:05:35 +0100 +Subject: [PATCH 4/4] Apply a similar libiberty fix as in 7d53105d for + libopcodes and libgprofng +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29042 +Bug: https://bugs.gentoo.org/834720 +Signed-off-by: Andreas K. Hüttel <[email protected]> +--- + gprofng/src/Makefile.am | 3 ++- + gprofng/src/Makefile.in | 3 ++- + opcodes/configure | 4 ++-- + opcodes/configure.ac | 4 ++-- + 4 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/gprofng/src/Makefile.am b/gprofng/src/Makefile.am +index f6d3f5da759..36c334bb359 100644 +--- a/gprofng/src/Makefile.am ++++ b/gprofng/src/Makefile.am +@@ -144,7 +144,8 @@ libgprofng_la_LDFLAGS = -version-info 0:0:0 + # Pass -lpthread instead of $(PTHREAD_LIBS) due to $(PTHREAD_LIBS) being empty + # when -nostdlib is passed to libtool. + # See bug 29364 - libgprofng.so: needs to link against -pthread +-libgprofng_la_LIBADD = $(top_builddir)/../opcodes/libopcodes.la \ ++libgprofng_la_LIBADD = $(GPROFNG_LIBADD) \ ++ $(top_builddir)/../opcodes/libopcodes.la \ + $(top_builddir)/../bfd/libbfd.la \ + $(GPROFNG_LIBADD) \ + -lpthread -ldl +diff --git a/gprofng/src/Makefile.in b/gprofng/src/Makefile.in +index 0a1934e8344..374a887adae 100644 +--- a/gprofng/src/Makefile.in ++++ b/gprofng/src/Makefile.in +@@ -558,7 +558,8 @@ libgprofng_la_LDFLAGS = -version-info 0:0:0 + # Pass -lpthread instead of $(PTHREAD_LIBS) due to $(PTHREAD_LIBS) being empty + # when -nostdlib is passed to libtool. + # See bug 29364 - libgprofng.so: needs to link against -pthread +-libgprofng_la_LIBADD = $(top_builddir)/../opcodes/libopcodes.la \ ++libgprofng_la_LIBADD = $(GPROFNG_LIBADD) \ ++ $(top_builddir)/../opcodes/libopcodes.la \ + $(top_builddir)/../bfd/libbfd.la \ + $(GPROFNG_LIBADD) \ + -lpthread -ldl +diff --git a/opcodes/configure b/opcodes/configure +index df9f63d1031..8c46bcf79ba 100755 +--- a/opcodes/configure ++++ b/opcodes/configure +@@ -14256,10 +14256,10 @@ if test "$enable_shared" = "yes"; then + case "${host}" in + *-*-cygwin*) + SHARED_LDFLAGS="-no-undefined" +- SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" ++ SHARED_LIBADD="$SHARED_LIBADD -L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" + ;; + *) +- SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}" ++ SHARED_LIBADD="${SHARED_LIBADD} ../bfd/libbfd.la ${SHARED_LIBADD}" + SHARED_DEPENDENCIES="../bfd/libbfd.la" + ;; + esac +diff --git a/opcodes/configure.ac b/opcodes/configure.ac +index 675f0662700..0220ec13312 100644 +--- a/opcodes/configure.ac ++++ b/opcodes/configure.ac +@@ -194,10 +194,10 @@ if test "$enable_shared" = "yes"; then + case "${host}" in + *-*-cygwin*) + SHARED_LDFLAGS="-no-undefined" +- SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" ++ SHARED_LIBADD="$SHARED_LIBADD -L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" + ;; + *) +- SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}" ++ SHARED_LIBADD="${SHARED_LIBADD} ../bfd/libbfd.la ${SHARED_LIBADD}" + SHARED_DEPENDENCIES="../bfd/libbfd.la" + ;; + esac +-- +2.51.0 +
