diff options
Diffstat (limited to 'sys-libs/glibc/glibc-9999.ebuild')
-rw-r--r-- | sys-libs/glibc/glibc-9999.ebuild | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 0ccad6a681c1..b35b2febd192 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -6,7 +6,7 @@ EAPI=7 # Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc # Please read & adapt the page as necessary if obsolete. -PYTHON_COMPAT=( python3_{8,9,10} ) +PYTHON_COMPAT=( python3_{8..11} ) TMPFILES_OPTIONAL=1 inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic gnuconfig \ @@ -44,7 +44,7 @@ SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${L 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 headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp +static-libs suid systemd systemtap test vanilla" +IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla" # Minimum kernel version that glibc requires MIN_KERN_VER="3.2.0" @@ -305,22 +305,27 @@ setup_target_flags() { export CFLAGS="-march=${t} ${CFLAGS}" einfo "Auto adding -march=${t} to CFLAGS #185404" fi + # For compatibility with older binaries at slight performance cost. + use stack-realign && export CFLAGS+=" -mstackrealign" ;; amd64) # -march needed for #185404 #199334 # TODO: See cross-compile issues listed above for x86. - [[ ${ABI} == x86 ]] && - if ! do_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then - local t=${CTARGET_OPT:-${CTARGET}} - t=${t%%-*} - # Normally the target is x86_64-xxx, so turn that into the -march that - # gcc actually accepts. #528708 - [[ ${t} == "x86_64" ]] && t="x86-64" - filter-flags '-march=*' - # ugly, ugly, ugly. ugly. - CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}") - export CFLAGS_x86="${CFLAGS_x86} -march=${t}" - einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})" + if [[ ${ABI} == x86 ]]; then + if ! do_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then + local t=${CTARGET_OPT:-${CTARGET}} + t=${t%%-*} + # Normally the target is x86_64-xxx, so turn that into the -march that + # gcc actually accepts. #528708 + [[ ${t} == "x86_64" ]] && t="x86-64" + filter-flags '-march=*' + # ugly, ugly, ugly. ugly. + CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}") + export CFLAGS_x86="${CFLAGS_x86} -march=${t}" + einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})" + fi + # For compatibility with older binaries at slight performance cost. + use stack-realign && export CFLAGS_x86+=" -mstackrealign" fi ;; mips) @@ -429,8 +434,13 @@ setup_flags() { # include/libc-symbols.h:75:3: #error "glibc cannot be compiled without optimization" replace-flags -O0 -O1 + # glibc handles this internally already where it's appropriate; + # can't always have SSP when we're the ones setting it up, etc filter-flags '-fstack-protector*' + # Similar issues as with SSP. Can't inject yourself that early. + filter-flags '-fsanitize=*' + # See end of bug #830454; we handle this via USE=cet filter-flags '-fcf-protection=' } @@ -780,11 +790,19 @@ sanity_prechecks() { 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!" + # Do not run this check for pkg_pretend, just pkg_setup and friends (if we ever get used there). + # It's plausible (seen it in the wild) that Portage will (correctly) schedule a linux-headers + # upgrade before glibc, but because pkg_pretend gets run before any packages are merged at all (not + # just glibc), the whole emerge gets aborted without a good reason. We probably don't + # need to run this check at all given we have a dependency on the right headers, + # but let's leave it as-is for now. + if [[ ${EBUILD_PHASE_FUNC} != pkg_pretend ]] ; then + 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 fi fi @@ -1176,7 +1194,10 @@ glibc_src_test() { # sandbox does not understand unshare() and prevents # writes to /proc/, which makes many tests fail - SANDBOX_ON=0 LD_PRELOAD= emake ${myxfailparams} check + # we give the tests a bit more time to avoid spurious + # bug reports on slow arches + + SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=16 emake ${myxfailparams} check } do_src_test() { @@ -1558,7 +1579,7 @@ pkg_postinst() { if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then local entry for entry in passwd group shadow; do - if egrep -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then + if grep -E -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then ewarn "" ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been" ewarn "removed from glibc and is now provided by the package" |