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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C4F04138334 for ; Sun, 21 Jul 2019 13:40:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 095CAE0822; Sun, 21 Jul 2019 13:40:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CFA52E0822 for ; Sun, 21 Jul 2019 13:40:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 046973483BF for ; Sun, 21 Jul 2019 13:40:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CC4EC2A5 for ; Sun, 21 Jul 2019 13:40:10 +0000 (UTC) From: "James Le Cuirot" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "James Le Cuirot" Message-ID: <1563715854.ea4cbdc9159c0ebbd29d4062bbb314393a8cc32f.chewi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-libs/glibc/glibc-2.29-r2.ebuild sys-libs/glibc/glibc-9999.ebuild X-VCS-Directories: sys-libs/glibc/ X-VCS-Committer: chewi X-VCS-Committer-Name: James Le Cuirot X-VCS-Revision: ea4cbdc9159c0ebbd29d4062bbb314393a8cc32f X-VCS-Branch: master Date: Sun, 21 Jul 2019 13:40:10 +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: 93747675-64b7-491d-97c0-2b9d9bed8333 X-Archives-Hash: 01cdb011ebb08086fcf5e9ae820417c5 commit: ea4cbdc9159c0ebbd29d4062bbb314393a8cc32f Author: James Le Cuirot gentoo org> AuthorDate: Fri Jul 12 21:13:47 2019 +0000 Commit: James Le Cuirot gentoo org> CommitDate: Sun Jul 21 13:30:54 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea4cbdc9 sys-libs/glibc: Fix handling of ${EPREFIX} when building cross-glibc It was duplicating the prefix in the form ${EPREFIX}/usr/${CTARGET}/${EPREFIX}. This also fixes the kernel header version check, which was broken for native prefixed builds. Bug: https://bugs.gentoo.org/642604 Closes: https://github.com/gentoo/gentoo/pull/12435 Package-Manager: Portage-2.3.69, Repoman-2.3.13 Signed-off-by: James Le Cuirot gentoo.org> sys-libs/glibc/glibc-2.29-r2.ebuild | 32 ++++++++++++++++++++++---------- sys-libs/glibc/glibc-9999.ebuild | 32 ++++++++++++++++++++++---------- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/sys-libs/glibc/glibc-2.29-r2.ebuild b/sys-libs/glibc/glibc-2.29-r2.ebuild index ad6fed1c166..da78a273d19 100644 --- a/sys-libs/glibc/glibc-2.29-r2.ebuild +++ b/sys-libs/glibc/glibc-2.29-r2.ebuild @@ -125,6 +125,18 @@ alt_prefix() { is_crosscompile && echo /usr/${CTARGET} } +# This prefix is applicable to CHOST when building against this +# glibc. It is baked into the library at configure time. +host_eprefix() { + is_crosscompile || echo "${EPREFIX}" +} + +# This prefix is applicable to CBUILD when building against this +# glibc. It determines the destination path at install time. +build_eprefix() { + is_crosscompile && echo "${EPREFIX}" +} + # We need to be able to set alternative headers for compiling for non-native # platform. Will also become useful for testing kernel-headers without screwing # up the whole system. @@ -134,7 +146,7 @@ alt_headers() { alt_build_headers() { if [[ -z ${ALT_BUILD_HEADERS} ]] ; then - ALT_BUILD_HEADERS="${EPREFIX}$(alt_headers)" + ALT_BUILD_HEADERS="$(host_eprefix)$(alt_headers)" if tc-is-cross-compiler ; then ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers) if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then @@ -578,7 +590,7 @@ eend_KV() { get_kheader_version() { printf '#include \nLINUX_VERSION_CODE\n' | \ - $(tc-getCPP ${CTARGET}) -I "${EPREFIX}/$(alt_build_headers)" - | \ + $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ tail -n 1 } @@ -892,9 +904,9 @@ glibc_do_configure() { $(use_enable profile) $(use_with gd) --with-headers=$(alt_build_headers) - --prefix="${EPREFIX}/usr" - --sysconfdir="${EPREFIX}/etc" - --localstatedir="${EPREFIX}/var" + --prefix="$(host_eprefix)/usr" + --sysconfdir="$(host_eprefix)/etc" + --localstatedir="$(host_eprefix)/var" --libdir='$(prefix)'/$(get_libdir) --mandir='$(prefix)'/share/man --infodir='$(prefix)'/share/info @@ -916,8 +928,8 @@ glibc_do_configure() { # There is no configure option for this and we need to export it # since the glibc build will re-run configure on itself - export libc_cv_rootsbindir="${EPREFIX}/sbin" - export libc_cv_slibdir="${EPREFIX}/$(get_libdir)" + export libc_cv_rootsbindir="$(host_eprefix)/sbin" + export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)" # We take care of patching our binutils to use both hash styles, # and many people like to force gnu hash style only, so disable @@ -1046,7 +1058,7 @@ glibc_headers_configure() { --build=${CBUILD_OPT:-${CBUILD}} --host=${CTARGET_OPT:-${CTARGET}} --with-headers=$(alt_build_headers) - --prefix="${EPREFIX}/usr" + --prefix="$(host_eprefix)/usr" ${EXTRA_ECONF} ) @@ -1136,7 +1148,7 @@ glibc_do_src_install() { local builddir=$(builddir nptl) cd "${builddir}" - emake install_root="${D}$(alt_prefix)" install || die + emake install_root="${D}$(build_eprefix)$(alt_prefix)" install || die # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support # which come without headers etc. Only needed for binary packages since the @@ -1320,7 +1332,7 @@ glibc_do_src_install() { glibc_headers_install() { local builddir=$(builddir "headers") cd "${builddir}" - emake install_root="${D}$(alt_prefix)" install-headers + emake install_root="${D}$(build_eprefix)$(alt_prefix)" install-headers insinto $(alt_headers)/gnu doins "${S}"/include/gnu/stubs.h diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 39209741d27..2b0697465d5 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -126,6 +126,18 @@ alt_prefix() { is_crosscompile && echo /usr/${CTARGET} } +# This prefix is applicable to CHOST when building against this +# glibc. It is baked into the library at configure time. +host_eprefix() { + is_crosscompile || echo "${EPREFIX}" +} + +# This prefix is applicable to CBUILD when building against this +# glibc. It determines the destination path at install time. +build_eprefix() { + is_crosscompile && echo "${EPREFIX}" +} + # We need to be able to set alternative headers for compiling for non-native # platform. Will also become useful for testing kernel-headers without screwing # up the whole system. @@ -135,7 +147,7 @@ alt_headers() { alt_build_headers() { if [[ -z ${ALT_BUILD_HEADERS} ]] ; then - ALT_BUILD_HEADERS="${EPREFIX}$(alt_headers)" + ALT_BUILD_HEADERS="$(host_eprefix)$(alt_headers)" if tc-is-cross-compiler ; then ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers) if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then @@ -585,7 +597,7 @@ eend_KV() { get_kheader_version() { printf '#include \nLINUX_VERSION_CODE\n' | \ - $(tc-getCPP ${CTARGET}) -I "${EPREFIX}/$(alt_build_headers)" - | \ + $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ tail -n 1 } @@ -899,9 +911,9 @@ glibc_do_configure() { $(use_enable profile) $(use_with gd) --with-headers=$(alt_build_headers) - --prefix="${EPREFIX}/usr" - --sysconfdir="${EPREFIX}/etc" - --localstatedir="${EPREFIX}/var" + --prefix="$(host_eprefix)/usr" + --sysconfdir="$(host_eprefix)/etc" + --localstatedir="$(host_eprefix)/var" --libdir='$(prefix)'/$(get_libdir) --mandir='$(prefix)'/share/man --infodir='$(prefix)'/share/info @@ -923,8 +935,8 @@ glibc_do_configure() { # There is no configure option for this and we need to export it # since the glibc build will re-run configure on itself - export libc_cv_rootsbindir="${EPREFIX}/sbin" - export libc_cv_slibdir="${EPREFIX}/$(get_libdir)" + export libc_cv_rootsbindir="$(host_eprefix)/sbin" + export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)" # We take care of patching our binutils to use both hash styles, # and many people like to force gnu hash style only, so disable @@ -1053,7 +1065,7 @@ glibc_headers_configure() { --build=${CBUILD_OPT:-${CBUILD}} --host=${CTARGET_OPT:-${CTARGET}} --with-headers=$(alt_build_headers) - --prefix="${EPREFIX}/usr" + --prefix="$(host_eprefix)/usr" ${EXTRA_ECONF} ) @@ -1143,7 +1155,7 @@ glibc_do_src_install() { local builddir=$(builddir nptl) cd "${builddir}" - emake install_root="${D}$(alt_prefix)" install || die + emake install_root="${D}$(build_eprefix)$(alt_prefix)" install || die # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support # which come without headers etc. Only needed for binary packages since the @@ -1327,7 +1339,7 @@ glibc_do_src_install() { glibc_headers_install() { local builddir=$(builddir "headers") cd "${builddir}" - emake install_root="${D}$(alt_prefix)" install-headers + emake install_root="${D}$(build_eprefix)$(alt_prefix)" install-headers insinto $(alt_headers)/gnu doins "${S}"/include/gnu/stubs.h