From 983fd58eed663ef31adbaa26d512710de64d1b4f Mon Sep 17 00:00:00 2001 From: "Andreas K. Hüttel" Date: Sun, 7 May 2023 00:20:18 +0200 Subject: sys-libs/glibc: update EAPI 7 -> 8, cleanups, minor improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas K. Hüttel --- sys-libs/glibc/glibc-9999.ebuild | 104 ++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 51 deletions(-) (limited to 'sys-libs') diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 38cec1fa3414..3a3b70d0d31b 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 # Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc # Please read & adapt the page as necessary if obsolete. @@ -23,6 +23,22 @@ EMULTILIB_PKG="true" PATCH_VER=1 PATCH_DEV=dilfridge +# gcc mulitilib bootstrap files version +GCC_BOOTSTRAP_VER=20201208 + +# locale-gen version +LOCALE_GEN_VER=2.23 + +# systemd integration version +GLIBC_SYSTEMD_VER=20210729 + +# Minimum kernel version that glibc requires +MIN_KERN_VER="3.2.0" + +# Minimum pax-utils version needed (which contains any new syscall changes for +# its seccomp filter!). Please double check this! +MIN_PAX_UTILS_VER="1.3.3" + if [[ ${PV} == 9999* ]]; then inherit git-r3 else @@ -31,26 +47,12 @@ else SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz" fi -RELEASE_VER=${PV} - -GCC_BOOTSTRAP_VER=20201208 - -LOCALE_GEN_VER=2.23 - -GLIBC_SYSTEMD_VER=20210729 - SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${LOCALE_GEN_VER}.tar.gz" SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )" SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )" IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd hash-sysv-compat headers-only +multiarch multilib multilib-bootstrap nscd perl profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla" -# Minimum kernel version that glibc requires -MIN_KERN_VER="3.2.0" -# Minimum pax-utils version needed (which contains any new syscall changes for -# its seccomp filter!). Please double check this! -MIN_PAX_UTILS_VER="1.3.3" - # Here's how the cross-compile logic breaks down ... # CTARGET - machine that will target the binaries # CHOST - machine that will host the binaries @@ -99,18 +101,21 @@ fi # Lastly, let's avoid some openssh nastiness, bug 708224, as # convenience to our users. -# gzip, grep, awk are needed by locale-gen, bug 740750 +# gzip, grep, awk are needed by locale-gen, bug 740750; depending on the +# compile-locales useflag either in src_install or in pkg_postinst. -BDEPEND=" - ${PYTHON_DEPS} - >=app-misc/pax-utils-${MIN_PAX_UTILS_VER} - sys-devel/bison - doc? ( sys-apps/texinfo ) +IDEPEND=" !compile-locales? ( app-arch/gzip sys-apps/grep app-alternatives/awk ) +" +BDEPEND=" + ${PYTHON_DEPS} + >=app-misc/pax-utils-${MIN_PAX_UTILS_VER} + sys-devel/bison + doc? ( sys-apps/texinfo ) test? ( dev-lang/perl ) " COMMON_DEPEND=" @@ -670,7 +675,7 @@ foreach_abi() { glibc_banner() { local b="Gentoo ${PVR}" - [[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" p${PATCH_VER}" + [[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" (patchset ${PATCH_VER})" echo "${b}" } @@ -766,13 +771,6 @@ sanity_prechecks() { fi fi - # Users have had a chance to phase themselves, time to give em the boot - if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then - eerror "You still haven't deleted ${EROOT}/etc/locales.build." - eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher." - die "Lazy upgrader detected" - fi - if [[ ${CTARGET} == i386-* ]] ; then eerror "i386 CHOSTs are no longer supported." eerror "Chances are you don't actually want/need i386." @@ -879,6 +877,8 @@ pkg_pretend() { upgrade_warning } +# pkg_setup + pkg_setup() { # see bug 682570 [[ -z ${BOOTSTRAP_RAP} ]] && python-any-r1_pkg_setup @@ -907,7 +907,7 @@ src_unpack() { unpack ${P}.tar.xz cd "${WORKDIR}" || die - unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz + unpack glibc-${PV}-patches-${PATCH_VER}.tar.xz fi cd "${WORKDIR}" || die @@ -915,15 +915,17 @@ src_unpack() { use systemd && unpack glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz } +# src_prepare + src_prepare() { local patchsetname if ! use vanilla ; then if [[ ${PV} == 9999* ]] ; then patchsetname="from git master" else - patchsetname="${RELEASE_VER}-${PATCH_VER}" + patchsetname="${PV}-${PATCH_VER}" fi - einfo "Applying Gentoo Glibc Patchset ${patchsetname}" + einfo "Applying Gentoo Glibc patchset ${patchsetname}" eapply "${WORKDIR}"/patches einfo "Done." fi @@ -932,7 +934,7 @@ src_prepare() { gnuconfig_update - cd "${WORKDIR}" + cd "${WORKDIR}" || die find . -name configure -exec touch {} + # move the external locale-gen to its old place @@ -944,9 +946,11 @@ src_prepare() { # Fix permissions on some of the scripts. chmod u+x "${S}"/scripts/*.sh - cd "${S}" + cd "${S}" || die } +# src_configure + glibc_do_configure() { dump_build_environment @@ -962,7 +966,7 @@ glibc_do_configure() { # https://sourceware.org/PR22634#c0 case $(tc-arch ${CTARGET}) in # Keep whitelist of targets where autodetection mostly works. - amd64|x86|sparc|ppc|ppc64|arm|arm64|s390) ;; + amd64|x86|sparc|ppc|ppc64|arm|arm64|s390|riscv|loong) ;; # Blacklist everywhere else *) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;; esac @@ -1040,6 +1044,7 @@ glibc_do_configure() { # -march= option tricks build system to infer too # high ISA level: https://sourceware.org/PR27318 libc_cv_include_x86_isa_level=no + # Explicit override of https://sourceware.org/PR27991 # exposes a bug in glibc's configure: # https://sourceware.org/PR27991 @@ -1219,6 +1224,8 @@ src_configure() { foreach_abi do_src_configure } +# src_compile + do_src_compile() { emake -C "$(builddir nptl)" } @@ -1231,6 +1238,8 @@ src_compile() { foreach_abi do_src_compile } +# src_test + glibc_src_test() { cd "$(builddir nptl)" @@ -1250,26 +1259,16 @@ glibc_src_test() { SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=16 emake ${myxfailparams} check } -do_src_test() { - local ret=0 - - glibc_src_test - : $(( ret |= $? )) - - return ${ret} -} - src_test() { if just_headers ; then return fi - # Give tests more time to complete. - export TIMEOUTFACTOR=5 - - foreach_abi do_src_test || die "tests failed" + foreach_abi glibc_src_test || die "tests failed" } +# src_install + run_locale_gen() { # if the host locales.gen contains no entries, we'll install everything local root="$1" @@ -1317,7 +1316,8 @@ glibc_do_src_install() { # Avoid stripping binaries not targeted by ${CHOST}. Or else # ${CHOST}-strip would break binaries build for ${CTARGET}. is_crosscompile && dostrip -x / - # gdb thread introspection relies on local libpthreas symbols. stripping breaks it + + # gdb thread introspection relies on local libpthreads symbols. stripping breaks it # See Note [Disable automatic stripping] dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so @@ -1435,6 +1435,8 @@ glibc_do_src_install() { ################################################################# # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY # + ################################################################# + # Make sure we install some symlink hacks so that when we build # a 2nd stage cross-compiler, gcc finds the target system # headers correctly. See gcc/doc/gccinstall.info @@ -1458,7 +1460,7 @@ glibc_do_src_install() { -e "s: \\\\::g" -e "s:/: :g" \ "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \ || die "generating /usr/share/i18n/SUPPORTED failed" - cd "${WORKDIR}"/extra/locale + cd "${WORKDIR}"/extra/locale || die dosbin locale-gen doman *.[0-8] insinto /etc @@ -1466,7 +1468,7 @@ glibc_do_src_install() { keepdir /usr/lib/locale - cd "${S}" + cd "${S}" || die # Install misc network config files insinto /etc -- cgit v1.2.3-65-gdbad