Skip to content

Commit

Permalink
sys-libs/glibc: version bump to 2.24
Browse files Browse the repository at this point in the history
  • Loading branch information
vapier committed Nov 12, 2016
1 parent bd78000 commit 673e8aa
Show file tree
Hide file tree
Showing 2 changed files with 203 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sys-libs/glibc/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ DIST glibc-2.22.tar.xz 12969072 SHA256 eb731406903befef1d8f878a46be75ef862b9056a
DIST glibc-2.23-patches-4.tar.bz2 230533 SHA256 5b64a9b30778be79fac8a8c7e2ec7ebb077e136c85d79996ae3d725189d236a4 SHA512 af140a13bbc28070bfec26e041ce562b1cc091d312a82f385becb3ab87ee882d8ea10ac4ec6dcf86f154857527a3383782d46141016047338cebc7c393329cf3 WHIRLPOOL ca7be788c64428bd2bd6e41eee5345ff85dc9ee0987af55f60104a9f03e3019b8fa6a933ba785d3b1b27540c2485160d50499049985271227c07b094db649de3
DIST glibc-2.23-patches-5.tar.bz2 310755 SHA256 d7678f15e3a11034023efb3254760b3871d4190c5e6712f137b810ffdf939f67 SHA512 9afb8210c84562921f31c8538b9b31b4afa71b0598ac3142d049b392753da3ff548a1662791740a721e1712e310892bc94e15bd08ffd2121a5fe9909431547f6 WHIRLPOOL b5d2cfc65b6a5f28b2127da8edac1f5135d028246d22bc9f7724e182f7fd83b84e1262c4883b130829aed10478ce87137da7bc437769e863fb65caa20aa6314f
DIST glibc-2.23.tar.xz 13455260 SHA256 94efeb00e4603c8546209cefb3e1a50a5315c86fa9b078b6fad758e187ce13e9 SHA512 b82953388cd028e174cb08f082557bbce0dad8b67b17d31b29f90102fd52a51e03d591448ecb64882a1c1d5303afffc7f6ede85cee4c784a9284fbc9b4ad26cf WHIRLPOOL 7c7e3bf55a89a04bac917b9ca5a1cbb1613f22c427d2766f114b5a36f9635856005b823852ef5d3b73462b577fe4e5865e68e7b64633d48a95fa1e5eaa831a71
DIST glibc-2.24-patches-1.tar.bz2 49479 SHA256 1fa783ea31505dfe6a42d0f5da3efc25eecaead9cd3740a2c2c4b688290f03c8 SHA512 387c264ee1c503bcf3636e3315177f2557f2aadc444fc5be986a702b2eaf04433a5f12e28f3d693d27cd184aaf6e936917a25ef99a2aaaba3e5f497114894424 WHIRLPOOL 860199fd8d69f5ea36fb736240bec42a9e92e46651b830a68ff3ff3a3c758f6edf12bd71ac23f40f39295e5ae1b14decc56b2c6ed8f035ac18bb0c4590feec14
DIST glibc-2.24.tar.xz 13554048 SHA256 99d4a3e8efd144d71488e478f62587578c0f4e1fa0b4eed47ee3d4975ebeb5d3 SHA512 a4cb28a2c51a0cc029ed69da7cba11931a615ba897235590b4f7fad2eaabec9042f8250eaac2a5860997437a69ab13304f10a634000e52c0336b5593b7969adb WHIRLPOOL be82b47fc73f7e780e8e73a5f58b313d8e861d5ea8c4320f95ef0d8c1e125ff011d61dcfc0380be0e83868bd8c3299de1ea662da7fc8d709050e89b2c126e3eb
201 changes: 201 additions & 0 deletions sys-libs/glibc/glibc-2.24.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

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="1" # Gentoo patchset
: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires

IUSE="audit caps debug gd hardened multilib nscd +rpc 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.
COMMON_DEPEND="
nscd? ( selinux? (
audit? ( sys-process/audit )
caps? ( sys-libs/libcap )
) )
suid? ( caps? ( sys-libs/libcap ) )
selinux? ( sys-libs/libselinux )
"
DEPEND="${COMMON_DEPEND}
>=app-misc/pax-utils-0.1.10
!<sys-apps/sandbox-1.6
!<sys-apps/portage-2.1.2"
RDEPEND="${COMMON_DEPEND}
!sys-kernel/ps3-sources
sys-apps/gentoo-functions
!sys-libs/nss-db"

if [[ ${CATEGORY} == cross-* ]] ; then
DEPEND+=" !crosscompile_opts_headers-only? (
>=${CATEGORY}/binutils-2.24
>=${CATEGORY}/gcc-4.7
)"
[[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
else
DEPEND+="
>=sys-devel/binutils-2.24
>=sys-devel/gcc-4.7
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
# 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
}

0 comments on commit 673e8aa

Please sign in to comment.