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 D3315158009 for ; Sat, 4 Mar 2023 02:30:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F4073E07A5; Sat, 4 Mar 2023 02:30:05 +0000 (UTC) Received: from smtp.gentoo.org (dev.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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CFF18E07A5 for ; Sat, 4 Mar 2023 02:30:05 +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 D59DD340C8A for ; Sat, 4 Mar 2023 02:30:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3598E8C1 for ; Sat, 4 Mar 2023 02:30:01 +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: <1677896973.7766b01c2f7ac6856cd21f8261b631bb88060bda.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-13.1-r1.ebuild sys-devel/gdb/gdb-13.1.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: 7766b01c2f7ac6856cd21f8261b631bb88060bda X-VCS-Branch: master Date: Sat, 4 Mar 2023 02:30:01 +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: 72f488e7-9c43-4811-941d-92a5913cfdb1 X-Archives-Hash: 54926c85178e504abc7e9006e04f1d73 commit: 7766b01c2f7ac6856cd21f8261b631bb88060bda Author: James Le Cuirot gentoo org> AuthorDate: Sun Feb 26 23:42:33 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sat Mar 4 02:29:33 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7766b01c sys-devel/gdb: Fix cross-compiling (properly) and prefix sysroot https://github.com/gentoo/gentoo/pull/25896 tried to address cross-compiling in the wrong way by setting the runtime sysroot and the libdir. The build uses the latter to find dependent libraries by default, a common technique in GNU software. This behaviour can be avoided by passing the "without-prefix" configure option for each library, allowing the runtime sysroot and the libdir to be set as they should be. Contrary to what you might expect, the sysroot should actually not be set at all except when building cross-*/gdb, otherwise the paths get double prefixed at runtime. gdb's configure script also has a --with-build-sysroot option that should be set to assist with cross-compiling. This does not influence runtime behaviour. The includedir for cross-*/gdb has been changed to prevent it from installing under /usr/${CTARGET}, where installed headers would collide with those from a cross-compiled sys-devel/gdb build. /usr/include/${CTARGET}/gdb is consistent with the files we install under /usr/share, as well as the scheme we use for multilib headers, e.g. /usr/include/i686-pc-linux-gnu. Closes: https://bugs.gentoo.org/896008 Signed-off-by: James Le Cuirot gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/29819 Signed-off-by: Sam James gentoo.org> .../gdb/{gdb-13.1.ebuild => gdb-13.1-r1.ebuild} | 23 +++++++++++----------- sys-devel/gdb/gdb-9999.ebuild | 23 +++++++++++----------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/sys-devel/gdb/gdb-13.1.ebuild b/sys-devel/gdb/gdb-13.1-r1.ebuild similarity index 93% rename from sys-devel/gdb/gdb-13.1.ebuild rename to sys-devel/gdb/gdb-13.1-r1.ebuild index d356d5e3ecab..bc86849c6276 100644 --- a/sys-devel/gdb/gdb-13.1.ebuild +++ b/sys-devel/gdb/gdb-13.1-r1.ebuild @@ -160,21 +160,13 @@ src_configure() { # 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)" + # Helps when cross-compiling. Not to be confused with --with-sysroot. + --with-build-sysroot="${ESYSROOT}" ) - local sysroot="${EPREFIX}/usr/${CTARGET}" - is_cross && myconf+=( - --with-sysroot="${sysroot}" - --includedir="${sysroot}/usr/include" + --with-sysroot="\${prefix}/${CTARGET}" + --includedir="\${prefix}/include/${CTARGET}" --with-gdb-datadir="\${datadir}/gdb/${CTARGET}" ) @@ -211,6 +203,13 @@ src_configure() { $(use_with xxhash) $(use_with guile) $(use_with zstd) + + # Find libraries using the toolchain sysroot rather than the configured + # prefix. Needed when cross-compiling. + # + # Check which libraries to apply this to with: + # "${S}"/gdb/configure --help | grep without-lib | sort + --without-lib{babeltrace,expat,gmp,iconv,ipt,lzma,mpfr,xxhash}-prefix ) if use sparc-solaris || use x86-solaris ; then diff --git a/sys-devel/gdb/gdb-9999.ebuild b/sys-devel/gdb/gdb-9999.ebuild index d356d5e3ecab..bc86849c6276 100644 --- a/sys-devel/gdb/gdb-9999.ebuild +++ b/sys-devel/gdb/gdb-9999.ebuild @@ -160,21 +160,13 @@ src_configure() { # 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)" + # Helps when cross-compiling. Not to be confused with --with-sysroot. + --with-build-sysroot="${ESYSROOT}" ) - local sysroot="${EPREFIX}/usr/${CTARGET}" - is_cross && myconf+=( - --with-sysroot="${sysroot}" - --includedir="${sysroot}/usr/include" + --with-sysroot="\${prefix}/${CTARGET}" + --includedir="\${prefix}/include/${CTARGET}" --with-gdb-datadir="\${datadir}/gdb/${CTARGET}" ) @@ -211,6 +203,13 @@ src_configure() { $(use_with xxhash) $(use_with guile) $(use_with zstd) + + # Find libraries using the toolchain sysroot rather than the configured + # prefix. Needed when cross-compiling. + # + # Check which libraries to apply this to with: + # "${S}"/gdb/configure --help | grep without-lib | sort + --without-lib{babeltrace,expat,gmp,iconv,ipt,lzma,mpfr,xxhash}-prefix ) if use sparc-solaris || use x86-solaris ; then