From: "Andreas K. Huettel" <dilfridge@gentoo.org>
To: binutils@sourceware.org
Cc: toolchain@gentoo.org
Subject: Re: [PATCH, needs more eyes] Relink also libopcodes and libgprofng to newly built libiberty.a
Date: Wed, 15 Mar 2023 21:51:15 +0100 [thread overview]
Message-ID: <1724922.vCJZsxu672@pinacolada> (raw)
In-Reply-To: <20230228224937.3832887-1-dilfridge@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 4228 bytes --]
Big apology for the silence, a heap of unrelated work got in the way.
I'll respond in a few days when the worst is over.. :|
FWIW, I got several confirmations in the meantime that the patch solves
our problem in Gentoo ...
Am Dienstag, 28. Februar 2023, 23:49:37 CET schrieb Andreas K. Hüttel:
> For Gentoo users, after updating gcc, a subsequent build of
> binutils can fail during "make install" with the following symptoms:
>
> lto1: fatal error: bytecode stream in file '/usr/lib64/binutils/x86_64-pc-linux-gnu/2.37_p1/libiberty.a' generated with LTO version 11.0 instead of the expected 11.2
> compilation terminated.
>
> The relink command picks up the installed version of libiberty.a
> instead of the just built one. This commit addresses the issue by
> replicating the workaround made in 7d53105d for libctf also for
> libopcodes and libgprofng.
>
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29042
> Bug: https://bugs.gentoo.org/834720
> Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
> ---
> 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 ab90bb08c5f..96256faf788 100644
> --- a/gprofng/src/Makefile.am
> +++ b/gprofng/src/Makefile.am
> @@ -131,7 +131,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 605fa4f6fd4..f968d8d6e59 100644
> --- a/gprofng/src/Makefile.in
> +++ b/gprofng/src/Makefile.in
> @@ -555,7 +555,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 8717d99ca26..fbdf41f87be 100755
> --- a/opcodes/configure
> +++ b/opcodes/configure
> @@ -12445,10 +12445,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 1beb72e87e0..79310916f7d 100644
> --- a/opcodes/configure.ac
> +++ b/opcodes/configure.ac
> @@ -193,10 +193,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
>
--
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer
(council, toolchain, base-system, perl, libreoffice)
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 981 bytes --]
prev parent reply other threads:[~2023-03-15 20:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-28 22:49 Andreas K. Hüttel
2023-03-01 8:29 ` Jan Beulich
2023-03-01 22:17 ` Vladimir Mezentsev
2023-03-02 5:11 ` Alan Modra
2023-03-02 8:10 ` Vladimir Mezentsev
2023-03-02 9:27 ` Alan Modra
2023-03-15 20:51 ` Andreas K. Huettel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1724922.vCJZsxu672@pinacolada \
--to=dilfridge@gentoo.org \
--cc=binutils@sourceware.org \
--cc=toolchain@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).