From patchwork Tue Feb 28 22:49:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andreas K. Huettel" X-Patchwork-Id: 62664 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3295044wrd; Tue, 28 Feb 2023 14:50:06 -0800 (PST) X-Google-Smtp-Source: AK7set+ujNL3UmH1IKd3gfKEclV0qMKMcL30hWNHLLnNiGvkvB8t0f9/OPf6hAXMmEd8PVGXdZuz X-Received: by 2002:a17:907:3e98:b0:88d:ba89:183a with SMTP id hs24-20020a1709073e9800b0088dba89183amr15985292ejc.11.1677624606528; Tue, 28 Feb 2023 14:50:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677624606; cv=none; d=google.com; s=arc-20160816; b=pekhcAgbetclSYk4gItS7lFdv+Blh0NzULhKB+7vRkshl/WZj7uCymTwEIdRKnNgvk SfIDYxnTN2agR1MP39dAVjOcqqsG0fqypyxz/nFOd4sVQyWNEdWVixCCQZ0K83Ty+FZw DzyedRKzDbhcWBfcWkxhfBhKPRN9keiAr1VmlxP94l74JKay5hPnsJUYoDqKAovXbMzj Q16dD3dVv8ssmTdWrr9e/whQf80/nKGt27G1tLLf/CAFawwjFUdSIiSEgdkTrhaAJ5Cm vcs6GcPrIHwvTLZNXD58vR/Qx2WXZY92tGmDqaIFX9yjVJp1+xNv3tXe2cTdju71UPGV eDxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=C0bY8vBqVar3KsgA7ltJIsjsbrxr6oIBj708BFRjHuw=; b=CGAfxOP/wiTB3Sj9htjXvh+Yy7k7FWE0MTePM5yHorpAa2Cu+CyhmtFjgWzg4/dg/Z tIpOKdkrpk0xM4kB9c6BjHMhQzGiidDyPq0KnNgED6UcFhJ1j+bTflSxYMUVte6jNn3K rdqNG/rhdkIhTxvXdzY91Qp3gpPEZk8iYmdv7ALcPXeSktBveUM2lBNPpV0AzDnzmvEd ZQy/kZgKKf9w/phvoYSkrZHwRAVwMjxz6J0XA7ZzR9XJE8QVorvZfdXPY9MHc9LHIbRU JACE/a4HUReAP/s1Vq9LkPP2nEjhKMqqV0GamGlh46z3aNIE3KhOyIvirOpkRuPN0fln jJIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=RGlhmDyu; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id j27-20020a1709062a1b00b008b17dad2e3bsi11770310eje.246.2023.02.28.14.50.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 14:50:06 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=RGlhmDyu; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 565863858C62 for ; Tue, 28 Feb 2023 22:50:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 565863858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677624605; bh=C0bY8vBqVar3KsgA7ltJIsjsbrxr6oIBj708BFRjHuw=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=RGlhmDyuDn6CJ3vTVWOpztDQ8BR9lxSBQ9paJKPv7RWVIdgvvlgZNN6bN4Awdin/V 9btj/oUxTw6WcOiUSLULydLqaKJh1LZwY6GYXGgbSSvx5GizfsM7n6RrFojbmr9+KR nEIkAF7keP/f+6jvSPvIqkCtAI7szqg6RAX6rbxQ= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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 To: binutils@sourceware.org Cc: toolchain@gentoo.org, =?utf-8?q?Andreas_K=2E_H=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 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Andreas_K=2E_H=C3=BCttel_via_Binutils?= From: "Andreas K. Huettel" Reply-To: =?utf-8?q?Andreas_K=2E_H=C3=BCttel?= Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759116899515257748?= X-GMAIL-MSGID: =?utf-8?q?1759116899515257748?= 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