From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id F00E93858D33 for ; Tue, 28 Feb 2023 22:49:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F00E93858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= To: binutils@sourceware.org Cc: toolchain@gentoo.org, =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= Subject: [PATCH, needs more eyes] Relink also libopcodes and libgprofng to newly built libiberty.a Date: Tue, 28 Feb 2023 23:49:37 +0100 Message-Id: <20230228224937.3832887-1-dilfridge@gentoo.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 --- 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 -- 2.39.2