From 0ebf740b9c9bc7c10ac41bea315ecc6c01c79166 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 21 Jan 2018 19:03:35 +0000 Subject: gentoo resync : 21.01.2018 --- sys-libs/glibc/Manifest | 4 +- sys-libs/glibc/glibc-2.26-r5.ebuild | 5 - sys-libs/glibc/glibc-9999.ebuild | 222 +++++++++++++++++++++--------------- 3 files changed, 130 insertions(+), 101 deletions(-) (limited to 'sys-libs/glibc') diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest index 462043f41f4c..5c5015764cae 100644 --- a/sys-libs/glibc/Manifest +++ b/sys-libs/glibc/Manifest @@ -43,6 +43,6 @@ EBUILD glibc-2.23-r4.ebuild 4975 BLAKE2B 9a0d3a3689896fab9f71fa20a83be5f2563f023 EBUILD glibc-2.24-r4.ebuild 5011 BLAKE2B 71050f0449074652d4fabc709326025b4de2e6642fdde87898acfde6f99cce95f4d7b9e1e7f9eedcdf6d2fd70ebf3c2860599ec36ccf68e0e633ec794f8ce0e8 SHA512 1cb3bcbd7d9d7f7c095bdff7c81d0acc3b4700c0b8a9d4fd0499cbf53abb55c67ca3bc3cce125916d238eb8cf6f6d69989af27defd6f194aaa5ac27cdda94eb9 EBUILD glibc-2.25-r10.ebuild 5012 BLAKE2B 86753e126c049ba2407529668b82094650a718b0abc954a28ee578d331c2ffa5e425ddfff67b7ab4decb91c3b966220eef6cf0247544015c0b3160ccff330576 SHA512 3a06e7d0a949bc7347c37e7b2fe48ad6ed328af9b0c3ca808f5fb50643aec6bd050ff868c926bc6f9aa62f572a2da26527de666a12b9e5ff9cb7cf680547e951 EBUILD glibc-2.25-r9.ebuild 4999 BLAKE2B 6c0784aa614374954c0747deb7a33fdba0f8b1935cc28c62af29880d64991cc93740eddefe8dca971d6c1bbba14161e10db75e00a91d73282e0c0bf094004b94 SHA512 3b5dc2073ae44e6cf5a4f8f64a3c3fd837ebaa222009ee617105259765ff4222fb3960be1c537d4fde6c7e928bd85325d9070cb668b31cb6afb03368c079141f -EBUILD glibc-2.26-r5.ebuild 25543 BLAKE2B d6f427a7c876a264fc7b14516c7e36adf97a594d291ff34b90f69397fa097968a38db2fbfd19854fedf55d59e7d1b8ff757b525cf6f33182cd3633f0044ef254 SHA512 364a561a54f81d4e40298310acec3c7bd976276abae24549d891de58146739964bb73e91b53c193fae8e6328dccbda0b57fbfca2b7e27912d1654c18ab62e13c -EBUILD glibc-9999.ebuild 39783 BLAKE2B 3029010d46b287fc480a67e5ed1ae71c5989e3e47db775888afdf5f44dd9ea21ce61f5d6f28e72ef0d8508cff9c925e2b76d4ac04dc7e700fd054e83148cb1f8 SHA512 d8c95ac974d1efae9f3d17a99a3707fb2a0f767e509256382418d0460364c2730d6318a311183a2c554ff33d4d79c161016e01a9a82787a71b8c9f750d018918 +EBUILD glibc-2.26-r5.ebuild 25380 BLAKE2B b3af0b788b73ede0255c2e5778fe637cd66f11e4912c00ae3e5cca3c65b6fce8f9613ff45768d97369ebfee6d0548bfdf41bb8ed8c4778d13612d9d98cc084c0 SHA512 6953295e4cbaa2f7d7241fe053704b2a949e0ee55515c3357ab3134cdcd6e84a1f00f01549ebf61640c3297814233062929f3bca5f91a5f5868742f5f7e5cb87 +EBUILD glibc-9999.ebuild 40516 BLAKE2B 47efe059c10b70deb5476d2f04b624a130b66a3240ac0d2ac4973884bc4e1bb90ad3ea3840b744c51a44092eaaf0112ca90e1a3b2e186fd02dcb1e08fb32942f SHA512 e9321670cf316b834110b739b93a0bd650e0a639db74c721dd40fb97043f36022bd5d75b55af563a01880c358f13d4d55ebe4006827f46338301ba6b88fc60ee MISC metadata.xml 1054 BLAKE2B dbc091e54130729385bc02aaa1025885f101caa88d601b1f7670974d89e7e24aae5d37fd6699278a37c0064e1f3232c04954dc127869427317b5d80b499f3813 SHA512 65474b7d32ceb6bafe8ae0e18aa0b46b68cefecce5570a0e8d4a0117019e6540f2feae35cecbebad382b4f06d6e5ae1dfa9b8a61889881e8534956dd42df8e4b diff --git a/sys-libs/glibc/glibc-2.26-r5.ebuild b/sys-libs/glibc/glibc-2.26-r5.ebuild index 4eb6b34679f5..ca34027cda76 100644 --- a/sys-libs/glibc/glibc-2.26-r5.ebuild +++ b/sys-libs/glibc/glibc-2.26-r5.ebuild @@ -323,11 +323,6 @@ glibc_do_configure() { popd > /dev/null case ${CTARGET} in - mips*) - # dlopen() detects stack smash on mips n32 ABI. - # Cause is unknown: https://bugs.gentoo.org/640130 - myconf+=( --enable-stack-protector=no ) - ;; powerpc-*) # Currently gcc on powerpc32 generates invalid code for # __builtin_return_address(0) calls. Normally programs diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index f7f93ffbd6ea..cb0e4cb11119 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -509,7 +509,53 @@ check_devpts() { fi } -int_to_KV() { +# The following Kernel version handling functions are mostly copied from portage +# source. It's better not to use linux-info.eclass here since a) it adds too +# much magic, see bug 326693 for some of the arguments, and b) some of the +# functions are just not provided. + +g_get_running_KV() { + uname -r + return $? +} + +g_KV_major() { + [[ -z $1 ]] && return 1 + local KV=$@ + echo "${KV%%.*}" +} + +g_KV_minor() { + [[ -z $1 ]] && return 1 + local KV=$@ + KV=${KV#*.} + echo "${KV%%.*}" +} + +g_KV_micro() { + [[ -z $1 ]] && return 1 + local KV=$@ + KV=${KV#*.*.} + echo "${KV%%[^[:digit:]]*}" +} + +g_KV_to_int() { + [[ -z $1 ]] && return 1 + local KV_MAJOR=$(g_KV_major "$1") + local KV_MINOR=$(g_KV_minor "$1") + local KV_MICRO=$(g_KV_micro "$1") + local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO )) + + # We make version 2.2.0 the minimum version we will handle as + # a sanity check ... if its less, we fail ... + if [[ ${KV_int} -ge 131584 ]] ; then + echo "${KV_int}" + return 0 + fi + return 1 +} + +g_int_to_KV() { local version=$1 major minor micro major=$((version / 65536)) minor=$(((version % 65536) / 256)) @@ -518,7 +564,7 @@ int_to_KV() { } eend_KV() { - [[ $(KV_to_int $1) -ge $(KV_to_int $2) ]] + [[ $(g_KV_to_int $1) -ge $(g_KV_to_int $2) ]] eend $? } @@ -528,51 +574,10 @@ get_kheader_version() { tail -n 1 } -check_nptl_support() { - # We don't care about the compiler here as we aren't using it - just_headers && return - - local run_kv build_kv want_kv - - # TODO: this needs to be replaced somehow - run_kv=$(int_to_KV $(get_KV)) - - build_kv=$(int_to_KV $(get_kheader_version)) - want_kv=${MIN_KERN_VER} - - ebegin "Checking gcc for __thread support" - if ! eend $(want__thread ; echo $?) ; then - echo - eerror "Could not find a gcc that supports the __thread directive!" - eerror "Please update your binutils/gcc and try again." - die "No __thread support in gcc!" - fi - - if ! is_crosscompile && ! tc-is-cross-compiler ; then - # Building fails on an non-supporting kernel - ebegin "Checking kernel version (${run_kv} >= ${want_kv})" - if ! eend_KV ${run_kv} ${want_kv} ; then - echo - eerror "You need a kernel of at least ${want_kv}!" - die "Kernel version too low!" - fi - fi - - ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})" - if ! eend_KV ${build_kv} ${want_kv} ; then - echo - eerror "You need linux-headers of at least ${want_kv}!" - die "linux-headers version too low!" - fi -} - -# -# the phases -# - -# pkg_pretend - -pkg_pretend() { +# We collect all sanity checks here. Consistency is not guranteed between +# pkg_ and src_ phases, so we call this function both in pkg_pretend and in +# src_unpack. +sanity_prechecks() { # Make sure devpts is mounted correctly for use w/out setuid pt_chown check_devpts @@ -591,9 +596,6 @@ pkg_pretend() { eerror " Downgrading glibc is not supported and a sure way to destruction." die "Aborting to save your system." fi - - # removed check for #262698 since it's about kernel 2.6.18 ... - # removed check for #279260 since it's about kernel <2.6.28 ... fi # Users have had a chance to phase themselves, time to give em the boot @@ -610,6 +612,12 @@ pkg_pretend() { die "Please fix your CHOST" fi + if ! do_run_test '#include \n#include \nint main(){return syscall(1000)!=-1;}\n' ; then + eerror "Your old kernel is broken. You need to update it to a newer" + eerror "version as syscall() will break. See bug 279260." + die "Old and broken kernel." + fi + if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS." ewarn "This will result in a 50% performance penalty when running with a 32bit" @@ -619,30 +627,6 @@ pkg_pretend() { use hardened && ! tc-enables-pie && \ ewarn "PIE hardening not applied, as your compiler doesn't default to PIE" - # Make sure host system is up to date #394453 - if has_version ' "${T}/check-ia32-emulation.c" + "${CC-${CHOST}-gcc}" ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32" + "${T}/check-ia32-emulation.elf32" + local STAT=$? + rm -f "${T}/check-ia32-emulation.elf32" + eend $STAT + [ $STAT -eq 0 ] || die "CONFIG_IA32_EMULATION must be enabled in the kernel to compile a multilib glibc." + fi + + fi + + # When we actually have to compile something... + if ! just_headers ; then + local run_kv build_kv want_kv + + run_kv=$(g_get_running_KV) + build_kv=$(g_int_to_KV $(get_kheader_version)) + want_kv=${MIN_KERN_VER} + + ebegin "Checking gcc for __thread support" + if ! eend $(want__thread ; echo $?) ; then + echo + eerror "Could not find a gcc that supports the __thread directive!" + eerror "Please update your binutils/gcc and try again." + die "No __thread support in gcc!" + fi + + if ! is_crosscompile && ! tc-is-cross-compiler ; then + # Building fails on an non-supporting kernel + ebegin "Checking running kernel version (${run_kv} >= ${want_kv})" + if ! eend_KV ${run_kv} ${want_kv} ; then + echo + eerror "You need a kernel of at least ${want_kv}!" + die "Kernel version too low!" + fi + fi + + ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})" + if ! eend_KV ${build_kv} ${want_kv} ; then + echo + eerror "You need linux-headers of at least ${want_kv}!" + die "linux-headers version too low!" + fi + fi +} + + +# +# the phases +# + +# pkg_pretend + +pkg_pretend() { + # All the checks... + einfo "Checking general environment sanity." + sanity_prechecks } -# todo: shouldn't most of these checks be called also in src_configure again? -# (since consistency is not guaranteed between pkg_ and src_) # src_unpack src_unpack() { + # Consistency is not guaranteed between pkg_ and src_ ... + sanity_prechecks + use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2 setup_env - # Check NPTL support _before_ we unpack things to save some time - check_nptl_support - # todo: 1) move this to pkg_pretend? 2) use proper functions for kv - if [[ -n ${EGIT_REPO_URI} ]] ; then git-r3_src_unpack else unpack ${P}.tar.xz fi - cd "${S}" - touch locale/C-translit.h #185476 #218003 + cd "${S}" || die + touch locale/C-translit.h || die #185476 #218003 - cd "${WORKDIR}" + cd "${WORKDIR}" || die unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2 } @@ -768,11 +813,6 @@ glibc_do_configure() { local myconf=() case ${CTARGET} in - mips*) - # dlopen() detects stack smash on mips n32 ABI. - # Cause is unknown: https://bugs.gentoo.org/640130 - myconf+=( --enable-stack-protector=no ) - ;; powerpc-*) # Currently gcc on powerpc32 generates invalid code for # __builtin_return_address(0) calls. Normally programs @@ -891,16 +931,10 @@ glibc_do_configure() { # is built with MULTILIB_ABIS="amd64 x86" but we want to # add x32 to it, gcc/glibc don't yet support x32. # - # This reqires net-libs/rpcsvc-proto now (which provides - # rpcgen) !!! Needs analysis how to best add to deps. - # if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib ; then echo 'main(){}' > "${T}"/test.c if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die - mkdir -p sunrpc - cp $(which rpcgen) sunrpc/cross-rpcgen || die - touch -t 202001010101 sunrpc/cross-rpcgen || die fi fi } -- cgit v1.2.3