diff options
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/glibc/ChangeLog | 12 | ||||
-rw-r--r-- | sys-libs/glibc/files/digest-glibc-2.7-r1 | 12 | ||||
-rw-r--r-- | sys-libs/glibc/files/eblits/src_install.eblit | 16 | ||||
-rw-r--r-- | sys-libs/glibc/glibc-2.7-r1.ebuild | 327 |
4 files changed, 361 insertions, 6 deletions
diff --git a/sys-libs/glibc/ChangeLog b/sys-libs/glibc/ChangeLog index 3a44244fc6c4..d927de30e9f1 100644 --- a/sys-libs/glibc/ChangeLog +++ b/sys-libs/glibc/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sys-libs/glibc # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.565 2007/11/18 03:49:31 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.566 2007/12/10 01:29:35 vapier Exp $ + +*glibc-2.7-r1 (10 Dec 2007) + + 10 Dec 2007; Mike Frysinger <vapier@gentoo.org> + files/eblits/src_install.eblit, +glibc-2.7-r1.ebuild: + Add fixes for #196926 (build failure with USE=glibc-omitfp), #201646 (double + free on sscanf("", "%as")), #199479 (build failure for i586-* targets due to + duplicate _chk defs), #198949 (static link failure when using + pthread_cond_timedwait), #196933 (build failure on hppa), and #196031 (gdb + debugging errors with pthreads). 18 Nov 2007; Mike Frysinger <vapier@gentoo.org> files/eblits/src_compile.eblit, glibc-2.6.1.ebuild, glibc-2.7.ebuild: diff --git a/sys-libs/glibc/files/digest-glibc-2.7-r1 b/sys-libs/glibc/files/digest-glibc-2.7-r1 new file mode 100644 index 000000000000..d6fe7544f645 --- /dev/null +++ b/sys-libs/glibc/files/digest-glibc-2.7-r1 @@ -0,0 +1,12 @@ +MD5 372b1e61dd03676e1dbb956d93bd9406 glibc-2.7-patches-1.3.tar.bz2 89433 +RMD160 a06dc7512f5879f551d4a8d02b760f89cbeeb50f glibc-2.7-patches-1.3.tar.bz2 89433 +SHA256 bcc9ba1ee8993eb71493f6f37d5f044ac7ef8f3afa22dbfa7d4058fe2915eb00 glibc-2.7-patches-1.3.tar.bz2 89433 +MD5 065c5952b439deba40083ccd67bcc8f7 glibc-2.7.tar.bz2 15976860 +RMD160 c5c0b5a611d26956c46a289478b3349cea2ebf72 glibc-2.7.tar.bz2 15976860 +SHA256 4224a522ac4ee0fd89eb337e7505e280dfb05e2fe1ad44339ba8874081c0451a glibc-2.7.tar.bz2 15976860 +MD5 226809992fb1f3dc6ea23e0f26952ea4 glibc-libidn-2.7.tar.bz2 101939 +RMD160 17a9692cc59d9f41d6b9fcd68f283f401e206483 glibc-libidn-2.7.tar.bz2 101939 +SHA256 07de78810a5320d696792b67131c4cf3d6654aee015a6b74820d66fb00799000 glibc-libidn-2.7.tar.bz2 101939 +MD5 eaeb8527b8fa286c2d887157214f9998 glibc-ports-2.7.tar.bz2 435392 +RMD160 b9b96b357a394f29d5617aaa26a2c000bcf88874 glibc-ports-2.7.tar.bz2 435392 +SHA256 3e481996259af87c3581da23481970a27de679e3c87cfa9a5a59751cd20c7b44 glibc-ports-2.7.tar.bz2 435392 diff --git a/sys-libs/glibc/files/eblits/src_install.eblit b/sys-libs/glibc/files/eblits/src_install.eblit index e160cde3d12c..ce01e44e07cb 100644 --- a/sys-libs/glibc/files/eblits/src_install.eblit +++ b/sys-libs/glibc/files/eblits/src_install.eblit @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install.eblit,v 1.3 2007/08/08 23:23:24 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install.eblit,v 1.4 2007/12/10 01:29:36 vapier Exp $ toolchain-glibc_src_install() { # These should not be set, else the @@ -200,14 +200,20 @@ toolchain-glibc_headers_install() { } src_strip() { - # Now, strip everything but the thread libs #46186, as well as the dynamic - # linker, else we cannot set breakpoints in shared libraries due to bugs in - # gdb. Also want to grab stuff in tls subdir. whee. + # gdb is lame and requires some debugging information to remain in + # libpthread, so we need to strip it by hand. libthread_db makes no + # sense stripped as it is only used when debugging. + local pthread=$(hasq splitdebug ${FEATURES} && echo "libthread_db" || echo "lib{pthread,thread_db}") env \ -uRESTRICT \ CHOST=${CTARGET} \ - STRIP_MASK="/*/{,tls/}libthread_db*" \ + STRIP_MASK="/*/{,tls/}${pthread}*" \ prepallstrip + # if user has stripping enabled and does not have split debug turned on, + # then leave the debugging sections in libpthread. + if ! hasq nostrip ${FEATURES} && ! hasq splitdebug ${FEATURES} ; then + ${STRIP:-${CTARGET}-strip} --strip-debug "${D}"/*/libpthread-*.so + fi } eblit-glibc-src_install() { diff --git a/sys-libs/glibc/glibc-2.7-r1.ebuild b/sys-libs/glibc/glibc-2.7-r1.ebuild new file mode 100644 index 000000000000..baf4a3d70714 --- /dev/null +++ b/sys-libs/glibc/glibc-2.7-r1.ebuild @@ -0,0 +1,327 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.7-r1.ebuild,v 1.1 2007/12/10 01:29:35 vapier Exp $ + +inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib + +DESCRIPTION="GNU libc6 (also called glibc2) C library" +HOMEPAGE="http://www.gnu.org/software/libc/libc.html" + +LICENSE="LGPL-2" +KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sh ~x86" +RESTRICT="strip" # strip ourself #46186 +EMULTILIB_PKG="true" + +# Configuration variables +RELEASE_VER=$(get_version_component_range 1-3) # major glibc version +BRANCH_UPDATE=$(get_version_component_range 4) # upstream cvs snaps +MANPAGE_VER="" # pregenerated manpages +INFOPAGE_VER="" # pregenerated infopages +PATCH_VER="1.3" # Gentoo patchset +PATCH_GLIBC_VER=${RELEASE_VER} # glibc version in patchset +PORTS_VER=${RELEASE_VER} # version of glibc ports addon +LT_VER="" # version of linuxthreads addon +NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires +#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires + +[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER:-2.6.20} + +IUSE="debug gd glibc-omitfp glibc-compat20 hardened multilib nls selinux profile vanilla ${LT_VER:+glibc-compat20 nptl nptlonly}" +S=${WORKDIR}/glibc-${RELEASE_VER} + +# 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-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi + +is_crosscompile() { + [[ ${CHOST} != ${CTARGET} ]] +} +alt_libdir() { + if is_crosscompile ; then + echo /usr/${CTARGET}/$(get_libdir) + else + echo /$(get_libdir) + fi +} + +if is_crosscompile ; then + SLOT="${CTARGET}-2.2" +else + # Why SLOT 2.2 you ask yourself while sippin your tea ? + # Everyone knows 2.2 > 0, duh. + SLOT="2.2" + PROVIDE="virtual/libc" +fi + +# General: We need a new-enough binutils for as-needed +# arch: we need to make sure our binutils/gcc supports TLS +DEPEND=">=sys-devel/gcc-3.4.4 + arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 ) + ppc? ( >=sys-devel/gcc-4.1.0 ) + ppc64? ( >=sys-devel/gcc-4.1.0 ) + >=sys-devel/binutils-2.15.94 + ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)} + || ( >=sys-devel/gcc-config-1.3.12 app-admin/eselect-compiler ) + >=app-misc/pax-utils-0.1.10 + virtual/os-headers + nls? ( sys-devel/gettext ) + >=sys-apps/sandbox-1.2.18.1-r2 + >=sys-apps/portage-2.1.2 + selinux? ( sys-libs/libselinux )" +RDEPEND="nls? ( sys-devel/gettext ) + selinux? ( sys-libs/libselinux )" + +if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + DEPEND="${DEPEND} ${CATEGORY}/gcc" + [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers" +else + DEPEND="${DEPEND} >=sys-libs/timezone-data-2007c" + RDEPEND="${RDEPEND} sys-libs/timezone-data" +fi + +SRC_URI=$( + upstream_uris() { + echo mirror://gnu/glibc/$1 ftp://sources.redhat.com/pub/glibc/{releases,snapshots}/$1 + } + gentoo_uris() { + local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI" + devspace=${devspace//HTTP/http://dev.gentoo.org/} + echo mirror://gentoo/$1 ${devspace//URI/$1} + } + + upstream_uris glibc-${RELEASE_VER}.tar.bz2 + upstream_uris glibc-libidn-${RELEASE_VER}.tar.bz2 + + [[ -n ${PORTS_VER} ]] && upstream_uris glibc-ports-${PORTS_VER}.tar.bz2 + [[ -n ${LT_VER} ]] && upstream_uris glibc-linuxthreads-${LT_VER}.tar.bz2 + [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2 + [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${PATCH_GLIBC_VER}-patches-${PATCH_VER}.tar.bz2 + [[ -n ${MANPAGE_VER} ]] && gentoo_uris glibc-manpages-${MANPAGE_VER}.tar.bz2 + [[ -n ${INFOPAGE_VER} ]] && gentoo_uris glibc-infopages-${INFOPAGE_VER}.tar.bz2 +) + +# eblit-include [--skip] <function> [version] +eblit-include() { + local skipable=false + [[ $1 == "--skip" ]] && skipable=true && shift + + 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 || die + eblit-run-maybe eblit-$1-post +} + +src_unpack() { eblit-run src_unpack ; } +src_compile() { eblit-run src_compile ; } +src_test() { eblit-run src_test ; } +src_install() { eblit-run src_install ; } + +eblit-src_unpack-post() { + if use hardened ; then + cd "${S}" + einfo "Patching to get working PIE binaries on PIE (hardened) platforms" + gcc-specs-pie && epatch "${FILESDIR}"/2.5/glibc-2.5-hardened-pie.patch + epatch "${FILESDIR}"/2.5/glibc-2.5-hardened-configure-picdefault.patch + epatch "${FILESDIR}"/2.7/glibc-2.7-hardened-inittls-nosysenter.patch + + einfo "Installing Hardened Gentoo SSP handler" + cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \ + debug/stack_chk_fail.c || die + + if use debug ; then + # When using Hardened Gentoo stack handler, have smashes dump core for + # analysis - debug only, as core could be an information leak + # (paranoia). + sed -i \ + -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \ + debug/Makefile \ + || die "Failed to modify debug/Makefile for debug stack handler" + fi + + # Build nscd with ssp-all + sed -i \ + -e 's:-fstack-protector$:-fstack-protector-all:' \ + nscd/Makefile \ + || die "Failed to ensure nscd builds with ssp-all" + fi +} + +pkg_setup() { + # prevent native builds from downgrading ... maybe update to allow people + # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2) + if [[ ${ROOT} != "/" ]] && ! tc-is-cross-compiler ; then + if has_version '>'${CATEGORY}/${PF} ; then + eerror "Sanity check to keep you from breaking your system:" + eerror " Downgrading glibc is not supported and a sure way to destruction" + die "aborting to save your system" + fi + fi + + # users have had a chance to phase themselves, time to give em the boot + if [[ -e ${ROOT}/etc/locale.gen ]] && [[ -e ${ROOT}/etc/locales.build ]] ; then + eerror "You still haven't deleted ${ROOT}/etc/locales.build." + eerror "Do so now after making sure ${ROOT}/etc/locale.gen is kosher." + die "lazy upgrader detected" + fi + + if [[ ${CTARGET} == i386-* ]] ; then + eerror "i386 CHOSTs are no longer supported." + eerror "Chances are you don't actually want/need i386." + eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml" + die "please fix your CHOST" + fi + + if [[ -n ${LT_VER} ]] ; then + if use nptlonly && ! use nptl ; then + eerror "If you want nptlonly, add nptl to your USE too ;p" + die "nptlonly without nptl" + fi + 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, which is probably not what you want." + fi + + use hardened && ! gcc-specs-pie && \ + ewarn "PIE hardening not applied, as your compiler doesn't default to PIE" +} + +fix_lib64_symlinks() { + # the original Gentoo/AMD64 devs decided that since 64bit is the native + # bitdepth for AMD64, lib should be used for 64bit libraries. however, + # this ignores the FHS and breaks multilib horribly... especially + # since it wont even work without a lib64 symlink anyways. *rolls eyes* + # see bug 59710 for more information. + # Travis Tilley <lv@gentoo.org> (08 Aug 2004) + if [ -L ${ROOT}/lib64 ] ; then + ewarn "removing /lib64 symlink and moving lib to lib64..." + ewarn "dont hit ctrl-c until this is done" + rm ${ROOT}/lib64 + # now that lib64 is gone, nothing will run without calling ld.so + # directly. luckily the window of brokenness is almost non-existant + use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64 + use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64 + # all better :) + ldconfig + ln -s lib64 ${ROOT}/lib + einfo "done! :-)" + einfo "fixed broken lib64/lib symlink in ${ROOT}" + fi + if [ -L ${ROOT}/usr/lib64 ] ; then + rm ${ROOT}/usr/lib64 + mv ${ROOT}/usr/lib ${ROOT}/usr/lib64 + ln -s lib64 ${ROOT}/usr/lib + einfo "fixed broken lib64/lib symlink in ${ROOT}/usr" + fi + if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then + rm ${ROOT}/usr/X11R6/lib64 + mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64 + ln -s lib64 ${ROOT}/usr/X11R6/lib + einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6" + fi +} + +pkg_preinst() { + # PPC64+others may want to eventually be added to this logic if they + # decide to be multilib compatible and FHS compliant. note that this + # chunk of FHS compliance only applies to 64bit archs where 32bit + # compatibility is a major concern (not IA64, for example). + + # amd64's 2005.0 is the first amd64 profile to not need this code. + # 2005.0 is setup properly, and this is executed as part of the + # 2004.3 -> 2005.0 upgrade script. + # It can be removed after 2004.3 has been purged from portage. + { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks + + # it appears that /lib/tls is sometimes not removed. See bug + # 69258 for more info. + if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && [[ ! -d ${D}/$(alt_libdir)/tls ]] ; then + ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..." + rm -r "${ROOT}"/$(alt_libdir)/tls || die + fi + + # Shouldnt need to keep this updated + [[ -e ${ROOT}/etc/locale.gen ]] && rm -f "${D}"/etc/locale.gen + + # simple test to make sure our new glibc isnt completely broken. + # make sure we don't test with statically built binaries since + # they will fail. also, skip if this glibc is a cross compiler. + [[ ${ROOT} != "/" ]] && return 0 + [[ -d ${D}/$(get_libdir) ]] || return 0 + local x striptest + for x in date env ls true uname ; do + x=$(type -p ${x}) + [[ -z ${x} ]] && continue + striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) + [[ -z ${striptest} ]] && continue + [[ ${striptest} == *"statically linked"* ]] && continue + "${D}"/$(get_libdir)/ld-*.so \ + --library-path "${D}"/$(get_libdir) \ + ${x} > /dev/null \ + || die "simple run test (${x}) failed" + done +} + +pkg_postinst() { + if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then + # Generate fastloading iconv module configuration file. + "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}" + fi + + if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then + # Reload init ... + /sbin/telinit U + + # if the host locales.gen contains no entries, we'll install everything + local locale_list="${ROOT}etc/locale.gen" + if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then + ewarn "Generating all locales; edit /etc/locale.gen to save time/space" + locale_list="${ROOT}usr/share/i18n/SUPPORTED" + fi + local x jobs + for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done + locale-gen -j ${jobs:-1} --config "${locale_list}" + fi +} |