summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Le <r0bertz@gentoo.org>2011-03-06 03:03:14 +0800
committerZhang Le <r0bertz@gentoo.org>2011-03-06 03:03:14 +0800
commite0ffb19d62916ec1706f6409f725d279ef83f287 (patch)
treeab89c450e4890a620fc17c92820b53be29ee19fb
parentfixed xulrunner's Manifest (diff)
downloadloongson-e0ffb19d62916ec1706f6409f725d279ef83f287.tar.gz
loongson-e0ffb19d62916ec1706f6409f725d279ef83f287.tar.bz2
loongson-e0ffb19d62916ec1706f6409f725d279ef83f287.zip
updated glibc to 2.12.2, removed 2.11.2, sync eblit with portage
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
-rw-r--r--sys-libs/glibc/files/2.12/glibc-2.12-hardened-pie.patch39
-rw-r--r--sys-libs/glibc/files/eblits/common.eblit19
-rw-r--r--sys-libs/glibc/files/eblits/pkg_preinst.eblit17
-rw-r--r--sys-libs/glibc/files/eblits/src_compile.eblit32
-rw-r--r--sys-libs/glibc/files/eblits/src_install-2.6.eblit250
-rw-r--r--sys-libs/glibc/files/eblits/src_install.eblit21
-rw-r--r--sys-libs/glibc/files/eblits/src_test.eblit8
-rw-r--r--sys-libs/glibc/glibc-2.12.2.ebuild (renamed from sys-libs/glibc/glibc-2.11.2.ebuild)34
8 files changed, 112 insertions, 308 deletions
diff --git a/sys-libs/glibc/files/2.12/glibc-2.12-hardened-pie.patch b/sys-libs/glibc/files/2.12/glibc-2.12-hardened-pie.patch
new file mode 100644
index 0000000..3315171
--- /dev/null
+++ b/sys-libs/glibc/files/2.12/glibc-2.12-hardened-pie.patch
@@ -0,0 +1,39 @@
+2010-08-11 Magnus Granberg <zorry@ume.nu>
+
+ #332331
+ * Makeconfig (+link): Set to +link-pie.
+ (+link-static): Change $(static-start-installed-name) to
+ S$(static-start-installed-name).
+ (+prector): Set to +prectorS.
+ (+postctor): Set to +postctorS.
+
+--- libc/Makeconfig
++++ libc/Makeconfig
+@@ -447,11 +447,12 @@
+ $(common-objpfx)libc% $(+postinit),$^) \
+ $(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit)
+ endif
+++link = $(+link-pie)
+ # Command for statically linking programs with the C library.
+ ifndef +link-static
+ +link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
+ $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+- $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
++ $(addprefix $(csu-objpfx),S$(static-start-installed-name)) \
+ $(+preinit) $(+prector) \
+ $(filter-out $(addprefix $(csu-objpfx),start.o \
+ $(start-installed-name))\
+@@ -549,11 +550,10 @@
+ ifeq ($(elf),yes)
+ +preinit = $(addprefix $(csu-objpfx),crti.o)
+ +postinit = $(addprefix $(csu-objpfx),crtn.o)
+-+prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o`
+-+postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
+-# Variants of the two previous definitions for linking PIE programs.
+ +prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
+ +postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
+++prector = $(+prectorS)
+++postctor = $(+postctorS)
+ +interp = $(addprefix $(elf-objpfx),interp.os)
+ endif
+ csu-objpfx = $(common-objpfx)csu/
diff --git a/sys-libs/glibc/files/eblits/common.eblit b/sys-libs/glibc/files/eblits/common.eblit
index 2b7672b..f7bf7ae 100644
--- a/sys-libs/glibc/files/eblits/common.eblit
+++ b/sys-libs/glibc/files/eblits/common.eblit
@@ -1,6 +1,6 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v 1.9 2009/01/28 18:11:41 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v 1.12 2010/09/30 06:29:21 vapier Exp $
# We need to be able to set alternative headers for
# compiling for non-native platform
@@ -169,8 +169,8 @@ setup_flags() {
# building glibc with SSP is fraught with difficulty, especially
# due to __stack_chk_fail_local which would mean significant changes
- # to the glibc build process. See bug #94325
- filter-flags -fstack-protector
+ # to the glibc build process. See bug #94325 #293721
+ use hardened && gcc-specs-ssp && append-cflags $(test-flags-CC -fno-stack-protector)
if use hardened && gcc-specs-pie ; then
# Force PIC macro definition for all compilations since they're all
@@ -251,6 +251,17 @@ use_multilib() {
esac
}
+use_multiarch() {
+ # Make sure binutils is new enough to support indirect functions #336792
+ local bver=$($(tc-getLD ${CTARGET}) -v | awk '{print $NF}') nver
+ case $(tc-arch ${CTARGET}) in
+ amd64|x86) nver="2.20" ;;
+ sparc) nver="2.21" ;;
+ *) return 1 ;;
+ esac
+ version_is_at_least ${nver} ${bver}
+}
+
# Setup toolchain variables that would be defined in the profiles for these archs.
setup_env() {
# silly users
diff --git a/sys-libs/glibc/files/eblits/pkg_preinst.eblit b/sys-libs/glibc/files/eblits/pkg_preinst.eblit
index c161640..dcde615 100644
--- a/sys-libs/glibc/files/eblits/pkg_preinst.eblit
+++ b/sys-libs/glibc/files/eblits/pkg_preinst.eblit
@@ -1,6 +1,6 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit,v 1.2 2009/12/19 23:44:54 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit,v 1.3 2010/10/08 15:33:13 flameeyes Exp $
fix_lib64_symlinks() {
# the original Gentoo/AMD64 devs decided that since 64bit is the native
@@ -75,9 +75,16 @@ eblit-glibc-pkg_preinst() {
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 \
+ # we enter ${D} so to avoid trouble if the path contains
+ # special characters; for instance if the path contains the
+ # colon character (:), then the linker will try to split it
+ # and look for the libraries in an unexpected place. This can
+ # lead to unsafe code execution if the generated prefix is
+ # within a world-writable directory
+ # (e.g. /var/tmp/portage:${HOSTNAME})
+ pushd "${D}"/$(get_libdir) 2>/dev/null
+ ./ld-*.so --library-path . ${x} > /dev/null \
|| die "simple run test (${x}) failed"
+ popd 2>/dev/null
done
}
diff --git a/sys-libs/glibc/files/eblits/src_compile.eblit b/sys-libs/glibc/files/eblits/src_compile.eblit
index 9fe9dc9..c19fecd 100644
--- a/sys-libs/glibc/files/eblits/src_compile.eblit
+++ b/sys-libs/glibc/files/eblits/src_compile.eblit
@@ -1,10 +1,12 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_compile.eblit,v 1.10 2009/11/06 00:33:03 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_compile.eblit,v 1.16 2010/11/10 21:51:18 vapier Exp $
glibc_do_configure() {
local myconf
+ einfo "Configuring GLIBC for $1"
+
# set addons
pushd "${S}" > /dev/null
local ADDONS=$(echo */configure | sed \
@@ -83,18 +85,17 @@ glibc_do_configure() {
--mandir=/usr/share/man
--infodir=/usr/share/info
--libexecdir=/usr/$(get_libdir)/misc/glibc
+ $(use_multiarch || echo --disable-multi-arch)
${EXTRA_ECONF}"
# There is no configure option for this and we need to export it
# since the glibc build will re-run configure on itself
export libc_cv_slibdir=/$(get_libdir)
- has_version app-admin/eselect-compiler || export CC=$(tc-getCC ${CTARGET})
-
local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
mkdir -p "${GBUILDDIR}"
cd "${GBUILDDIR}"
- einfo "Configuring GLIBC for $1 with: ${myconf// /\n\t\t}"
+ echo "${S}"/configure ${myconf}
"${S}"/configure ${myconf} || die "failed to configure glibc"
# since we'll be punting them for cross-compilers, and they can cause
@@ -108,19 +109,19 @@ toolchain-glibc_src_compile() {
for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
einfo " $(printf '%15s' ${v}:) ${!v}"
done
+ export CC=$(tc-getCC ${CTARGET})
+ einfo " $(printf '%15s' 'Manual CC:') ${CC}"
echo
if want_linuxthreads ; then
glibc_do_configure linuxthreads
- einfo "Building GLIBC with linuxthreads..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
+ emake || die "make for ${ABI} failed"
fi
if want_nptl ; then
# ... and then do the optional nptl build
unset LD_ASSUME_KERNEL
glibc_do_configure nptl
- einfo "Building GLIBC with NPTL..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
+ emake || die "make for ${ABI} failed"
fi
}
@@ -133,6 +134,7 @@ toolchain-glibc_headers_compile() {
# hopefully they don't affect header geneation, so let's hope for
# the best here ...
export \
+ ac_cv_header_cpuid_h=yes \
libc_cv_386_tls=yes \
libc_cv_asm_cfi_directives=yes \
libc_cv_broken_visibility_attribute=no \
@@ -140,6 +142,7 @@ toolchain-glibc_headers_compile() {
libc_cv_mlong_double_128=yes \
libc_cv_mlong_double_128ibm=yes \
libc_cv_ppc_machine=yes \
+ libc_cv_ppc_rel16=yes \
libc_cv_visibility_attribute=yes \
libc_cv_z_combreloc=yes \
libc_cv_z_execstack=yes \
@@ -147,17 +150,6 @@ toolchain-glibc_headers_compile() {
libc_cv_z_nodelete=yes \
libc_cv_z_nodlopen=yes \
libc_cv_z_relro=yes
- libc_cv_mips_tls=yes
-
- if [[ ${CTARGET} == "mips64el-unknown-linux-gnu" ]] ; then
- # remove "-n32" gcc switch, since gcc for other arch don't have this
- sed -i 's/-mabi=$mips_config_abi//g' "${S}"/ports/sysdeps/mips/preconfigure
- sed -i 's/CC/CFLAGS/' "${S}"/ports/sysdeps/mips/mips64/n32/Makefile
- sed -i 's/CC/CFLAGS/' "${S}"/ports/sysdeps/mips/mips64/n64/Makefile
- # fix stdio_lim.h missing problem
- # if you are building a n64 system, you may need to replace 32 with 64
- sed -i 's/_MIPS_SZPTR/32/' "${S}"/ports/sysdeps/mips/bits/wordsize.h
- fi
# Pick out the correct location for build headers
local ports="" myconf="--disable-sanity-checks --enable-hacker-mode"
diff --git a/sys-libs/glibc/files/eblits/src_install-2.6.eblit b/sys-libs/glibc/files/eblits/src_install-2.6.eblit
deleted file mode 100644
index 15bbf31..0000000
--- a/sys-libs/glibc/files/eblits/src_install-2.6.eblit
+++ /dev/null
@@ -1,250 +0,0 @@
-# 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-2.6.eblit,v 1.2 2008/06/29 16:39:23 vapier Exp $
-
-toolchain-glibc_src_install() {
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- local GBUILDDIR
- if want_linuxthreads ; then
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
- else
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
- fi
-
- local install_root=${D}
- is_crosscompile && install_root="${install_root}/usr/${CTARGET}"
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Installing GLIBC ${ABI} with linuxthreads ..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- install || die
- else # nptlonly
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- einfo "Installing GLIBC ${ABI} with NPTL ..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- install || die
- fi
-
- if is_crosscompile ; then
- # punt all the junk not needed by a cross-compiler
- cd "${D}"/usr/${CTARGET} || die
- rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
- fi
-
- if want_linuxthreads && want_nptl ; then
- einfo "Installing NPTL to $(alt_libdir)/tls/..."
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
-
- local l src_lib
- for l in libc libm librt libpthread libthread_db ; do
- # take care of shared lib first ...
- l=${l}.so
- if [[ -e ${l} ]] ; then
- src_lib=${l}
- else
- src_lib=$(eval echo */${l})
- fi
- cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
- fperms a+rx $(alt_libdir)/tls/${l}
- dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
-
- # then grab the linker script or the symlink ...
- if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
- dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
- else
- sed \
- -e "s:/${l}:/tls/${l}:g" \
- -e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
- "${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
- fi
-
- # then grab the static lib ...
- src_lib=${src_lib/%.so/.a}
- [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- src_lib=${src_lib/%.a/_nonshared.a}
- if [[ -e ${src_lib} ]] ; then
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- fi
- done
-
- # use the nptl linker instead of the linuxthreads one as the linuxthreads
- # one may lack TLS support and that can be really bad for business
- cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
- fi
-
- # We'll take care of the cache ourselves
- rm -f "${D}"/etc/ld.so.cache
-
- # Some things want this, notably ash.
- dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
-
- # Handle includes for different ABIs
- prep_ml_includes $(alt_headers)
-
- # When cross-compiling for a non-multilib setup, make sure we have
- # lib and a proper symlink setup
- if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
- cd "${D}"$(alt_libdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- cd "${D}"$(alt_usrlibdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- fi
-
- #################################################################
- # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
- # Make sure we install some symlink hacks so that when we build
- # a 2nd stage cross-compiler, gcc finds the target system
- # headers correctly. See gcc/doc/gccinstall.info
- if is_crosscompile ; then
- dosym usr/include /usr/${CTARGET}/sys-include
- return 0
- fi
-
- # Everything past this point just needs to be done once ...
- is_final_abi || return 0
-
- # Make sure the non-native interp can be found on multilib systems
- if has_multilib_profile ; then
- case $(tc-arch) in
- amd64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
- dosym ../$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
- ;;
- ppc64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
- dosym ../$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
- ;;
- esac
- fi
-
- # Files for Debian-style locale updating
- dodir /usr/share/i18n
- sed \
- -e "/^#/d" \
- -e "/SUPPORTED-LOCALES=/d" \
- -e "s: \\\\::g" -e "s:/: :g" \
- "${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
- || die "generating /usr/share/i18n/SUPPORTED failed"
- cd "${WORKDIR}"/extra/locale
- dosbin locale-gen || die
- doman *.[0-8]
- insinto /etc
- doins locale.gen || die
-
- # Make sure all the ABI's can find the locales and so we only
- # have to generate one set
- local a
- keepdir /usr/$(get_libdir)/locale
- for a in $(get_install_abis) ; do
- if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
- dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
- fi
- done
-
- if ! has noinfo ${FEATURES} && [[ -n ${INFOPAGE_VER} ]] ; then
- einfo "Installing info pages..."
-
- make \
- -C "${GBUILDDIR}" \
- PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- info -i || die
- fi
-
- if [[ -n ${MANPAGE_VER} ]] ; then
- einfo "Installing man pages..."
-
- # Install linuxthreads man pages even if nptl is enabled
- cd "${WORKDIR}"/man
- doman *.3thr
- fi
-
- cd "${S}"
-
- # Install misc network config files
- insinto /etc
- doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf || die
- doins "${WORKDIR}"/extra/etc/*.conf || die
- doinitd "${WORKDIR}"/extra/etc/nscd || die
-
- dodoc BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README*
-
- # Prevent overwriting of the /etc/localtime symlink. We'll handle the
- # creation of the "factory" symlink in pkg_postinst().
- rm -f "${D}"/etc/localtime
-}
-
-toolchain-glibc_headers_install() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- cd "${GBUILDDIR}"
- make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
- # Copy over headers that are not part of install-headers ... these
- # are pretty much taken verbatim from crosstool, see it for more details
- insinto $(alt_headers)/bits
- doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
- insinto $(alt_headers)/gnu
- doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
- # Make sure we install the sys-include symlink so that when
- # we build a 2nd stage cross-compiler, gcc finds the target
- # system headers correctly. See gcc/doc/gccinstall.info
- dosym usr/include /usr/${CTARGET}/sys-include
-}
-
-src_strip() {
- # 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/}${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() {
- if just_headers ; then
- toolchain-glibc_headers_install
- return
- fi
-
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Installing multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- eblit-glibc-src_install
- done
- ABI=${OABI}
- unset OABI
- src_strip
- return 0
- fi
- fi
-
- toolchain-glibc_src_install
- [[ -z ${OABI} ]] && src_strip
-}
diff --git a/sys-libs/glibc/files/eblits/src_install.eblit b/sys-libs/glibc/files/eblits/src_install.eblit
index af3c2ac..b334b58 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
+# Copyright 1999-2011 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.8 2009/09/18 15:15:07 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install.eblit,v 1.11 2011/02/22 03:23:18 vapier Exp $
toolchain-glibc_src_install() {
local GBUILDDIR
@@ -19,9 +19,7 @@ toolchain-glibc_src_install() {
cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
einfo "Installing GLIBC ${ABI} with NPTL ..."
fi
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- install || die
+ emake install_root="${install_root}" install || die
if is_crosscompile ; then
# punt all the junk not needed by a cross-compiler
@@ -75,9 +73,6 @@ toolchain-glibc_src_install() {
# We'll take care of the cache ourselves
rm -f "${D}"/etc/ld.so.cache
- # Some things want this, notably ash.
- dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
-
# Handle includes for different ABIs if glibc itself doesn't do it
# XXX: curr glibc should finally handle all of them correctly
#case $(tc-arch) in
@@ -150,9 +145,8 @@ toolchain-glibc_src_install() {
if ! has noinfo ${FEATURES} && [[ -n ${INFOPAGE_VER} ]] ; then
einfo "Installing info pages..."
- make \
+ emake \
-C "${GBUILDDIR}" \
- PARALLELMFLAGS="${MAKEOPTS}" \
install_root="${install_root}" \
info -i || die
fi
@@ -188,7 +182,7 @@ toolchain-glibc_src_install() {
toolchain-glibc_headers_install() {
local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
cd "${GBUILDDIR}"
- make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
+ emake install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
# Copy over headers that are not part of install-headers ... these
# are pretty much taken verbatim from crosstool, see it for more details
insinto $(alt_headers)/bits
@@ -199,11 +193,6 @@ toolchain-glibc_headers_install() {
# we build a 2nd stage cross-compiler, gcc finds the target
# system headers correctly. See gcc/doc/gccinstall.info
dosym usr/include /usr/${CTARGET}/sys-include
- # restore wordsize.h
- if [[ ${CTARGET} == "mips64el-unknown-linux-gnu" ]] ; then
- sed -i 's/\(__WORDSIZE.\+\)\(32\|64\)$/\1_MIPS_SZPTR/' \
- "${D}"/$(alt_headers)/bits/wordsize.h || die "restore wordsize.h failed"
- fi
}
src_strip() {
diff --git a/sys-libs/glibc/files/eblits/src_test.eblit b/sys-libs/glibc/files/eblits/src_test.eblit
index 0d733a3..edcdac7 100644
--- a/sys-libs/glibc/files/eblits/src_test.eblit
+++ b/sys-libs/glibc/files/eblits/src_test.eblit
@@ -1,13 +1,13 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_test.eblit,v 1.3 2008/03/23 18:06:18 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_test.eblit,v 1.4 2010/08/10 08:08:05 vapier Exp $
toolchain-glibc_src_test() {
cd "${WORKDIR}"/build-${ABI}-${CTARGET}-$1 || die "cd build-${ABI}-${CTARGET}-$1"
unset LD_ASSUME_KERNEL
- make check && return 0
+ emake -j1 check && return 0
einfo "make check failed - re-running with --keep-going to get the rest of the results"
- make -k check
+ emake -j1 -k check
ewarn "make check failed for ${ABI}-${CTARGET}-$1"
return 1
}
diff --git a/sys-libs/glibc/glibc-2.11.2.ebuild b/sys-libs/glibc/glibc-2.12.2.ebuild
index 8e248a7..f4f2926 100644
--- a/sys-libs/glibc/glibc-2.11.2.ebuild
+++ b/sys-libs/glibc/glibc-2.12.2.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.11.2.ebuild,v 1.1 2010/06/08 05:00:41 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.12.2.ebuild,v 1.2 2011/03/02 02:37:10 vapier Exp $
inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
@@ -8,7 +8,7 @@ DESCRIPTION="GNU libc6 (also called glibc2) C library"
HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
LICENSE="LGPL-2"
-KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~mips"
+KEYWORDS="~amd64 ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
RESTRICT="strip" # strip ourself #46186
EMULTILIB_PKG="true"
@@ -25,8 +25,8 @@ fi
MANPAGE_VER="" # pregenerated manpages
INFOPAGE_VER="" # pregenerated infopages
LIBIDN_VER="" # it's integrated into the main tarball now
-PATCH_VER="1" # Gentoo patchset
-PORTS_VER=${RELEASE_VER%.?} # version of glibc ports addon
+PATCH_VER="2" # Gentoo patchset
+PORTS_VER="2.12.1" # 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
@@ -83,7 +83,7 @@ fi
DEPEND=">=sys-devel/gcc-3.4.4
arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
x86? ( >=sys-devel/gcc-4.3 )
- amd64? ( >=sys-devel/binutils-2.19 multilib? ( >=sys-devel/gcc-4.3 ) )
+ amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
ppc? ( >=sys-devel/gcc-4.1.0 )
ppc64? ( >=sys-devel/gcc-4.1.0 )
>=sys-devel/binutils-2.15.94
@@ -103,8 +103,10 @@ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
[[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
else
- DEPEND="${DEPEND} >=sys-libs/timezone-data-2007c"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
+ DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
+ RDEPEND="${RDEPEND}
+ vanilla? ( !sys-libs/timezone-data )
+ !vanilla? ( sys-libs/timezone-data )"
fi
SRC_URI=$(
@@ -183,11 +185,25 @@ for x in setup {pre,post}inst ; do
fi
done
+pkg_setup() {
+ eblit-run pkg_setup
+
+ # Static binary sanity check #332927
+ if [[ ${ROOT} == "/" ]] && \
+ has_version "<${CATEGORY}/${P}" && \
+ built_with_use sys-apps/coreutils static
+ then
+ eerror "Please rebuild coreutils with USE=-static, then install"
+ eerror "glibc, then you may rebuild coreutils with USE=static."
+ die "Avoiding system meltdown #332927"
+ fi
+}
+
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.11/glibc-2.11-hardened-pie.patch
+ gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch