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 (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 144C215812D for ; Thu, 02 Jan 2025 13:29:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4B45FE0855; Thu, 02 Jan 2025 13:29:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 2FCC8E0855 for ; Thu, 02 Jan 2025 13:29:07 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 46E59335D21 for ; Thu, 02 Jan 2025 13:29:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D276D1732 for ; Thu, 02 Jan 2025 13:29:04 +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: <1735824532.222a016638e0f63dac0bb2724cb9594abaaf0731.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.40-r7.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: 222a016638e0f63dac0bb2724cb9594abaaf0731 X-VCS-Branch: master Date: Thu, 02 Jan 2025 13:29:04 +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: ee0edaec-886d-44e0-8b95-47c7cafc97b6 X-Archives-Hash: ebfe91b568d88d313597834e088f1481 commit: 222a016638e0f63dac0bb2724cb9594abaaf0731 Author: James Le Cuirot gentoo org> AuthorDate: Mon Dec 30 16:43:13 2024 +0000 Commit: James Le Cuirot gentoo org> CommitDate: Thu Jan 2 13:28:52 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=222a0166 sys-libs/glibc: Simplify and fix kernel header location logic ALT_HEADERS dates back to 2004 [1] and ALT_BUILD_HEADERS back to 2007 [2], both before crossdev was born. ALT_BUILD_HEADERS was added to crossdev in 2016 but then removed again in 2017. None of this seems necessary anymore. It's unclear exactly which scenario the linux/version.h logic was for, but this also appears obsolete now. It was referred to as a "fallback case" at the time it was added. Now that we have ESYSROOT, we can simply rely on that instead. Tested with a prefixed "Canadian Cross". [1] https://gitweb.gentoo.org/archive/repo/gentoo-2.git/commit/?id=5d0403b9db95bfe58e9196c31997eedc97869881 [2] https://gitweb.gentoo.org/archive/repo/gentoo-2.git/commit/?id=b127166cfbce8930aac4ed893df23c3e28b24737 Closes: https://github.com/gentoo/gentoo/pull/39914 Signed-off-by: James Le Cuirot gentoo.org> sys-libs/glibc/glibc-2.40-r7.ebuild | 28 ++++------------------------ sys-libs/glibc/glibc-9999.ebuild | 28 ++++------------------------ 2 files changed, 8 insertions(+), 48 deletions(-) diff --git a/sys-libs/glibc/glibc-2.40-r7.ebuild b/sys-libs/glibc/glibc-2.40-r7.ebuild index c24d663d40e0..66f7383c954d 100644 --- a/sys-libs/glibc/glibc-2.40-r7.ebuild +++ b/sys-libs/glibc/glibc-2.40-r7.ebuild @@ -248,29 +248,9 @@ 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. alt_headers() { - echo ${ALT_HEADERS:=$(alt_prefix)/usr/include} + echo $(alt_prefix)/usr/include } - -alt_build_headers() { - if [[ -z ${ALT_BUILD_HEADERS} ]] ; then - 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 - local header_path=$(echo '#include ' \ - | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 \ - | grep -o '[^"]*linux/version.h') - ALT_BUILD_HEADERS=${header_path%/linux/version.h} - fi - fi - fi - echo "${ALT_BUILD_HEADERS}" -} - alt_libdir() { echo $(alt_prefix)/$(get_libdir) } @@ -792,7 +772,7 @@ eend_KV() { get_kheader_version() { printf '#include \nLINUX_VERSION_CODE\n' | \ - $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ + $(tc-getCPP ${CTARGET}) -I "${ESYSROOT}$(alt_headers)" - | \ tail -n 1 } @@ -1065,7 +1045,7 @@ glibc_do_configure() { --host=${CTARGET_OPT:-${CTARGET}} $(use_enable profile) $(use_with gd) - --with-headers=$(build_eprefix)$(alt_build_headers) + --with-headers="${ESYSROOT}$(alt_headers)" --prefix="$(host_eprefix)/usr" --sysconfdir="$(host_eprefix)/etc" --localstatedir="$(host_eprefix)/var" @@ -1228,7 +1208,7 @@ glibc_headers_configure() { --enable-bind-now --build=${CBUILD_OPT:-${CBUILD}} --host=${CTARGET_OPT:-${CTARGET}} - --with-headers=$(build_eprefix)$(alt_build_headers) + --with-headers="${ESYSROOT}$(alt_headers)" --prefix="$(host_eprefix)/usr" ${EXTRA_ECONF} ) diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 68c5b9325049..39f4cd3f2872 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -250,29 +250,9 @@ 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. alt_headers() { - echo ${ALT_HEADERS:=$(alt_prefix)/usr/include} + echo $(alt_prefix)/usr/include } - -alt_build_headers() { - if [[ -z ${ALT_BUILD_HEADERS} ]] ; then - 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 - local header_path=$(echo '#include ' \ - | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 \ - | grep -o '[^"]*linux/version.h') - ALT_BUILD_HEADERS=${header_path%/linux/version.h} - fi - fi - fi - echo "${ALT_BUILD_HEADERS}" -} - alt_libdir() { echo $(alt_prefix)/$(get_libdir) } @@ -798,7 +778,7 @@ eend_KV() { get_kheader_version() { printf '#include \nLINUX_VERSION_CODE\n' | \ - $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ + $(tc-getCPP ${CTARGET}) -I "${ESYSROOT}$(alt_headers)" - | \ tail -n 1 } @@ -1077,7 +1057,7 @@ glibc_do_configure() { --host=${CTARGET_OPT:-${CTARGET}} $(use_enable profile) $(use_with gd) - --with-headers=$(build_eprefix)$(alt_build_headers) + --with-headers="${ESYSROOT}$(alt_headers)" --prefix="$(host_eprefix)/usr" --sysconfdir="$(host_eprefix)/etc" --localstatedir="$(host_eprefix)/var" @@ -1240,7 +1220,7 @@ glibc_headers_configure() { --enable-bind-now --build=${CBUILD_OPT:-${CBUILD}} --host=${CTARGET_OPT:-${CTARGET}} - --with-headers=$(build_eprefix)$(alt_build_headers) + --with-headers="${ESYSROOT}$(alt_headers)" --prefix="$(host_eprefix)/usr" ${EXTRA_ECONF} )