commit:     f314af7a9d2a107124d2c4d869ff2542a78f900c
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 16 19:01:28 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 16 19:01:40 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f314af7a

sys-libs/glibc: misc upstream fixes

 sys-libs/glibc/Manifest             |   1 +
 sys-libs/glibc/glibc-2.21-r2.ebuild | 198 ++++++++++++++++++++++++++++++++++++
 2 files changed, 199 insertions(+)

diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
index 29644d4..209f615 100644
--- a/sys-libs/glibc/Manifest
+++ b/sys-libs/glibc/Manifest
@@ -8,6 +8,7 @@ DIST glibc-2.19.tar.xz 12083312 SHA256 
2d3997f588401ea095a0b27227b1d50cdfdd41623
 DIST glibc-2.20-patches-5.tar.bz2 55986 SHA256 
3d3eec9ac9b5d0530f9e05614f4646d64ff93a48865b42c156990bea69247cda SHA512 
409f59a028127e02f0c9f91107715b540d8d234475830adc17108a02664be232098d119b43bcc8df9b328ab50c1fffb0868d510e6487ce1c34ec2c7c7a78375b
 WHIRLPOOL 
b3c41b01af5d8ae8e901ac48ae124e13ff1c76fbeb35315cb9630c648c03d7abbfb753294cbdfe1dc939bda260e24d8450ffb19cfe5c255b32f8c5500f2c43f3
 DIST glibc-2.20.tar.xz 12283992 SHA256 
f84b6d42aecc288d593c397b0a3d02260a33ee686bce0c634eb9b32798f36ba5 SHA512 
7a8eea8b71d3ccba766c3f304cab61055446d451ef063309476b26dc40d880562dc33b1b68fbedeedb4b55b84c26415b9202311aaa71ef8c141b6849a814d2fa
 WHIRLPOOL 
042f74d75c62a655ae35348c9cd0bed0845ab199e37a76635eb74c04ed927b5eca77723c38d2dc46f12fca62c1004001887b43946a914b079ad22f6a9cc8daaa
 DIST glibc-2.21-patches-5.tar.bz2 34237 SHA256 
8f6a5dd094ad2c4b82368ef4b081ce6c634f61ea2783cdc68bcd9250d61682e1 SHA512 
19b0e706cee387aa3a9ed40dd20081ffe98eaaf9a5ca027ee4abd3e46c3403af06c5189bd764d8d477cb356507e1142b5fde852ec710cf24e108c307f5843837
 WHIRLPOOL 
96c4ec00af41c60c238f681ea5448cec4db11dc59b4853eed5ba700aa21f804de2443166aa48d30f76af6b1a2eb74a47a7d1163e2067e5bbdcdbe3e4bf2a38c4
+DIST glibc-2.21-patches-6.tar.bz2 42366 SHA256 
01c0373a950b3df9bbd2e466718e3adbbbe0bd4a0fa00376386c95078e45e8f5 SHA512 
83dcbcd1733784dfde4fb6aa2431a929e8b5750797fecd30686a6b3145a2ac6a6245957a866cd745dad8e1b976e82ee584ca1b21888dfc26ae839bb7da71e702
 WHIRLPOOL 
870ee6d0d4a6695d55472870d13cb943cfd7b0a2662be51198d7e9ddb24e4eb26ccee4f032677e95584dccd48685990c144402e147c01b0c90fca30c9fcdfc45
 DIST glibc-2.21.tar.xz 12322092 SHA256 
aeeb362437965a5d3f40b151094ca79def04a115bd363fdd4a9a0c69482923b8 SHA512 
8cded6693618bec115f678fcbd0b77556f97dfa8337608f66e37224aefa55b38765ba61cb4d58beea37b5934e5ec8e30bad58613707388484906f2a0ce77997d
 WHIRLPOOL 
d07fec32bd92eade065a3b6170932b8bd41d07df4aa69dd5a860ebb9678c22bd1e20bf88b1fc05c3ecc18e709c0a63118e12525dc668e0399d7ef7fe4454702d
 DIST glibc-2.22-patches-9.tar.bz2 37781 SHA256 
724ebd9c068af2740b2058dfe6685e4c496c845a9e927efdacd763c22d5d9fbd SHA512 
dda6ce3908f4261744178c0a345c016a3b0a7ca1d75063e1b216b6b95aea663f1741391e71966e0ed8018eea1a628786ccd026c6616def721bbedb961d5245e8
 WHIRLPOOL 
9725fabb933d3b48cdce5df4e5e9ed9bc58f737836405e1345849764ae6013cd2a2ac73a23137e87964d940bd79115f82b777bc807ce4c58a28a247cdf22f68f
 DIST glibc-2.22.tar.xz 12969072 SHA256 
eb731406903befef1d8f878a46be75ef862b9056ab0cde1626d08a7a05328948 SHA512 
a8719f3a4f8aa5fa81711116fdafbea5082c6dfd85bd8c4cdce60571910263ab422b35bb8b55a84d37ccb146442133ba60a84d453ca4a439c8ccd35419bd051b
 WHIRLPOOL 
f7e707b3776fc197a2e7bf5633721925507237b154bbc1f94b9fc303c87e6fc039ff0758da6ee55b4c1a0daaa87c6e594a6c96e7b00a7ba8ae98ee29918709a7

diff --git a/sys-libs/glibc/glibc-2.21-r2.ebuild 
b/sys-libs/glibc/glibc-2.21-r2.ebuild
new file mode 100644
index 0000000..6a1c0bb
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.21-r2.ebuild
@@ -0,0 +1,198 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib 
systemd unpacker multiprocessing
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html";
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 
~sh ~sparc ~x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+       EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+       EGIT_SOURCEDIRS="${S}"
+       inherit git-2
+       ;;
+*)
+       RELEASE_VER=${PV}
+       ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+PATCH_VER="6"                                  # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"}                   # min kernel version nptl 
requires
+
+IUSE="debug gd hardened multilib nscd selinux systemtap profile suid vanilla 
crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+#  CTARGET - machine that will target the binaries
+#  CHOST   - machine that will host the binaries
+#  CBUILD  - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+#  CBUILD = CHOST = CTARGET    - native build/install
+#  CBUILD != (CHOST = CTARGET) - cross-compile a native build
+#  (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+#  CBUILD != CHOST != CTARGET  - cross-compile a libc for a cross-compiler
+# For install paths:
+#  CHOST = CTARGET  - install into /
+#  CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+       if [[ ${CATEGORY} == cross-* ]] ; then
+               export CTARGET=${CATEGORY#cross-}
+       fi
+fi
+
+is_crosscompile() {
+       [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+DEPEND=">=app-misc/pax-utils-0.1.10
+       !<sys-apps/sandbox-1.6
+       !<sys-apps/portage-2.1.2
+       selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+       sys-apps/gentoo-functions
+       selinux? ( sys-libs/libselinux )
+       !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+       DEPEND+=" !crosscompile_opts_headers-only? (
+               >=${CATEGORY}/binutils-2.24
+               >=${CATEGORY}/gcc-4.6
+       )"
+       [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+       DEPEND+="
+               >=sys-devel/binutils-2.24
+               >=sys-devel/gcc-4.6
+               virtual/os-headers"
+       RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+       PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+       echo mirror://gnu/glibc/$1 
ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+       local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+       devspace=${devspace//HTTP/https://dev.gentoo.org/}
+       echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+       [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+       [[ -n ${PATCH_VER}      ]] && gentoo_uris 
${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris 
gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+# eblit-include [--skip] <function> [version]
+eblit-include() {
+       local skipable=false
+       [[ $1 == "--skip" ]] && skipable=true && shift
+       [[ $1 == pkg_* ]] && skipable=true
+
+       local e v func=$1 ver=$2
+       [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
+       for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
+               e="${FILESDIR}/eblits/${func}${v}.eblit"
+               if [[ -e ${e} ]] ; then
+                       source "${e}"
+                       return 0
+               fi
+       done
+       ${skipable} && return 0
+       die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
+}
+
+# eblit-run-maybe <function>
+# run the specified function if it is defined
+eblit-run-maybe() {
+       [[ $(type -t "$@") == "function" ]] && "$@"
+}
+
+# eblit-run <function> [version]
+# aka: src_unpack() { eblit-run src_unpack ; }
+eblit-run() {
+       eblit-include --skip common "${*:2}"
+       eblit-include "$@"
+       eblit-run-maybe eblit-$1-pre
+       eblit-${PN}-$1
+       eblit-run-maybe eblit-$1-post
+}
+
+src_unpack()    { eblit-run src_unpack    ; }
+src_prepare()   { eblit-run src_prepare   ; }
+src_configure() { eblit-run src_configure ; }
+src_compile()   { eblit-run src_compile   ; }
+src_test()      { eblit-run src_test      ; }
+src_install()   { eblit-run src_install   ; }
+
+# FILESDIR might not be available during binpkg install
+for x in pretend setup {pre,post}inst ; do
+       e="${FILESDIR}/eblits/pkg_${x}.eblit"
+       if [[ -e ${e} ]] ; then
+               . "${e}"
+               eval "pkg_${x}() { eblit-run pkg_${x} ; }"
+       fi
+done
+
+eblit-src_unpack-pre() {
+       [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack 
gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+}
+
+eblit-src_prepare-post() {
+       cd "${S}"
+
+       epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch 
#503838
+
+       if use hardened ; then
+               einfo "Patching to get working PIE binaries on PIE (hardened) 
platforms"
+               gcc-specs-pie && epatch 
"${FILESDIR}"/2.17/glibc-2.17-hardened-pie.patch
+               epatch 
"${FILESDIR}"/2.20/glibc-2.20-hardened-inittls-nosysenter.patch
+
+               # We don't enable these for non-hardened as the output is very 
terse --
+               # it only states that a crash happened.  The default upstream 
behavior
+               # includes backtraces and symbols.
+               einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE 
handler"
+               cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c 
debug/stack_chk_fail.c || die
+               cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-chk_fail.c 
debug/chk_fail.c || die
+
+               if use debug ; then
+                       # Allow SIGABRT to dump core on non-hardened systems, 
or when debug is requested.
+                       sed -i \
+                               -e '/^CFLAGS-backtrace.c/ 
iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+                               -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c 
= -DSSP_SMASH_DUMPS_CORE' \
+                               debug/Makefile || die
+               fi
+
+               # Build various bits with ssp-all
+               sed -i \
+                       -e 's:-fstack-protector$:-fstack-protector-all:' \
+                       */Makefile || die
+       fi
+
+       case $(gcc-fullversion) in
+       4.8.[0-3]|4.9.0)
+               eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] 
and gcc-4.9.0 miscompile"
+               eerror "glibc.  See https://bugs.gentoo.org/547420 for details."
+               die "need to switch compilers #547420"
+               ;;
+       esac
+}

Reply via email to