# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI="5" inherit toolchain-glibc 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-r3 ;; *) RELEASE_VER=${PV} ;; esac GCC_BOOTSTRAP_VER="4.7.3-r1" # patches live at https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/ PATCH_VER="15" # Gentoo patchset : ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires GLIBC_PATCH_EXCLUDE+=" 0005_all_sys-types.h-drop-sys-sysmacros.h-include.patch" IUSE="audit caps debug gd hardened multilib nscd +rpc selinux systemtap profile suid vanilla 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 ) systemtap? ( dev-util/systemtap ) " DEPEND="${COMMON_DEPEND} >=app-misc/pax-utils-0.1.10 != 6 && ! memcmp (path + len - 6, "/lib64", 6)) \ # { \ # len -= 2; \ # # else if (len >= 7 \ # && ! memcmp (path + len - 7, "/libx32", 7)) \ # { \ # len -= 3; \ # # if (len >= 4 && ! memcmp (path + len - 4, "/lib", 4)) \ # { \ # memcpy (path + len, "64", 3); \ # add_dir (path); \ # memcpy (path + len, "x32", 4); \ sed -i \ -e "/ memcmp /{s:len >= 6 :len >= ${LD64l} : ; s: 6, \"/lib64\", 6): ${LD64l}, \"/${LD64:-lib64}\", ${LD64l}):}" \ -e "/len -= 2;/{s:len -= 2;:len -= ${#LD64s};:}" \ -e "/else if (len >= 7/{s:len >= 7:len >= ${LDx32l}:}" \ -e "/ memcmp /{s: 7, \"/libx32\", 7): ${LDx32l}, \"/${LDx32:-libx32}\", ${LDx32l}):}" \ -e "/len -= 3;/{s:len -= 3;:len -= ${#LDx32s};:}" \ -e "/ memcmp /{s:len >= 4 :len >= ${LD32l} : ; s: 4, \"/lib\", 4): ${LD32l}, \"/${LD32:-lib}\", ${LD32l}):}" \ -e "/memcpy /{s:len, \"64\", 3):len, \"${LD64s}\", $(( ${#LD64s} + 1 ))):}" \ -e "/memcpy /{s:len, \"x32\", 4):len, \"${LDx32s}\", $(( ${#LDx32s} + 1 ))):}" \ sysdeps/unix/sysv/linux/x86_64/dl-cache.h \ || die 'dl-cache.h modification failed' einfo "dl-cache.h now contains:" cat sysdeps/unix/sysv/linux/x86_64/dl-cache.h fi } src_install() { toolchain-glibc_src_install # toolchain-glibc.eclass runs prefixify_ro and a @PIDFILE@ substitution # on the included 'nscd', although it contains neither of the needed # template tokens. use nscd && newinitd "${FILESDIR}"/nscd.initd nscd }