From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 259C5158092 for ; Wed, 15 Jun 2022 22:06:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6726FE08A2; Wed, 15 Jun 2022 22:06:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 50391E08A2 for ; Wed, 15 Jun 2022 22:06:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 57DD034172B for ; Wed, 15 Jun 2022 22:06:29 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B17B7501 for ; Wed, 15 Jun 2022 22:06:27 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1655330718.4302d08ccac50d123e66d3524f01243bcddf9601.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/gdb/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/gdb/gdb-12.1-r1.ebuild sys-devel/gdb/gdb-9999.ebuild X-VCS-Directories: sys-devel/gdb/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 4302d08ccac50d123e66d3524f01243bcddf9601 X-VCS-Branch: master Date: Wed, 15 Jun 2022 22:06:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5b04f344-0f5c-4001-80d5-36da8e35eda1 X-Archives-Hash: d832a9e1c3d02851b260a0e793edefb3 commit: 4302d08ccac50d123e66d3524f01243bcddf9601 Author: Dongsu Park linux microsoft com> AuthorDate: Tue Jun 14 10:48:58 2022 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jun 15 22:05:18 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4302d08c sys-devel/gdb: fix cross build issues with configuring gmp libs As gdb 11 or newer requires gmp libs as dependency, a cross build of gdb 11.2 started to fail when its configure scripts try to detect if gmp exists. The failure occurs mainly because the build still passes '-L/usr/lib64` to LDFLAGS. Let's say, for example, host toolchains outside of sysroot have amd64 libs, while the target inside of sysroot should have arm64 libs. However, configure scripts of gdb 11.2 still try to find its libs outside of sysroot, /usr/lib64, although it should find its libs inside of sysroot, e.g. /build/arm64/usr/lib64. To fix the cross build issues, pass --with-sysroot as well as --libdir, correctly with ${ESYSROOT}. As a side note, for some reason, upstream gdb configure scripts are not able to correctly make use of its gmp-specific options like --with-gmp or --with-gmp-lib. Passing those options does not bring anything. Also configure must have both --with-sysroot and --libdir, to make the build work. Signed-off-by: Dongsu Park linux.microsoft.com> Closes: https://github.com/gentoo/gentoo/pull/25896 Signed-off-by: Sam James gentoo.org> sys-devel/gdb/{gdb-9999.ebuild => gdb-12.1-r1.ebuild} | 10 ++++++++++ sys-devel/gdb/gdb-9999.ebuild | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/sys-devel/gdb/gdb-9999.ebuild b/sys-devel/gdb/gdb-12.1-r1.ebuild similarity index 94% copy from sys-devel/gdb/gdb-9999.ebuild copy to sys-devel/gdb/gdb-12.1-r1.ebuild index 0eab4cadf89c..993eca47f83f 100644 --- a/sys-devel/gdb/gdb-9999.ebuild +++ b/sys-devel/gdb/gdb-12.1-r1.ebuild @@ -96,6 +96,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}"/${PN}-8.3.1-verbose-build.patch + "${FILESDIR}"/${P}-readline-8.2-build.patch ) pkg_setup() { @@ -154,6 +155,15 @@ src_configure() { # Ideally we would like automagic-or-disabled here. # But the check does not quite work on i686: bug #760926. $(use_enable cet) + + # We need to set both configure options, --with-sysroot and --libdir, + # to fix cross build issues that happen when configuring gmp. + # We explicitly need --libdir. Having only --with-sysroot without + # --libdir would not fix the build issues. + # For some reason, it is not enough to set only --with-sysroot, + # also not enough to pass --with-gmp-xxx options. + --with-sysroot="${ESYSROOT}" + --libdir="${ESYSROOT}/usr/$(get_libdir)" ) local sysroot="${EPREFIX}/usr/${CTARGET}" diff --git a/sys-devel/gdb/gdb-9999.ebuild b/sys-devel/gdb/gdb-9999.ebuild index 0eab4cadf89c..a431465d7f6a 100644 --- a/sys-devel/gdb/gdb-9999.ebuild +++ b/sys-devel/gdb/gdb-9999.ebuild @@ -154,6 +154,15 @@ src_configure() { # Ideally we would like automagic-or-disabled here. # But the check does not quite work on i686: bug #760926. $(use_enable cet) + + # We need to set both configure options, --with-sysroot and --libdir, + # to fix cross build issues that happen when configuring gmp. + # We explicitly need --libdir. Having only --with-sysroot without + # --libdir would not fix the build issues. + # For some reason, it is not enough to set only --with-sysroot, + # also not enough to pass --with-gmp-xxx options. + --with-sysroot="${ESYSROOT}" + --libdir="${ESYSROOT}/usr/$(get_libdir)" ) local sysroot="${EPREFIX}/usr/${CTARGET}"