diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/Manifest b/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/Manifest deleted file mode 100644 index 0e2ea7b753..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/Manifest +++ /dev/null @@ -1,2 +0,0 @@ -DIST binutils-2.23.1-patches-1.0.tar.xz 13396 SHA256 6d2ac4f83588e57968ce0e8e4450effb5aa79d46b9025ed2779cf91c8f99ec01 SHA512 f8a708798d32f81aceb3291411f7ef461a4f5b91ff204519799f3051789b1cbcac79bc282819227cf8dee875f47b727c51aba6f3a2ac73f53b132430c0fe9bdd WHIRLPOOL fbbcf9040047d5411ef002dd4e8079b6555b4ef2c079534f19ea8d105b2d62a8fce98eaf9b217d733414d0ddde1ab64b55d0c16bd142375a28187febde0c76eb -DIST binutils-2.23.1.tar.bz2 21455321 SHA256 2ab2e5b03e086d12c6295f831adad46b3e1410a3a234933a2e8fac66cb2e7a19 SHA512 effecc9e6ef943055815a83dea546f2fe5b5d4483dadeda5753aae239bd7095d4696239240613a051d18011ed2521ae75c48292f970ba82b02e97bc72b0fa51f WHIRLPOOL 48f99ba30f0f7085cd7d889b727ba615be3aceb9da6a836d676eecee65c16e36257110d84bfe82a739064741b6b5279f97e43c93a08ca90896a10474b4ea65e8 diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/binutils-2.22-r16.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/binutils-2.22-r16.ebuild deleted file mode 100644 index 00f4e97d21..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/binutils-2.22-r16.ebuild +++ /dev/null @@ -1,308 +0,0 @@ -# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. -# Distributed under the terms of the GNU General Public License v2 - -CROS_WORKON_COMMIT="9c1580ea72a5a3b15d90a9baf82c2f7707b793c4" -CROS_WORKON_TREE="2a7750a0cddd72df341d61250ade80d6270afbd7" -CROS_WORKON_PROJECT=chromiumos/third_party/binutils - -inherit eutils libtool flag-o-matic gnuconfig multilib versionator cros-workon - -KEYWORDS="amd64 arm x86" - -BVER=${PV} - -# Version names -if [[ "${PV}" == "9999" ]] ; then - BINUTILS_VERSION="binutils-2.22" -else - BINUTILS_VERSION="${P}" -fi - -BINUTILS_PKG_VERSION="${BINUTILS_VERSION}_cos_gg" - -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} == ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi - -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } - -DESCRIPTION="Tools necessary to build programs" -HOMEPAGE="http://sources.redhat.com/binutils/" -LICENSE="|| ( GPL-3 LGPL-3 )" -IUSE="hardened mounted_binutils multislot multitarget nls test vanilla" -if use multislot ; then - SLOT="${CTARGET}-${BVER}" -elif is_cross ; then - SLOT="${CTARGET}" -else - SLOT="0" -fi - -RDEPEND=">=sys-devel/binutils-config-1.9" -DEPEND="${RDEPEND} - test? ( dev-util/dejagnu ) - nls? ( sys-devel/gettext ) - sys-devel/flex" - -S_BINUTILS="${WORKDIR}/${BINUTILS_VERSION}" - -RESTRICT="fetch strip" - -MY_BUILDDIR_BINUTILS="${WORKDIR}/build" - -GITDIR=${WORKDIR}/gitdir - -LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER} -INCPATH=${LIBPATH}/include -DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER} -if is_cross ; then - BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER} -else - BINPATH=/usr/${CTARGET}/binutils-bin/${BVER} -fi - -src_unpack() { - if use mounted_binutils ; then - BINUTILS_DIR="/usr/local/toolchain_root/binutils" - if [[ ! -d ${BINUTILS_DIR} ]] ; then - die "binutils dirs not mounted at: ${BINUTILS_DIR}" - fi - else - cros-workon_src_unpack - mv "${S}" "${GITDIR}" - BINUTILS_DIR="${GITDIR}" - if [ -d "${GITDIR}/.git" ]; then - CL=$(cd "${BINUTILS_DIR}"; git log --pretty=format:%s -n1 | egrep -o '[0-9]+') - fi - fi - if [[ ! -z ${CL} ]] ; then - BINUTILS_PKG_VERSION="${BINUTILS_PKG_VERSION}_${CL}" - fi - ln -s ${BINUTILS_DIR} ${S_BINUTILS} - - mkdir -p "${MY_BUILDDIR_BINUTILS}" -} - - -src_compile() { - # keep things sane - strip-flags - - local x - echo - for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do - einfo "$(printf '%10s' ${x}:) ${!x}" - done - echo - - cd "${MY_BUILDDIR_BINUTILS}" - local myconf="" - is_cross && myconf="${myconf} --with-sysroot=/usr/${CTARGET}" - myconf="--prefix=/usr \ - --host=${CHOST} \ - --target=${CTARGET} \ - --datadir=${DATAPATH} \ - --infodir=${DATAPATH}/info \ - --mandir=${DATAPATH}/man \ - --bindir=${BINPATH} \ - --libdir=${LIBPATH} \ - --libexecdir=${LIBPATH} \ - --includedir=${INCPATH} \ - --enable-64-bit-bfd \ - --enable-gold \ - --enable-shared \ - --disable-werror \ - --enable-secureplt \ - --enable-plugins \ - --without-included-gettext \ - --build=${CBUILD} \ - --with-bugurl=http://code.google.com/p/chromium-os/issues/entry \ - ${myconf} ${EXTRA_ECONF}" - - binutils_conf="${myconf} --with-pkgversion=${BINUTILS_PKG_VERSION}" - - echo ./configure ${binutils_conf} - "${S_BINUTILS}"/configure ${binutils_conf} || die "configure failed" - - emake all || die "emake failed" - - # only build info pages if we user wants them, and if - # we have makeinfo (may not exist when we bootstrap) - if type -p makeinfo > /dev/null ; then - emake info || die "make info failed" - fi - # we nuke the manpages when we're left with junk - # (like when we bootstrap, no perl -> no manpages) - find . -name '*.1' -a -size 0 | xargs rm -f -} - -src_test() { - cd "${MY_BUILDDIR_BINUTILS}" - make check || die "check failed :(" -} - -src_install() { - local x d - - cd "${MY_BUILDDIR_BINUTILS}" - emake DESTDIR="${D}" tooldir="${LIBPATH}" install || die - rm -rf "${D}"/${LIBPATH}/bin - - # Newer versions of binutils get fancy with ${LIBPATH} #171905 - cd "${D}"/${LIBPATH} - for d in ../* ; do - [[ ${d} == ../${BVER} ]] && continue - mv ${d}/* . || die - rmdir ${d} || die - done - - # Now we collect everything intp the proper SLOT-ed dirs - # When something is built to cross-compile, it installs into - # /usr/$CHOST/ by default ... we have to 'fix' that :) - if is_cross ; then - cd "${D}"/${BINPATH} - for x in * ; do - mv ${x} ${x/${CTARGET}-} - done - - if [[ -d ${D}/usr/${CHOST}/${CTARGET} ]] ; then - mv "${D}"/usr/${CHOST}/${CTARGET}/include "${D}"/${INCPATH} - mv "${D}"/usr/${CHOST}/${CTARGET}/lib/* "${D}"/${LIBPATH}/ - rm -r "${D}"/usr/${CHOST}/{include,lib} - fi - fi - insinto ${INCPATH} - doins "${S_BINUTILS}/include/libiberty.h" - if [[ -d ${D}/${LIBPATH}/lib ]] ; then - mv "${D}"/${LIBPATH}/lib/* "${D}"/${LIBPATH}/ - rm -r "${D}"/${LIBPATH}/lib - fi - - # Now, some binutils are tricky and actually provide - # for multiple TARGETS. Really, we're talking just - # 32bit/64bit support (like mips/ppc/sparc). Here - # we want to tell binutils-config that it's cool if - # it generates multiple sets of binutil symlinks. - # e.g. sparc gets {sparc,sparc64}-unknown-linux-gnu - local targ=${CTARGET/-*} src="" dst="" - local FAKE_TARGETS=${CTARGET} - case ${targ} in - mips*) src="mips" dst="mips64";; - powerpc*) src="powerpc" dst="powerpc64";; - s390*) src="s390" dst="s390x";; - sparc*) src="sparc" dst="sparc64";; - esac - case ${targ} in - mips64*|powerpc64*|s390x*|sparc64*) targ=${src} src=${dst} dst=${targ};; - esac - [[ -n ${src}${dst} ]] && FAKE_TARGETS="${FAKE_TARGETS} ${CTARGET/${src}/${dst}}" - - # Generate an env.d entry for this binutils - insinto /etc/env.d/binutils - cat <<-EOF > "${T}"/env.d - TARGET="${CTARGET}" - VER="${BVER}" - LIBPATH="${LIBPATH}" - FAKE_TARGETS="${FAKE_TARGETS}" - EOF - newins "${T}"/env.d ${CTARGET}-${BVER} - - # Handle documentation - if ! is_cross ; then - cd "${S_BINUTILS}" - dodoc README - docinto bfd - dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO - docinto binutils - dodoc binutils/ChangeLog binutils/NEWS binutils/README - docinto gas - dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README* - docinto gprof - dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl - docinto ld - dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO - docinto libiberty - dodoc libiberty/ChangeLog* libiberty/README - docinto opcodes - dodoc opcodes/ChangeLog* - fi - # Remove shared info pages - rm -f "${D}"/${DATAPATH}/info/{dir,configure.info,standards.info} - # Trim all empty dirs - find "${D}" -type d | xargs rmdir >& /dev/null - - if use hardened ; then - LDWRAPPER=ldwrapper.hardened - else - LDWRAPPER=ldwrapper - fi - - mv "${D}/${BINPATH}/ld.bfd" "${D}/${BINPATH}/ld.bfd.real" || die - exeinto "${BINPATH}" - newexe "${FILESDIR}/${LDWRAPPER}" "ld.bfd" || die - - mv "${D}/${BINPATH}/ld.gold" "${D}/${BINPATH}/ld.gold.real" || die - exeinto "${BINPATH}" - newexe "${FILESDIR}/${LDWRAPPER}" "ld.gold" || die - - # Set default to be ld.bfd in regular installation - dosym ld.bfd "${BINPATH}/ld" - - # Make a fake installation for gold with gold as the default linker - # so we can turn gold on/off with binutils-config - LASTDIR=${LIBPATH##/*/} - dosym "${LASTDIR}" "${LIBPATH}-gold" - LASTDIR=${DATAPATH##/*/} - dosym "${LASTDIR}" "${DATAPATH}-gold" - - mkdir "${D}/${BINPATH}-gold" - cd "${D}"/${BINPATH} - LASTDIR=${BINPATH##/*/} - for x in * ; do - dosym "../${LASTDIR}/${x}" "${BINPATH}-gold/${x}" - done - dosym ld.gold "${BINPATH}-gold/ld" - - # Install gold binutils-config configuration file - insinto /etc/env.d/binutils - cat <<-EOF > "${T}"/env.d - TARGET="${CTARGET}" - VER="${BVER}-gold" - LIBPATH="${LIBPATH}-gold" - FAKE_TARGETS="${FAKE_TARGETS}" - EOF - newins "${T}"/env.d ${CTARGET}-${BVER}-gold - - # Move the locale directory to where it is supposed to be - mv "${D}/usr/share/locale" "${D}/${DATAPATH}/" -} - -pkg_postinst() { - binutils-config ${CTARGET}-${BVER} -} - -pkg_postrm() { - local current_profile=$(binutils-config -c ${CTARGET}) - - # If no other versions exist, then uninstall for this - # target ... otherwise, switch to the newest version - # Note: only do this if this version is unmerged. We - # rerun binutils-config if this is a remerge, as - # we want the mtimes on the symlinks updated (if - # it is the same as the current selected profile) - if [[ ! -e ${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then - local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}') - choice=${choice//$'\n'/ } - choice=${choice/* } - if [[ -z ${choice} ]] ; then - env -i binutils-config -u ${CTARGET} - else - binutils-config ${choice} - fi - elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${BVER} ]] ; then - binutils-config ${CTARGET}-${BVER} - fi -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/binutils-2.23.1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/binutils-2.23.1.ebuild deleted file mode 100644 index 1df00d62f0..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/binutils-2.23.1.ebuild +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils/binutils-2.23.1.ebuild,v 1.1 2012/11/15 19:43:36 vapier Exp $ - -PATCHVER="1.0" -ELF2FLT_VER="" -inherit toolchain-binutils - -KEYWORDS="" diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/binutils-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/binutils-9999.ebuild deleted file mode 100644 index f95e456941..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/binutils-9999.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. -# Distributed under the terms of the GNU General Public License v2 - -CROS_WORKON_PROJECT=chromiumos/third_party/binutils - -inherit eutils libtool flag-o-matic gnuconfig multilib versionator cros-workon - -KEYWORDS="~amd64 ~arm ~x86" - -BVER=${PV} - -# Version names -if [[ "${PV}" == "9999" ]] ; then - BINUTILS_VERSION="binutils-2.22" -else - BINUTILS_VERSION="${P}" -fi - -BINUTILS_PKG_VERSION="${BINUTILS_VERSION}_cos_gg" - -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} == ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi - -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } - -DESCRIPTION="Tools necessary to build programs" -HOMEPAGE="http://sources.redhat.com/binutils/" -LICENSE="|| ( GPL-3 LGPL-3 )" -IUSE="hardened mounted_binutils multislot multitarget nls test vanilla" -if use multislot ; then - SLOT="${CTARGET}-${BVER}" -elif is_cross ; then - SLOT="${CTARGET}" -else - SLOT="0" -fi - -RDEPEND=">=sys-devel/binutils-config-1.9" -DEPEND="${RDEPEND} - test? ( dev-util/dejagnu ) - nls? ( sys-devel/gettext ) - sys-devel/flex" - -S_BINUTILS="${WORKDIR}/${BINUTILS_VERSION}" - -RESTRICT="fetch strip" - -MY_BUILDDIR_BINUTILS="${WORKDIR}/build" - -GITDIR=${WORKDIR}/gitdir - -LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER} -INCPATH=${LIBPATH}/include -DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER} -if is_cross ; then - BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER} -else - BINPATH=/usr/${CTARGET}/binutils-bin/${BVER} -fi - -src_unpack() { - if use mounted_binutils ; then - BINUTILS_DIR="/usr/local/toolchain_root/binutils" - if [[ ! -d ${BINUTILS_DIR} ]] ; then - die "binutils dirs not mounted at: ${BINUTILS_DIR}" - fi - else - cros-workon_src_unpack - mv "${S}" "${GITDIR}" - BINUTILS_DIR="${GITDIR}" - if [ -d "${GITDIR}/.git" ]; then - CL=$(cd "${BINUTILS_DIR}"; git log --pretty=format:%s -n1 | egrep -o '[0-9]+') - fi - fi - if [[ ! -z ${CL} ]] ; then - BINUTILS_PKG_VERSION="${BINUTILS_PKG_VERSION}_${CL}" - fi - ln -s ${BINUTILS_DIR} ${S_BINUTILS} - - mkdir -p "${MY_BUILDDIR_BINUTILS}" -} - - -src_compile() { - # keep things sane - strip-flags - - local x - echo - for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do - einfo "$(printf '%10s' ${x}:) ${!x}" - done - echo - - cd "${MY_BUILDDIR_BINUTILS}" - local myconf="" - is_cross && myconf="${myconf} --with-sysroot=/usr/${CTARGET}" - myconf="--prefix=/usr \ - --host=${CHOST} \ - --target=${CTARGET} \ - --datadir=${DATAPATH} \ - --infodir=${DATAPATH}/info \ - --mandir=${DATAPATH}/man \ - --bindir=${BINPATH} \ - --libdir=${LIBPATH} \ - --libexecdir=${LIBPATH} \ - --includedir=${INCPATH} \ - --enable-64-bit-bfd \ - --enable-gold \ - --enable-shared \ - --disable-werror \ - --enable-secureplt \ - --enable-plugins \ - --without-included-gettext \ - --build=${CBUILD} \ - --with-bugurl=http://code.google.com/p/chromium-os/issues/entry \ - ${myconf} ${EXTRA_ECONF}" - - binutils_conf="${myconf} --with-pkgversion=${BINUTILS_PKG_VERSION}" - - echo ./configure ${binutils_conf} - "${S_BINUTILS}"/configure ${binutils_conf} || die "configure failed" - - emake all || die "emake failed" - - # only build info pages if we user wants them, and if - # we have makeinfo (may not exist when we bootstrap) - if type -p makeinfo > /dev/null ; then - emake info || die "make info failed" - fi - # we nuke the manpages when we're left with junk - # (like when we bootstrap, no perl -> no manpages) - find . -name '*.1' -a -size 0 | xargs rm -f -} - -src_test() { - cd "${MY_BUILDDIR_BINUTILS}" - make check || die "check failed :(" -} - -src_install() { - local x d - - cd "${MY_BUILDDIR_BINUTILS}" - emake DESTDIR="${D}" tooldir="${LIBPATH}" install || die - rm -rf "${D}"/${LIBPATH}/bin - - # Newer versions of binutils get fancy with ${LIBPATH} #171905 - cd "${D}"/${LIBPATH} - for d in ../* ; do - [[ ${d} == ../${BVER} ]] && continue - mv ${d}/* . || die - rmdir ${d} || die - done - - # Now we collect everything intp the proper SLOT-ed dirs - # When something is built to cross-compile, it installs into - # /usr/$CHOST/ by default ... we have to 'fix' that :) - if is_cross ; then - cd "${D}"/${BINPATH} - for x in * ; do - mv ${x} ${x/${CTARGET}-} - done - - if [[ -d ${D}/usr/${CHOST}/${CTARGET} ]] ; then - mv "${D}"/usr/${CHOST}/${CTARGET}/include "${D}"/${INCPATH} - mv "${D}"/usr/${CHOST}/${CTARGET}/lib/* "${D}"/${LIBPATH}/ - rm -r "${D}"/usr/${CHOST}/{include,lib} - fi - fi - insinto ${INCPATH} - doins "${S_BINUTILS}/include/libiberty.h" - if [[ -d ${D}/${LIBPATH}/lib ]] ; then - mv "${D}"/${LIBPATH}/lib/* "${D}"/${LIBPATH}/ - rm -r "${D}"/${LIBPATH}/lib - fi - - # Now, some binutils are tricky and actually provide - # for multiple TARGETS. Really, we're talking just - # 32bit/64bit support (like mips/ppc/sparc). Here - # we want to tell binutils-config that it's cool if - # it generates multiple sets of binutil symlinks. - # e.g. sparc gets {sparc,sparc64}-unknown-linux-gnu - local targ=${CTARGET/-*} src="" dst="" - local FAKE_TARGETS=${CTARGET} - case ${targ} in - mips*) src="mips" dst="mips64";; - powerpc*) src="powerpc" dst="powerpc64";; - s390*) src="s390" dst="s390x";; - sparc*) src="sparc" dst="sparc64";; - esac - case ${targ} in - mips64*|powerpc64*|s390x*|sparc64*) targ=${src} src=${dst} dst=${targ};; - esac - [[ -n ${src}${dst} ]] && FAKE_TARGETS="${FAKE_TARGETS} ${CTARGET/${src}/${dst}}" - - # Generate an env.d entry for this binutils - insinto /etc/env.d/binutils - cat <<-EOF > "${T}"/env.d - TARGET="${CTARGET}" - VER="${BVER}" - LIBPATH="${LIBPATH}" - FAKE_TARGETS="${FAKE_TARGETS}" - EOF - newins "${T}"/env.d ${CTARGET}-${BVER} - - # Handle documentation - if ! is_cross ; then - cd "${S_BINUTILS}" - dodoc README - docinto bfd - dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO - docinto binutils - dodoc binutils/ChangeLog binutils/NEWS binutils/README - docinto gas - dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README* - docinto gprof - dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl - docinto ld - dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO - docinto libiberty - dodoc libiberty/ChangeLog* libiberty/README - docinto opcodes - dodoc opcodes/ChangeLog* - fi - # Remove shared info pages - rm -f "${D}"/${DATAPATH}/info/{dir,configure.info,standards.info} - # Trim all empty dirs - find "${D}" -type d | xargs rmdir >& /dev/null - - if use hardened ; then - LDWRAPPER=ldwrapper.hardened - else - LDWRAPPER=ldwrapper - fi - - mv "${D}/${BINPATH}/ld.bfd" "${D}/${BINPATH}/ld.bfd.real" || die - exeinto "${BINPATH}" - newexe "${FILESDIR}/${LDWRAPPER}" "ld.bfd" || die - - mv "${D}/${BINPATH}/ld.gold" "${D}/${BINPATH}/ld.gold.real" || die - exeinto "${BINPATH}" - newexe "${FILESDIR}/${LDWRAPPER}" "ld.gold" || die - - # Set default to be ld.bfd in regular installation - dosym ld.bfd "${BINPATH}/ld" - - # Make a fake installation for gold with gold as the default linker - # so we can turn gold on/off with binutils-config - LASTDIR=${LIBPATH##/*/} - dosym "${LASTDIR}" "${LIBPATH}-gold" - LASTDIR=${DATAPATH##/*/} - dosym "${LASTDIR}" "${DATAPATH}-gold" - - mkdir "${D}/${BINPATH}-gold" - cd "${D}"/${BINPATH} - LASTDIR=${BINPATH##/*/} - for x in * ; do - dosym "../${LASTDIR}/${x}" "${BINPATH}-gold/${x}" - done - dosym ld.gold "${BINPATH}-gold/ld" - - # Install gold binutils-config configuration file - insinto /etc/env.d/binutils - cat <<-EOF > "${T}"/env.d - TARGET="${CTARGET}" - VER="${BVER}-gold" - LIBPATH="${LIBPATH}-gold" - FAKE_TARGETS="${FAKE_TARGETS}" - EOF - newins "${T}"/env.d ${CTARGET}-${BVER}-gold - - # Move the locale directory to where it is supposed to be - mv "${D}/usr/share/locale" "${D}/${DATAPATH}/" -} - -pkg_postinst() { - binutils-config ${CTARGET}-${BVER} -} - -pkg_postrm() { - local current_profile=$(binutils-config -c ${CTARGET}) - - # If no other versions exist, then uninstall for this - # target ... otherwise, switch to the newest version - # Note: only do this if this version is unmerged. We - # rerun binutils-config if this is a remerge, as - # we want the mtimes on the symlinks updated (if - # it is the same as the current selected profile) - if [[ ! -e ${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then - local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}') - choice=${choice//$'\n'/ } - choice=${choice/* } - if [[ -z ${choice} ]] ; then - env -i binutils-config -u ${CTARGET} - else - binutils-config ${choice} - fi - elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${BVER} ]] ; then - binutils-config ${CTARGET}-${BVER} - fi -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/aswrapper b/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/aswrapper deleted file mode 100755 index ee6641cbb6..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/aswrapper +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This files wraps as. -# In addition, it adds --allow-incbin to the command line before invoking as. -# This flag is necessary on link commands that use the .incbin directive. - -exec "$(readlink -f "${0}").real" --allow-incbin "$@" diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/chromeos-version.sh b/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/chromeos-version.sh deleted file mode 100755 index ff99b230d6..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/chromeos-version.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -# -# This script is given one argument: the base of the source directory of -# the package, and it prints a string on stdout with the numerical version -# number for said repo. - -exec sed -n '/^ *VERSION=/{s:.*=::;p;q}' \ - "$(find "$1" -path '*/bfd/configure')" diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/ldwrapper b/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/ldwrapper deleted file mode 100755 index 48d754694a..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/ldwrapper +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This files wraps ld and ld.gold. -# In addition, it adds --hash-style=gnu to the linker command line. - -exec "$(readlink -f "${0}").real" --hash-style=gnu "$@" diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/ldwrapper.hardened b/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/ldwrapper.hardened deleted file mode 100755 index c38fb10078..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/binutils/files/ldwrapper.hardened +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This files wraps ld and ld.gold. -# In addition, it inserts hardened flags (-z now and -z relro) to the linker -# before invoking it. It also adds --hash-style=gnu to the linker command line. -# -# There is a similar wrapper around gcc that adds -fPIE, -fstack-protector-all, -# -D_FORTIFY_SOURCE=2 and -pie to the compile command line. - -exec "$(readlink -f "${0}").real" -z now -z relro --hash-style=gnu "$@" diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/90_all_gcc-4.7-x32.patch b/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/90_all_gcc-4.7-x32.patch deleted file mode 100644 index 6eda63f983..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/90_all_gcc-4.7-x32.patch +++ /dev/null @@ -1,2989 +0,0 @@ -this patch was created from: - -git diff -p 475e5d65b13bfb798ff1f2c45ab46619ab050283^..remotes/origin/hjl/x32/gcc-4_7-branch - -hjlu's 4.7 branch is pretty much all backports from code in trunk - ---- a/boehm-gc/configure -+++ b/boehm-gc/configure -@@ -6786,7 +6786,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/boehm-gc/include/private/gcconfig.h -+++ b/boehm-gc/include/private/gcconfig.h -@@ -1974,8 +1974,13 @@ - - # ifdef X86_64 - # define MACH_TYPE "X86_64" --# define ALIGNMENT 8 --# define CPP_WORDSZ 64 -+# ifdef __ILP32__ -+# define ALIGNMENT 4 -+# define CPP_WORDSZ 32 -+# else -+# define ALIGNMENT 8 -+# define CPP_WORDSZ 64 -+# endif - # ifndef HBLKSIZE - # define HBLKSIZE 4096 - # endif ---- a/gcc/ada/gcc-interface/Makefile.in -+++ b/gcc/ada/gcc-interface/Makefile.in -@@ -349,6 +349,10 @@ GNATMAKE_OBJS = a-except.o ali.o ali-util.o aspects.o s-casuti.o alloc.o \ - ifeq ($(strip $(filter-out %x86_64, $(arch))),) - ifeq ($(strip $(MULTISUBDIR)),/32) - arch:=i686 -+ else -+ ifeq ($(strip $(MULTISUBDIR)),/x32) -+ arch:=x32 -+ endif - endif - endif - -@@ -2131,6 +2135,43 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),) - LIBRARY_VERSION := $(LIB_VERSION) - endif - -+ifeq ($(strip $(filter-out %x32 linux%,$(arch) $(osys))),) -+ LIBGNAT_TARGET_PAIRS = \ -+ a-exetim.adbgregs[REG_ESP] += 4096 + 4 * sizeof (unsigned long); - #elif defined (__x86_64__) -- unsigned long *pc = (unsigned long *)mcontext->gregs[REG_RIP]; -- /* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode. */ -- if (signo == SIGSEGV && pc && (*pc & 0xffffffffff) == 0x00240c8348) -+ unsigned long long *pc = (unsigned long long *)mcontext->gregs[REG_RIP]; -+ if (signo == SIGSEGV && pc -+ /* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode. */ -+ && ((*pc & 0xffffffffffLL) == 0x00240c8348LL -+ /* The pattern may also be "orl $0x0,(%esp)" for a probe in -+ x32 mode. */ -+ || (*pc & 0xffffffffLL) == 0x00240c83LL)) - mcontext->gregs[REG_RSP] += 4096 + 4 * sizeof (unsigned long); - #elif defined (__ia64__) - /* ??? The IA-64 unwinder doesn't compensate for signals. */ ---- a/gcc/ada/link.c -+++ b/gcc/ada/link.c -@@ -187,7 +187,11 @@ unsigned char __gnat_using_gnu_linker = 1; - const char *__gnat_object_library_extension = ".a"; - unsigned char __gnat_separate_run_path_options = 0; - #if defined (__x86_64) -+# if defined (__LP64__) - const char *__gnat_default_libgcc_subdir = "lib64"; -+# else -+const char *__gnat_default_libgcc_subdir = "libx32"; -+# endif - #else - const char *__gnat_default_libgcc_subdir = "lib"; - #endif ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -486,6 +486,10 @@ fi - - case ${target} in - i[34567]86-*-*) -+ if test "x$with_abi" != x; then -+ echo "This target does not support --with-abi." -+ exit 1 -+ fi - if test "x$enable_cld" = xyes; then - tm_defines="${tm_defines} USE_IX86_CLD=1" - fi -@@ -495,7 +499,24 @@ i[34567]86-*-*) - tm_file="vxworks-dummy.h ${tm_file}" - ;; - x86_64-*-*) -- tm_file="i386/biarch64.h ${tm_file}" -+ case ${with_abi} in -+ "") -+ if test "x$with_multilib_list" = xmx32; then -+ tm_file="i386/biarchx32.h ${tm_file}" -+ else -+ tm_file="i386/biarch64.h ${tm_file}" -+ fi -+ ;; -+ 64 | m64) -+ tm_file="i386/biarch64.h ${tm_file}" -+ ;; -+ x32 | mx32) -+ tm_file="i386/biarchx32.h ${tm_file}" -+ ;; -+ *) -+ echo "Unknown ABI used in --with-abi=$with_abi" -+ exit 1 -+ esac - if test "x$enable_cld" = xyes; then - tm_defines="${tm_defines} USE_IX86_CLD=1" - fi -@@ -3201,7 +3222,7 @@ case "${target}" in - ;; - - i[34567]86-*-* | x86_64-*-*) -- supported_defaults="arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64" -+ supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64" - for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do - eval "val=\$with_$which" - case ${val} in ---- a/gcc/config/arm/arm.opt -+++ b/gcc/config/arm/arm.opt -@@ -59,7 +59,7 @@ Target Report Mask(ABORT_NORETURN) - Generate a call to abort if a noreturn function returns - - mapcs --Target RejectNegative Mask(APCS_FRAME) MaskExists Undocumented -+Target RejectNegative Mask(APCS_FRAME) Undocumented - - mapcs-float - Target Report Mask(APCS_FLOAT) ---- a/gcc/config/cris/linux.opt -+++ b/gcc/config/cris/linux.opt -@@ -23,7 +23,7 @@ mlinux - Target Report RejectNegative Undocumented - - mno-gotplt --Target Report RejectNegative Mask(AVOID_GOTPLT) MaskExists -+Target Report RejectNegative Mask(AVOID_GOTPLT) - Together with -fpic and -fPIC, do not use GOTPLT references - - ; There's a small added setup cost with using GOTPLT references ---- a/gcc/config/host-linux.c -+++ b/gcc/config/host-linux.c -@@ -68,8 +68,10 @@ - # define TRY_EMPTY_VM_SPACE 0x10000000000 - #elif defined(__ia64) - # define TRY_EMPTY_VM_SPACE 0x2000000100000000 --#elif defined(__x86_64) -+#elif defined(__x86_64) && defined(__LP64__) - # define TRY_EMPTY_VM_SPACE 0x1000000000 -+#elif defined(__x86_64) -+# define TRY_EMPTY_VM_SPACE 0x60000000 - #elif defined(__i386) - # define TRY_EMPTY_VM_SPACE 0x60000000 - #elif defined(__powerpc__) ---- a/gcc/config/i386/biarch64.h -+++ b/gcc/config/i386/biarch64.h -@@ -25,5 +25,5 @@ a copy of the GCC Runtime Library Exception along with this program; - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - --#define TARGET_64BIT_DEFAULT OPTION_MASK_ISA_64BIT -+#define TARGET_64BIT_DEFAULT (OPTION_MASK_ISA_64BIT | OPTION_MASK_ABI_64) - #define TARGET_BI_ARCH 1 ---- /dev/null -+++ b/gcc/config/i386/biarchx32.h -@@ -0,0 +1,28 @@ -+/* Make configure files to produce biarch compiler defaulting to x32 mode. -+ This file must be included very first, while the OS specific file later -+ to overwrite otherwise wrong defaults. -+ Copyright (C) 2012 Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 3, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+Under Section 7 of GPL version 3, you are granted additional -+permissions described in the GCC Runtime Library Exception, version -+3.1, as published by the Free Software Foundation. -+ -+You should have received a copy of the GNU General Public License and -+a copy of the GCC Runtime Library Exception along with this program; -+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+. */ -+ -+#define TARGET_64BIT_DEFAULT (OPTION_MASK_ISA_64BIT | OPTION_MASK_ABI_X32) -+#define TARGET_BI_ARCH 2 ---- a/gcc/config/i386/constraints.md -+++ b/gcc/config/i386/constraints.md -@@ -18,7 +18,7 @@ - ;; . - - ;;; Unused letters: --;;; B H T W -+;;; B H T - ;;; h k v - - ;; Integer register constraints. -@@ -193,6 +193,16 @@ - instructions)." - (match_operand 0 "x86_64_immediate_operand")) - -+;; We use W prefix to denote any number of -+;; constant-or-symbol-reference constraints -+ -+(define_constraint "Wz" -+ "32-bit unsigned integer constant, or a symbolic reference known -+ to fit that range (for zero-extending conversion operations that -+ require non-VOIDmode immediate operands)." -+ (and (match_operand 0 "x86_64_zext_immediate_operand") -+ (match_test "GET_MODE (op) != VOIDmode"))) -+ - (define_constraint "Z" - "32-bit unsigned integer constant, or a symbolic reference known - to fit that range (for immediate operands in zero-extending x86-64 ---- a/gcc/config/i386/gnu-user64.h -+++ b/gcc/config/i386/gnu-user64.h -@@ -58,8 +58,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - - #if TARGET_64BIT_DEFAULT - #define SPEC_32 "m32" -+#if TARGET_BI_ARCH == 2 -+#define SPEC_64 "m64" -+#define SPEC_X32 "m32|m64:;" -+#else - #define SPEC_64 "m32|mx32:;" - #define SPEC_X32 "mx32" -+#endif - #else - #define SPEC_32 "m64|mx32:;" - #define SPEC_64 "m64" -@@ -95,7 +100,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" - - #if TARGET_64BIT_DEFAULT -+#if TARGET_BI_ARCH == 2 -+#define MULTILIB_DEFAULTS { "mx32" } -+#else - #define MULTILIB_DEFAULTS { "m64" } -+#endif - #else - #define MULTILIB_DEFAULTS { "m32" } - #endif ---- a/gcc/config/i386/i386-opts.h -+++ b/gcc/config/i386/i386-opts.h -@@ -71,6 +71,11 @@ enum cmodel { - CM_LARGE_PIC /* No assumptions. */ - }; - -+enum pmode { -+ PMODE_SI, /* Pmode == SImode. */ -+ PMODE_DI /* Pmode == DImode. */ -+}; -+ - enum asm_dialect { - ASM_ATT, - ASM_INTEL ---- a/gcc/config/i386/i386.c -+++ b/gcc/config/i386/i386.c -@@ -2445,6 +2445,8 @@ static rtx (*ix86_gen_andsp) (rtx, rtx, rtx); - static rtx (*ix86_gen_allocate_stack_worker) (rtx, rtx); - static rtx (*ix86_gen_adjust_stack_and_probe) (rtx, rtx, rtx); - static rtx (*ix86_gen_probe_stack_range) (rtx, rtx, rtx); -+static rtx (*ix86_gen_tls_global_dynamic_64) (rtx, rtx, rtx); -+static rtx (*ix86_gen_tls_local_dynamic_base_64) (rtx, rtx); - - /* Preferred alignment for stack boundary in bits. */ - unsigned int ix86_preferred_stack_boundary; -@@ -2655,7 +2657,6 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch, - preceding options while match those first. */ - static struct ix86_target_opts isa_opts[] = - { -- { "-m64", OPTION_MASK_ISA_64BIT }, - { "-mfma4", OPTION_MASK_ISA_FMA4 }, - { "-mfma", OPTION_MASK_ISA_FMA }, - { "-mxop", OPTION_MASK_ISA_XOP }, -@@ -2727,6 +2728,7 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch, - size_t len; - size_t line_len; - size_t sep_len; -+ const char *abi; - - memset (opts, '\0', sizeof (opts)); - -@@ -2744,6 +2746,21 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch, - opts[num++][1] = tune; - } - -+ /* Add -m32/-m64/-mx32. */ -+ if ((isa & OPTION_MASK_ISA_64BIT) != 0) -+ { -+ if ((isa & OPTION_MASK_ABI_64) != 0) -+ abi = "-m64"; -+ else -+ abi = "-mx32"; -+ isa &= ~ (OPTION_MASK_ISA_64BIT -+ | OPTION_MASK_ABI_64 -+ | OPTION_MASK_ABI_X32); -+ } -+ else -+ abi = "-m32"; -+ opts[num++][0] = abi; -+ - /* Pick out the options in isa options. */ - for (i = 0; i < ARRAY_SIZE (isa_opts); i++) - { -@@ -3090,6 +3107,46 @@ ix86_option_override_internal (bool main_args_p) - sw = "attribute"; - } - -+ /* Turn off both OPTION_MASK_ABI_64 and OPTION_MASK_ABI_X32 if -+ TARGET_64BIT_DEFAULT is true and TARGET_64BIT is false. */ -+ if (TARGET_64BIT_DEFAULT && !TARGET_64BIT) -+ ix86_isa_flags &= ~(OPTION_MASK_ABI_64 | OPTION_MASK_ABI_X32); -+#ifdef TARGET_BI_ARCH -+ else -+ { -+#if TARGET_BI_ARCH == 1 -+ /* When TARGET_BI_ARCH == 1, by default, OPTION_MASK_ABI_64 -+ is on and OPTION_MASK_ABI_X32 is off. We turn off -+ OPTION_MASK_ABI_64 if OPTION_MASK_ABI_X32 is turned on by -+ -mx32. */ -+ if (TARGET_X32) -+ ix86_isa_flags &= ~OPTION_MASK_ABI_64; -+#else -+ /* When TARGET_BI_ARCH == 2, by default, OPTION_MASK_ABI_X32 is -+ on and OPTION_MASK_ABI_64 is off. We turn off -+ OPTION_MASK_ABI_X32 if OPTION_MASK_ABI_64 is turned on by -+ -m64. */ -+ if (TARGET_LP64) -+ ix86_isa_flags &= ~OPTION_MASK_ABI_X32; -+#endif -+ } -+#endif -+ -+ if (TARGET_X32) -+ { -+ /* Always turn on OPTION_MASK_ISA_64BIT and turn off -+ OPTION_MASK_ABI_64 for TARGET_X32. */ -+ ix86_isa_flags |= OPTION_MASK_ISA_64BIT; -+ ix86_isa_flags &= ~OPTION_MASK_ABI_64; -+ } -+ else if (TARGET_LP64) -+ { -+ /* Always turn on OPTION_MASK_ISA_64BIT and turn off -+ OPTION_MASK_ABI_X32 for TARGET_LP64. */ -+ ix86_isa_flags |= OPTION_MASK_ISA_64BIT; -+ ix86_isa_flags &= ~OPTION_MASK_ABI_X32; -+ } -+ - #ifdef SUBTARGET_OVERRIDE_OPTIONS - SUBTARGET_OVERRIDE_OPTIONS; - #endif -@@ -3098,9 +3155,6 @@ ix86_option_override_internal (bool main_args_p) - SUBSUBTARGET_OVERRIDE_OPTIONS; - #endif - -- if (TARGET_X32) -- ix86_isa_flags |= OPTION_MASK_ISA_64BIT; -- - /* -fPIC is the default for x86_64. */ - if (TARGET_MACHO && TARGET_64BIT) - flag_pic = 2; -@@ -3169,6 +3223,17 @@ ix86_option_override_internal (bool main_args_p) - else - ix86_arch_specified = 1; - -+ if (global_options_set.x_ix86_pmode) -+ { -+ if ((TARGET_LP64 && ix86_pmode == PMODE_SI) -+ || (!TARGET_64BIT && ix86_pmode == PMODE_DI)) -+ error ("address mode %qs not supported in the %s bit mode", -+ TARGET_64BIT ? "short" : "long", -+ TARGET_64BIT ? "64" : "32"); -+ } -+ else -+ ix86_pmode = TARGET_LP64 ? PMODE_DI : PMODE_SI; -+ - if (!global_options_set.x_ix86_abi) - ix86_abi = DEFAULT_ABI; - -@@ -3743,11 +3808,33 @@ ix86_option_override_internal (bool main_args_p) - if (TARGET_64BIT) - { - ix86_gen_leave = gen_leave_rex64; -+ if (Pmode == DImode) -+ { -+ ix86_gen_monitor = gen_sse3_monitor64_di; -+ ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_di; -+ ix86_gen_tls_local_dynamic_base_64 -+ = gen_tls_local_dynamic_base_64_di; -+ } -+ else -+ { -+ ix86_gen_monitor = gen_sse3_monitor64_si; -+ ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_si; -+ ix86_gen_tls_local_dynamic_base_64 -+ = gen_tls_local_dynamic_base_64_si; -+ } -+ } -+ else -+ { -+ ix86_gen_leave = gen_leave; -+ ix86_gen_monitor = gen_sse3_monitor; -+ } -+ -+ if (Pmode == DImode) -+ { - ix86_gen_add3 = gen_adddi3; - ix86_gen_sub3 = gen_subdi3; - ix86_gen_sub3_carry = gen_subdi3_carry; - ix86_gen_one_cmpl2 = gen_one_cmpldi2; -- ix86_gen_monitor = gen_sse3_monitor64; - ix86_gen_andsp = gen_anddi3; - ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_di; - ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probedi; -@@ -3755,12 +3842,10 @@ ix86_option_override_internal (bool main_args_p) - } - else - { -- ix86_gen_leave = gen_leave; - ix86_gen_add3 = gen_addsi3; - ix86_gen_sub3 = gen_subsi3; - ix86_gen_sub3_carry = gen_subsi3_carry; - ix86_gen_one_cmpl2 = gen_one_cmplsi2; -- ix86_gen_monitor = gen_sse3_monitor; - ix86_gen_andsp = gen_andsi3; - ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_si; - ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probesi; -@@ -7220,8 +7305,8 @@ function_value_64 (enum machine_mode orig_mode, enum machine_mode mode, - } - else if (POINTER_TYPE_P (valtype)) - { -- /* Pointers are always returned in Pmode. */ -- mode = Pmode; -+ /* Pointers are always returned in word_mode. */ -+ mode = word_mode; - } - - ret = construct_container (mode, orig_mode, valtype, 1, -@@ -7292,7 +7377,8 @@ ix86_function_value (const_tree valtype, const_tree fntype_or_decl, - return ix86_function_value_1 (valtype, fntype_or_decl, orig_mode, mode); - } - --/* Pointer function arguments and return values are promoted to Pmode. */ -+/* Pointer function arguments and return values are promoted to -+ word_mode. */ - - static enum machine_mode - ix86_promote_function_mode (const_tree type, enum machine_mode mode, -@@ -7302,7 +7388,7 @@ ix86_promote_function_mode (const_tree type, enum machine_mode mode, - if (type != NULL_TREE && POINTER_TYPE_P (type)) - { - *punsignedp = POINTERS_EXTEND_UNSIGNED; -- return Pmode; -+ return word_mode; - } - return default_promote_function_mode (type, mode, punsignedp, fntype, - for_return); -@@ -7580,12 +7666,13 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum) - - for (i = cum->regno; i < max; i++) - { -- mem = gen_rtx_MEM (Pmode, -+ mem = gen_rtx_MEM (word_mode, - plus_constant (save_area, i * UNITS_PER_WORD)); - MEM_NOTRAP_P (mem) = 1; - set_mem_alias_set (mem, set); -- emit_move_insn (mem, gen_rtx_REG (Pmode, -- x86_64_int_parameter_registers[i])); -+ emit_move_insn (mem, -+ gen_rtx_REG (word_mode, -+ x86_64_int_parameter_registers[i])); - } - - if (ix86_varargs_fpr_size) -@@ -8640,8 +8727,11 @@ gen_push (rtx arg) - m->fs.cfa_offset += UNITS_PER_WORD; - m->fs.sp_offset += UNITS_PER_WORD; - -+ if (REG_P (arg) && GET_MODE (arg) != word_mode) -+ arg = gen_rtx_REG (word_mode, REGNO (arg)); -+ - return gen_rtx_SET (VOIDmode, -- gen_rtx_MEM (Pmode, -+ gen_rtx_MEM (word_mode, - gen_rtx_PRE_DEC (Pmode, - stack_pointer_rtx)), - arg); -@@ -8652,9 +8742,12 @@ gen_push (rtx arg) - static rtx - gen_pop (rtx arg) - { -+ if (REG_P (arg) && GET_MODE (arg) != word_mode) -+ arg = gen_rtx_REG (word_mode, REGNO (arg)); -+ - return gen_rtx_SET (VOIDmode, - arg, -- gen_rtx_MEM (Pmode, -+ gen_rtx_MEM (word_mode, - gen_rtx_POST_INC (Pmode, - stack_pointer_rtx))); - } -@@ -9121,7 +9214,7 @@ ix86_emit_save_regs (void) - for (regno = FIRST_PSEUDO_REGISTER - 1; regno-- > 0; ) - if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, true)) - { -- insn = emit_insn (gen_push (gen_rtx_REG (Pmode, regno))); -+ insn = emit_insn (gen_push (gen_rtx_REG (word_mode, regno))); - RTX_FRAME_RELATED_P (insn) = 1; - } - } -@@ -9201,7 +9294,7 @@ ix86_emit_save_regs_using_mov (HOST_WIDE_INT cfa_offset) - for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, true)) - { -- ix86_emit_save_reg_using_mov (Pmode, regno, cfa_offset); -+ ix86_emit_save_reg_using_mov (word_mode, regno, cfa_offset); - cfa_offset -= UNITS_PER_WORD; - } - } -@@ -9276,7 +9369,7 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, - rtx insn; - bool add_frame_related_expr = false; - -- if (! TARGET_64BIT) -+ if (Pmode == SImode) - insn = gen_pro_epilogue_adjust_stack_si_add (dest, src, offset); - else if (x86_64_immediate_operand (offset, DImode)) - insn = gen_pro_epilogue_adjust_stack_di_add (dest, src, offset); -@@ -10138,7 +10231,7 @@ ix86_expand_prologue (void) - to implement macro RETURN_ADDR_RTX and intrinsic function - expand_builtin_return_addr etc. */ - t = plus_constant (crtl->drap_reg, -UNITS_PER_WORD); -- t = gen_frame_mem (Pmode, t); -+ t = gen_frame_mem (word_mode, t); - insn = emit_insn (gen_push (t)); - RTX_FRAME_RELATED_P (insn) = 1; - -@@ -10310,7 +10403,7 @@ ix86_expand_prologue (void) - emit_insn (ix86_gen_allocate_stack_worker (eax, eax)); - - /* Use the fact that AX still contains ALLOCATE. */ -- adjust_stack_insn = (TARGET_64BIT -+ adjust_stack_insn = (Pmode == DImode - ? gen_pro_epilogue_adjust_stack_di_sub - : gen_pro_epilogue_adjust_stack_si_sub); - -@@ -10335,14 +10428,18 @@ ix86_expand_prologue (void) - if (r10_live && eax_live) - { - t = choose_baseaddr (m->fs.sp_offset - allocate); -- emit_move_insn (r10, gen_frame_mem (Pmode, t)); -+ emit_move_insn (gen_rtx_REG (word_mode, R10_REG), -+ gen_frame_mem (word_mode, t)); - t = choose_baseaddr (m->fs.sp_offset - allocate - UNITS_PER_WORD); -- emit_move_insn (eax, gen_frame_mem (Pmode, t)); -+ emit_move_insn (gen_rtx_REG (word_mode, AX_REG), -+ gen_frame_mem (word_mode, t)); - } - else if (eax_live || r10_live) - { - t = choose_baseaddr (m->fs.sp_offset - allocate); -- emit_move_insn ((eax_live ? eax : r10), gen_frame_mem (Pmode, t)); -+ emit_move_insn (gen_rtx_REG (word_mode, -+ (eax_live ? AX_REG : R10_REG)), -+ gen_frame_mem (word_mode, t)); - } - } - gcc_assert (m->fs.sp_offset == frame.stack_pointer_offset); -@@ -10512,7 +10609,7 @@ ix86_emit_restore_regs_using_pop (void) - - for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, false)) -- ix86_emit_restore_reg_using_pop (gen_rtx_REG (Pmode, regno)); -+ ix86_emit_restore_reg_using_pop (gen_rtx_REG (word_mode, regno)); - } - - /* Emit code and notes for the LEAVE instruction. */ -@@ -10555,11 +10652,11 @@ ix86_emit_restore_regs_using_mov (HOST_WIDE_INT cfa_offset, - for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, maybe_eh_return)) - { -- rtx reg = gen_rtx_REG (Pmode, regno); -+ rtx reg = gen_rtx_REG (word_mode, regno); - rtx insn, mem; - - mem = choose_baseaddr (cfa_offset); -- mem = gen_frame_mem (Pmode, mem); -+ mem = gen_frame_mem (word_mode, mem); - insn = emit_move_insn (reg, mem); - - if (m->fs.cfa_reg == crtl->drap_reg && regno == REGNO (crtl->drap_reg)) -@@ -11164,8 +11261,8 @@ ix86_expand_split_stack_prologue (void) - { - rtx rax; - -- rax = gen_rtx_REG (Pmode, AX_REG); -- emit_move_insn (rax, reg10); -+ rax = gen_rtx_REG (word_mode, AX_REG); -+ emit_move_insn (rax, gen_rtx_REG (word_mode, R10_REG)); - use_reg (&call_fusage, rax); - } - -@@ -11244,8 +11341,8 @@ ix86_expand_split_stack_prologue (void) - /* If we are in 64-bit mode and this function uses a static chain, - we saved %r10 in %rax before calling _morestack. */ - if (TARGET_64BIT && DECL_STATIC_CHAIN (cfun->decl)) -- emit_move_insn (gen_rtx_REG (Pmode, R10_REG), -- gen_rtx_REG (Pmode, AX_REG)); -+ emit_move_insn (gen_rtx_REG (word_mode, R10_REG), -+ gen_rtx_REG (word_mode, AX_REG)); - - /* If this function calls va_start, we need to store a pointer to - the arguments on the old stack, because they may not have been -@@ -11375,10 +11472,14 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) - { - addr = XEXP (addr, 0); - -- /* Strip subreg. */ -+ /* Adjust SUBREGs. */ - if (GET_CODE (addr) == SUBREG - && GET_MODE (SUBREG_REG (addr)) == SImode) - addr = SUBREG_REG (addr); -+ else if (GET_MODE (addr) == DImode) -+ addr = gen_rtx_SUBREG (SImode, addr, 0); -+ else if (GET_MODE (addr) != VOIDmode) -+ return 0; - } - } - -@@ -11434,6 +11535,12 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) - scale = 1 << scale; - break; - -+ case ZERO_EXTEND: -+ op = XEXP (op, 0); -+ if (GET_CODE (op) != UNSPEC) -+ return 0; -+ /* FALLTHRU */ -+ - case UNSPEC: - if (XINT (op, 1) == UNSPEC_TP - && TARGET_TLS_DIRECT_SEG_REFS -@@ -11503,6 +11610,12 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) - return 0; - } - -+/* Address override works only on the (%reg) part of %fs:(%reg). */ -+ if (seg != SEG_DEFAULT -+ && ((base && GET_MODE (base) != word_mode) -+ || (index && GET_MODE (index) != word_mode))) -+ return 0; -+ - /* Extract the integral value of scale. */ - if (scale_rtx) - { -@@ -12455,15 +12568,20 @@ legitimize_pic_address (rtx orig, rtx reg) - /* Load the thread pointer. If TO_REG is true, force it into a register. */ - - static rtx --get_thread_pointer (bool to_reg) -+get_thread_pointer (enum machine_mode tp_mode, bool to_reg) - { - rtx tp = gen_rtx_UNSPEC (ptr_mode, gen_rtvec (1, const0_rtx), UNSPEC_TP); - -- if (GET_MODE (tp) != Pmode) -- tp = convert_to_mode (Pmode, tp, 1); -+ if (GET_MODE (tp) != tp_mode) -+ { -+ gcc_assert (GET_MODE (tp) == SImode); -+ gcc_assert (tp_mode == DImode); -+ -+ tp = gen_rtx_ZERO_EXTEND (tp_mode, tp); -+ } - - if (to_reg) -- tp = copy_addr_to_reg (tp); -+ tp = copy_to_mode_reg (tp_mode, tp); - - return tp; - } -@@ -12515,6 +12633,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) - { - rtx dest, base, off; - rtx pic = NULL_RTX, tp = NULL_RTX; -+ enum machine_mode tp_mode = Pmode; - int type; - - switch (model) -@@ -12540,7 +12659,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) - else - emit_insn (gen_tls_dynamic_gnu2_32 (dest, x, pic)); - -- tp = get_thread_pointer (true); -+ tp = get_thread_pointer (Pmode, true); - dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, tp, dest)); - - set_unique_reg_note (get_last_insn (), REG_EQUAL, x); -@@ -12554,7 +12673,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) - rtx rax = gen_rtx_REG (Pmode, AX_REG), insns; - - start_sequence (); -- emit_call_insn (gen_tls_global_dynamic_64 (rax, x, caddr)); -+ emit_call_insn (ix86_gen_tls_global_dynamic_64 (rax, x, -+ caddr)); - insns = get_insns (); - end_sequence (); - -@@ -12589,7 +12709,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) - else - emit_insn (gen_tls_dynamic_gnu2_32 (base, tmp, pic)); - -- tp = get_thread_pointer (true); -+ tp = get_thread_pointer (Pmode, true); - set_unique_reg_note (get_last_insn (), REG_EQUAL, - gen_rtx_MINUS (Pmode, tmp, tp)); - } -@@ -12602,7 +12722,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) - rtx rax = gen_rtx_REG (Pmode, AX_REG), insns, eqv; - - start_sequence (); -- emit_call_insn (gen_tls_local_dynamic_base_64 (rax, caddr)); -+ emit_call_insn (ix86_gen_tls_local_dynamic_base_64 (rax, -+ caddr)); - insns = get_insns (); - end_sequence (); - -@@ -12645,6 +12766,9 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) - return dest; - } - -+ /* Generate DImode references to avoid %fs:(%reg32) -+ problems and linker IE->LE relaxation bug. */ -+ tp_mode = DImode; - pic = NULL; - type = UNSPEC_GOTNTPOFF; - } -@@ -12667,22 +12791,23 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) - type = UNSPEC_INDNTPOFF; - } - -- off = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), type); -- off = gen_rtx_CONST (Pmode, off); -+ off = gen_rtx_UNSPEC (tp_mode, gen_rtvec (1, x), type); -+ off = gen_rtx_CONST (tp_mode, off); - if (pic) -- off = gen_rtx_PLUS (Pmode, pic, off); -- off = gen_const_mem (Pmode, off); -+ off = gen_rtx_PLUS (tp_mode, pic, off); -+ off = gen_const_mem (tp_mode, off); - set_mem_alias_set (off, ix86_GOT_alias_set ()); - - if (TARGET_64BIT || TARGET_ANY_GNU_TLS) - { -- base = get_thread_pointer (for_mov || !TARGET_TLS_DIRECT_SEG_REFS); -- off = force_reg (Pmode, off); -- return gen_rtx_PLUS (Pmode, base, off); -+ base = get_thread_pointer (tp_mode, -+ for_mov || !TARGET_TLS_DIRECT_SEG_REFS); -+ off = force_reg (tp_mode, off); -+ return gen_rtx_PLUS (tp_mode, base, off); - } - else - { -- base = get_thread_pointer (true); -+ base = get_thread_pointer (Pmode, true); - dest = gen_reg_rtx (Pmode); - emit_insn (gen_subsi3 (dest, base, off)); - } -@@ -12696,12 +12821,13 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) - - if (TARGET_64BIT || TARGET_ANY_GNU_TLS) - { -- base = get_thread_pointer (for_mov || !TARGET_TLS_DIRECT_SEG_REFS); -+ base = get_thread_pointer (Pmode, -+ for_mov || !TARGET_TLS_DIRECT_SEG_REFS); - return gen_rtx_PLUS (Pmode, base, off); - } - else - { -- base = get_thread_pointer (true); -+ base = get_thread_pointer (Pmode, true); - dest = gen_reg_rtx (Pmode); - emit_insn (gen_subsi3 (dest, base, off)); - } -@@ -13756,6 +13882,7 @@ get_some_local_dynamic_name (void) - Z -- likewise, with special suffixes for x87 instructions. - * -- print a star (in certain assembler syntax) - A -- print an absolute memory reference. -+ E -- print address with DImode register names if TARGET_64BIT. - w -- print the operand as if it's a "word" (HImode) even if it isn't. - s -- print a shift double count, followed by the assemblers argument - delimiter. -@@ -13780,6 +13907,7 @@ get_some_local_dynamic_name (void) - ; -- print a semicolon (after prefixes due to bug in older gas). - ~ -- print "i" if TARGET_AVX2, "f" otherwise. - @ -- print a segment register of thread base pointer load -+ ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode - */ - - void -@@ -13831,7 +13959,14 @@ ix86_print_operand (FILE *file, rtx x, int code) - ix86_print_operand (file, x, 0); - return; - -+ case 'E': -+ /* Wrap address in an UNSPEC to declare special handling. */ -+ if (TARGET_64BIT) -+ x = gen_rtx_UNSPEC (DImode, gen_rtvec (1, x), UNSPEC_LEA_ADDR); - -+ output_address (x); -+ return; -+ - case 'L': - if (ASSEMBLER_DIALECT == ASM_ATT) - putc ('l', file); -@@ -14283,6 +14418,11 @@ ix86_print_operand (FILE *file, rtx x, int code) - putc (TARGET_AVX2 ? 'i' : 'f', file); - return; - -+ case '^': -+ if (TARGET_64BIT && Pmode != word_mode) -+ fputs ("addr32 ", file); -+ return; -+ - default: - output_operand_lossage ("invalid operand code '%c'", code); - } -@@ -14422,8 +14562,8 @@ ix86_print_operand (FILE *file, rtx x, int code) - static bool - ix86_print_operand_punct_valid_p (unsigned char code) - { -- return (code == '@' || code == '*' || code == '+' -- || code == '&' || code == ';' || code == '~'); -+ return (code == '@' || code == '*' || code == '+' || code == '&' -+ || code == ';' || code == '~' || code == '^'); - } - - /* Print a memory operand whose address is ADDR. */ -@@ -14436,6 +14576,7 @@ ix86_print_operand_address (FILE *file, rtx addr) - int scale; - int ok; - bool vsib = false; -+ int code = 0; - - if (GET_CODE (addr) == UNSPEC && XINT (addr, 1) == UNSPEC_VSIBADDR) - { -@@ -14446,6 +14587,12 @@ ix86_print_operand_address (FILE *file, rtx addr) - addr = XVECEXP (addr, 0, 0); - vsib = true; - } -+ else if (GET_CODE (addr) == UNSPEC && XINT (addr, 1) == UNSPEC_LEA_ADDR) -+ { -+ gcc_assert (TARGET_64BIT); -+ ok = ix86_decompose_address (XVECEXP (addr, 0, 0), &parts); -+ code = 'q'; -+ } - else - ok = ix86_decompose_address (addr, &parts); - -@@ -14516,15 +14663,15 @@ ix86_print_operand_address (FILE *file, rtx addr) - } - else - { -- int code = 0; -- -- /* Print SImode registers for zero-extended addresses to force -- addr32 prefix. Otherwise print DImode registers to avoid it. */ -- if (TARGET_64BIT) -- code = ((GET_CODE (addr) == ZERO_EXTEND -- || GET_CODE (addr) == AND) -- ? 'l' -- : 'q'); -+ /* Print SImode register names for zero-extended -+ addresses to force addr32 prefix. */ -+ if (TARGET_64BIT -+ && (GET_CODE (addr) == ZERO_EXTEND -+ || GET_CODE (addr) == AND)) -+ { -+ gcc_assert (!code); -+ code = 'l'; -+ } - - if (ASSEMBLER_DIALECT == ASM_ATT) - { -@@ -20299,7 +20446,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) - gcc_assert (ok); - - operand = copy_rtx (operand); -- PUT_MODE (operand, Pmode); -+ PUT_MODE (operand, word_mode); - parts[0] = parts[1] = parts[2] = parts[3] = operand; - return size; - } -@@ -20452,7 +20599,7 @@ ix86_split_long_move (rtx operands[]) - if (push_operand (operands[0], VOIDmode)) - { - operands[0] = copy_rtx (operands[0]); -- PUT_MODE (operands[0], Pmode); -+ PUT_MODE (operands[0], word_mode); - } - else - operands[0] = gen_lowpart (DImode, operands[0]); -@@ -21007,14 +21154,9 @@ ix86_adjust_counter (rtx countreg, HOST_WIDE_INT value) - rtx - ix86_zero_extend_to_Pmode (rtx exp) - { -- rtx r; -- if (GET_MODE (exp) == VOIDmode) -- return force_reg (Pmode, exp); -- if (GET_MODE (exp) == Pmode) -- return copy_to_mode_reg (Pmode, exp); -- r = gen_reg_rtx (Pmode); -- emit_insn (gen_zero_extendsidi2 (r, exp)); -- return r; -+ if (GET_MODE (exp) != Pmode) -+ exp = convert_to_mode (Pmode, exp, 1); -+ return force_reg (Pmode, exp); - } - - /* Divide COUNTREG by SCALE. */ -@@ -22042,11 +22184,11 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, - gcc_unreachable (); - case loop: - need_zero_guard = true; -- size_needed = GET_MODE_SIZE (Pmode); -+ size_needed = GET_MODE_SIZE (word_mode); - break; - case unrolled_loop: - need_zero_guard = true; -- size_needed = GET_MODE_SIZE (Pmode) * (TARGET_64BIT ? 4 : 2); -+ size_needed = GET_MODE_SIZE (word_mode) * (TARGET_64BIT ? 4 : 2); - break; - case rep_prefix_8_byte: - size_needed = 8; -@@ -22212,13 +22354,13 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, - break; - case loop: - expand_set_or_movmem_via_loop (dst, src, destreg, srcreg, NULL, -- count_exp, Pmode, 1, expected_size); -+ count_exp, word_mode, 1, expected_size); - break; - case unrolled_loop: - /* Unroll only by factor of 2 in 32bit mode, since we don't have enough - registers for 4 temporaries anyway. */ - expand_set_or_movmem_via_loop (dst, src, destreg, srcreg, NULL, -- count_exp, Pmode, TARGET_64BIT ? 4 : 2, -+ count_exp, word_mode, TARGET_64BIT ? 4 : 2, - expected_size); - break; - case rep_prefix_8_byte: -@@ -22430,11 +22572,11 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, - gcc_unreachable (); - case loop: - need_zero_guard = true; -- size_needed = GET_MODE_SIZE (Pmode); -+ size_needed = GET_MODE_SIZE (word_mode); - break; - case unrolled_loop: - need_zero_guard = true; -- size_needed = GET_MODE_SIZE (Pmode) * 4; -+ size_needed = GET_MODE_SIZE (word_mode) * 4; - break; - case rep_prefix_8_byte: - size_needed = 8; -@@ -22605,11 +22747,11 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, - break; - case loop: - expand_set_or_movmem_via_loop (dst, NULL, destreg, NULL, promoted_val, -- count_exp, Pmode, 1, expected_size); -+ count_exp, word_mode, 1, expected_size); - break; - case unrolled_loop: - expand_set_or_movmem_via_loop (dst, NULL, destreg, NULL, promoted_val, -- count_exp, Pmode, 4, expected_size); -+ count_exp, word_mode, 4, expected_size); - break; - case rep_prefix_8_byte: - expand_setmem_via_rep_stos (dst, destreg, promoted_val, count_exp, -@@ -22972,13 +23114,13 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, - && !local_symbolic_operand (XEXP (fnaddr, 0), VOIDmode)) - fnaddr = gen_rtx_MEM (QImode, construct_plt_address (XEXP (fnaddr, 0))); - else if (sibcall -- ? !sibcall_insn_operand (XEXP (fnaddr, 0), Pmode) -- : !call_insn_operand (XEXP (fnaddr, 0), Pmode)) -+ ? !sibcall_insn_operand (XEXP (fnaddr, 0), word_mode) -+ : !call_insn_operand (XEXP (fnaddr, 0), word_mode)) - { - fnaddr = XEXP (fnaddr, 0); -- if (GET_MODE (fnaddr) != Pmode) -- fnaddr = convert_to_mode (Pmode, fnaddr, 1); -- fnaddr = gen_rtx_MEM (QImode, copy_to_mode_reg (Pmode, fnaddr)); -+ if (GET_MODE (fnaddr) != word_mode) -+ fnaddr = convert_to_mode (word_mode, fnaddr, 1); -+ fnaddr = gen_rtx_MEM (QImode, copy_to_mode_reg (word_mode, fnaddr)); - } - - vec_len = 0; -@@ -24291,10 +24433,13 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) - /* Load the function address to r11. Try to load address using - the shorter movl instead of movabs. We may want to support - movq for kernel mode, but kernel does not use trampolines at -- the moment. */ -- if (x86_64_zext_immediate_operand (fnaddr, VOIDmode)) -+ the moment. FNADDR is a 32bit address and may not be in -+ DImode when ptr_mode == SImode. Always use movl in this -+ case. */ -+ if (ptr_mode == SImode -+ || x86_64_zext_immediate_operand (fnaddr, VOIDmode)) - { -- fnaddr = copy_to_mode_reg (DImode, fnaddr); -+ fnaddr = copy_to_mode_reg (Pmode, fnaddr); - - mem = adjust_address (m_tramp, HImode, offset); - emit_move_insn (mem, gen_int_mode (0xbb41, HImode)); -@@ -24313,9 +24458,9 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) - offset += 10; - } - -- /* Load static chain using movabs to r10. Use the -- shorter movl instead of movabs for x32. */ -- if (TARGET_X32) -+ /* Load static chain using movabs to r10. Use the shorter movl -+ instead of movabs when ptr_mode == SImode. */ -+ if (ptr_mode == SImode) - { - opcode = 0xba41; - size = 6; -@@ -31952,7 +32097,7 @@ x86_this_parameter (tree function) - parm_regs = x86_64_ms_abi_int_parameter_registers; - else - parm_regs = x86_64_int_parameter_registers; -- return gen_rtx_REG (DImode, parm_regs[aggr]); -+ return gen_rtx_REG (Pmode, parm_regs[aggr]); - } - - nregs = ix86_function_regparm (type, function); ---- a/gcc/config/i386/i386.h -+++ b/gcc/config/i386/i386.h -@@ -42,7 +42,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - /* Redefines for option macros. */ - - #define TARGET_64BIT OPTION_ISA_64BIT --#define TARGET_X32 OPTION_ISA_X32 - #define TARGET_MMX OPTION_ISA_MMX - #define TARGET_3DNOW OPTION_ISA_3DNOW - #define TARGET_3DNOW_A OPTION_ISA_3DNOW_A -@@ -76,7 +75,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - #define TARGET_RDRND OPTION_ISA_RDRND - #define TARGET_F16C OPTION_ISA_F16C - --#define TARGET_LP64 (TARGET_64BIT && !TARGET_X32) -+#define TARGET_LP64 OPTION_ABI_64 -+#define TARGET_X32 OPTION_ABI_X32 - - /* SSE4.1 defines round instructions */ - #define OPTION_MASK_ISA_ROUND OPTION_MASK_ISA_SSE4_1 -@@ -1760,7 +1760,7 @@ do { \ - /* Specify the machine mode that pointers have. - After generation of rtl, the compiler makes no further distinction - between pointers and any other objects of this machine mode. */ --#define Pmode (TARGET_64BIT ? DImode : SImode) -+#define Pmode (ix86_pmode == PMODE_DI ? DImode : SImode) - - /* A C expression whose value is zero if pointers that need to be extended - from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and ---- a/gcc/config/i386/i386.md -+++ b/gcc/config/i386/i386.md -@@ -38,6 +38,7 @@ - ;; Z -- likewise, with special suffixes for x87 instructions. - ;; * -- print a star (in certain assembler syntax) - ;; A -- print an absolute memory reference. -+;; E -- print address with DImode register names if TARGET_64BIT. - ;; w -- print the operand as if it's a "word" (HImode) even if it isn't. - ;; s -- print a shift double count, followed by the assemblers argument - ;; delimiter. -@@ -60,7 +61,9 @@ - ;; Y -- print condition for XOP pcom* instruction. - ;; + -- print a branch hint as 'cs' or 'ds' prefix - ;; ; -- print a semicolon (after prefixes due to bug in older gas). -+;; ~ -- print "i" if TARGET_AVX2, "f" otherwise. - ;; @ -- print a segment register of thread base pointer load -+;; ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode - - (define_c_enum "unspec" [ - ;; Relocation specifiers -@@ -109,6 +112,7 @@ - UNSPEC_CALL_NEEDS_VZEROUPPER - UNSPEC_PAUSE - UNSPEC_XBEGIN_ABORT -+ UNSPEC_LEA_ADDR - - ;; For SSE/MMX support: - UNSPEC_FIX_NOTRUNC -@@ -892,6 +896,11 @@ - ;; pointer-sized quantities. Exactly one of the two alternatives will match. - (define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")]) - -+;; This mode iterator allows :W to be used for patterns that operate on -+;; word_mode sized quantities. -+(define_mode_iterator W -+ [(SI "word_mode == SImode") (DI "word_mode == DImode")]) -+ - ;; This mode iterator allows :PTR to be used for patterns that operate on - ;; ptr_mode sized quantities. - (define_mode_iterator PTR -@@ -1700,8 +1709,8 @@ - (set_attr "mode" "SI")]) - - (define_insn "*push2_prologue" -- [(set (match_operand:P 0 "push_operand" "=<") -- (match_operand:P 1 "general_no_elim_operand" "r*m")) -+ [(set (match_operand:W 0 "push_operand" "=<") -+ (match_operand:W 1 "general_no_elim_operand" "r*m")) - (clobber (mem:BLK (scratch)))] - "" - "push{}\t%1" -@@ -1709,16 +1718,16 @@ - (set_attr "mode" "")]) - - (define_insn "*pop1" -- [(set (match_operand:P 0 "nonimmediate_operand" "=r*m") -- (match_operand:P 1 "pop_operand" ">"))] -+ [(set (match_operand:W 0 "nonimmediate_operand" "=r*m") -+ (match_operand:W 1 "pop_operand" ">"))] - "" - "pop{}\t%0" - [(set_attr "type" "pop") - (set_attr "mode" "")]) - - (define_insn "*pop1_epilogue" -- [(set (match_operand:P 0 "nonimmediate_operand" "=r*m") -- (match_operand:P 1 "pop_operand" ">")) -+ [(set (match_operand:W 0 "nonimmediate_operand" "=r*m") -+ (match_operand:W 1 "pop_operand" ">")) - (clobber (mem:BLK (scratch)))] - "" - "pop{}\t%0" -@@ -1958,7 +1967,7 @@ - return "#"; - - case TYPE_LEA: -- return "lea{q}\t{%a1, %0|%0, %a1}"; -+ return "lea{q}\t{%E1, %0|%0, %E1}"; - - default: - gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); -@@ -1967,7 +1976,7 @@ - else if (which_alternative == 2) - return "movabs{q}\t{%1, %0|%0, %1}"; - else if (ix86_use_lea_for_mov (insn, operands)) -- return "lea{q}\t{%a1, %0|%0, %a1}"; -+ return "lea{q}\t{%E1, %0|%0, %E1}"; - else - return "mov{q}\t{%1, %0|%0, %1}"; - } -@@ -2199,12 +2208,12 @@ - return "movd\t{%1, %0|%0, %1}"; - - case TYPE_LEA: -- return "lea{l}\t{%a1, %0|%0, %a1}"; -+ return "lea{l}\t{%E1, %0|%0, %E1}"; - - default: - gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); - if (ix86_use_lea_for_mov (insn, operands)) -- return "lea{l}\t{%a1, %0|%0, %a1}"; -+ return "lea{l}\t{%E1, %0|%0, %E1}"; - else - return "mov{l}\t{%1, %0|%0, %1}"; - } -@@ -3382,7 +3391,7 @@ - "=r,o,?*Ym,?*y,?*Yi,?*x") - (zero_extend:DI - (match_operand:SI 1 "nonimmediate_operand" -- "rm,0,r ,m ,r ,m")))] -+ "rmWz,0,r ,m ,r ,m")))] - "TARGET_64BIT" - "@ - mov{l}\t{%1, %k0|%k0, %1} -@@ -5437,7 +5446,7 @@ - [(set (match_operand:SI 0 "register_operand" "=r") - (subreg:SI (match_operand:DI 1 "lea_address_operand" "p") 0))] - "TARGET_64BIT" -- "lea{l}\t{%a1, %0|%0, %a1}" -+ "lea{l}\t{%E1, %0|%0, %E1}" - "&& reload_completed && ix86_avoid_lea_for_addr (insn, operands)" - [(const_int 0)] - { -@@ -5451,7 +5460,7 @@ - [(set (match_operand:SWI48 0 "register_operand" "=r") - (match_operand:SWI48 1 "lea_address_operand" "p"))] - "" -- "lea{}\t{%a1, %0|%0, %a1}" -+ "lea{}\t{%E1, %0|%0, %E1}" - "reload_completed && ix86_avoid_lea_for_addr (insn, operands)" - [(const_int 0)] - { -@@ -5466,7 +5475,7 @@ - (zero_extend:DI - (subreg:SI (match_operand:DI 1 "lea_address_operand" "j") 0)))] - "TARGET_64BIT" -- "lea{l}\t{%a1, %k0|%k0, %a1}" -+ "lea{l}\t{%E1, %k0|%k0, %E1}" - [(set_attr "type" "lea") - (set_attr "mode" "SI")]) - -@@ -5475,7 +5484,7 @@ - (zero_extend:DI - (match_operand:SI 1 "lea_address_operand" "j")))] - "TARGET_64BIT" -- "lea{l}\t{%a1, %k0|%k0, %a1}" -+ "lea{l}\t{%E1, %k0|%k0, %E1}" - [(set_attr "type" "lea") - (set_attr "mode" "SI")]) - -@@ -5485,7 +5494,7 @@ - (subreg:DI (match_operand:SI 1 "lea_address_operand" "p") 0) - (match_operand:DI 2 "const_32bit_mask" "n")))] - "TARGET_64BIT" -- "lea{l}\t{%a1, %k0|%k0, %a1}" -+ "lea{l}\t{%E1, %k0|%k0, %E1}" - [(set_attr "type" "lea") - (set_attr "mode" "SI")]) - -@@ -5495,7 +5504,7 @@ - (match_operand:DI 1 "lea_address_operand" "p") - (match_operand:DI 2 "const_32bit_mask" "n")))] - "TARGET_64BIT" -- "lea{l}\t{%a1, %k0|%k0, %a1}" -+ "lea{l}\t{%E1, %k0|%k0, %E1}" - [(set_attr "type" "lea") - (set_attr "mode" "SI")]) - -@@ -11130,10 +11139,15 @@ - (set_attr "modrm" "0")]) - - (define_expand "indirect_jump" -- [(set (pc) (match_operand 0 "indirect_branch_operand" ""))]) -+ [(set (pc) (match_operand 0 "indirect_branch_operand" ""))] -+ "" -+{ -+ if (TARGET_X32) -+ operands[0] = convert_memory_address (word_mode, operands[0]); -+}) - - (define_insn "*indirect_jump" -- [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw"))] -+ [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw"))] - "" - "jmp\t%A0" - [(set_attr "type" "ibr") -@@ -11175,12 +11189,13 @@ - operands[0] = expand_simple_binop (Pmode, code, op0, op1, NULL_RTX, 0, - OPTAB_DIRECT); - } -- else if (TARGET_X32) -- operands[0] = convert_memory_address (Pmode, operands[0]); -+ -+ if (TARGET_X32) -+ operands[0] = convert_memory_address (word_mode, operands[0]); - }) - - (define_insn "*tablejump_1" -- [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw")) -+ [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw")) - (use (label_ref (match_operand 1 "" "")))] - "" - "jmp\t%A0" -@@ -11268,7 +11283,7 @@ - }) - - (define_insn_and_split "*call_vzeroupper" -- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "zw")) -+ [(call (mem:QI (match_operand:W 0 "call_insn_operand" "zw")) - (match_operand 1 "" "")) - (unspec [(match_operand 2 "const_int_operand" "")] - UNSPEC_CALL_NEEDS_VZEROUPPER)] -@@ -11280,7 +11295,7 @@ - [(set_attr "type" "call")]) - - (define_insn "*call" -- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "zw")) -+ [(call (mem:QI (match_operand:W 0 "call_insn_operand" "zw")) - (match_operand 1 "" ""))] - "!SIBLING_CALL_P (insn)" - "* return ix86_output_call_insn (insn, operands[0]);" -@@ -11332,7 +11347,7 @@ - [(set_attr "type" "call")]) - - (define_insn_and_split "*sibcall_vzeroupper" -- [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz")) -+ [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz")) - (match_operand 1 "" "")) - (unspec [(match_operand 2 "const_int_operand" "")] - UNSPEC_CALL_NEEDS_VZEROUPPER)] -@@ -11344,7 +11359,7 @@ - [(set_attr "type" "call")]) - - (define_insn "*sibcall" -- [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz")) -+ [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz")) - (match_operand 1 "" ""))] - "SIBLING_CALL_P (insn)" - "* return ix86_output_call_insn (insn, operands[0]);" -@@ -11441,7 +11456,7 @@ - - (define_insn_and_split "*call_value_vzeroupper" - [(set (match_operand 0 "" "") -- (call (mem:QI (match_operand:P 1 "call_insn_operand" "zw")) -+ (call (mem:QI (match_operand:W 1 "call_insn_operand" "zw")) - (match_operand 2 "" ""))) - (unspec [(match_operand 3 "const_int_operand" "")] - UNSPEC_CALL_NEEDS_VZEROUPPER)] -@@ -11454,7 +11469,7 @@ - - (define_insn "*call_value" - [(set (match_operand 0 "" "") -- (call (mem:QI (match_operand:P 1 "call_insn_operand" "zw")) -+ (call (mem:QI (match_operand:W 1 "call_insn_operand" "zw")) - (match_operand 2 "" "")))] - "!SIBLING_CALL_P (insn)" - "* return ix86_output_call_insn (insn, operands[1]);" -@@ -11462,7 +11477,7 @@ - - (define_insn_and_split "*sibcall_value_vzeroupper" - [(set (match_operand 0 "" "") -- (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz")) -+ (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz")) - (match_operand 2 "" ""))) - (unspec [(match_operand 3 "const_int_operand" "")] - UNSPEC_CALL_NEEDS_VZEROUPPER)] -@@ -11475,7 +11490,7 @@ - - (define_insn "*sibcall_value" - [(set (match_operand 0 "" "") -- (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz")) -+ (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz")) - (match_operand 2 "" "")))] - "SIBLING_CALL_P (insn)" - "* return ix86_output_call_insn (insn, operands[1]);" -@@ -12580,7 +12595,7 @@ - [(set (match_operand:SI 0 "register_operand" "=a") - (unspec:SI - [(match_operand:SI 1 "register_operand" "b") -- (match_operand:SI 2 "tls_symbolic_operand" "") -+ (match_operand 2 "tls_symbolic_operand" "") - (match_operand:SI 3 "constant_call_address_operand" "z")] - UNSPEC_TLS_GD)) - (clobber (match_scratch:SI 4 "=d")) -@@ -12589,7 +12604,7 @@ - "!TARGET_64BIT && TARGET_GNU_TLS" - { - output_asm_insn -- ("lea{l}\t{%a2@tlsgd(,%1,1), %0|%0, %a2@tlsgd[%1*1]}", operands); -+ ("lea{l}\t{%E2@tlsgd(,%1,1), %0|%0, %E2@tlsgd[%1*1]}", operands); - if (TARGET_SUN_TLS) - #ifdef HAVE_AS_IX86_TLSGDPLT - return "call\t%a2@tlsgdplt"; -@@ -12605,26 +12620,26 @@ - [(parallel - [(set (match_operand:SI 0 "register_operand" "") - (unspec:SI [(match_operand:SI 2 "register_operand" "") -- (match_operand:SI 1 "tls_symbolic_operand" "") -+ (match_operand 1 "tls_symbolic_operand" "") - (match_operand:SI 3 "constant_call_address_operand" "")] - UNSPEC_TLS_GD)) - (clobber (match_scratch:SI 4 "")) - (clobber (match_scratch:SI 5 "")) - (clobber (reg:CC FLAGS_REG))])]) - --(define_insn "*tls_global_dynamic_64" -- [(set (match_operand:DI 0 "register_operand" "=a") -- (call:DI -- (mem:QI (match_operand:DI 2 "constant_call_address_operand" "z")) -- (match_operand:DI 3 "" ""))) -- (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] -- UNSPEC_TLS_GD)] -+(define_insn "*tls_global_dynamic_64_" -+ [(set (match_operand:P 0 "register_operand" "=a") -+ (call:P -+ (mem:QI (match_operand:P 2 "constant_call_address_operand" "z")) -+ (match_operand:P 3 "" ""))) -+ (unspec:P [(match_operand 1 "tls_symbolic_operand" "")] -+ UNSPEC_TLS_GD)] - "TARGET_64BIT" - { - if (!TARGET_X32) - fputs (ASM_BYTE "0x66\n", asm_out_file); - output_asm_insn -- ("lea{q}\t{%a1@tlsgd(%%rip), %%rdi|rdi, %a1@tlsgd[rip]}", operands); -+ ("lea{q}\t{%E1@tlsgd(%%rip), %%rdi|rdi, %E1@tlsgd[rip]}", operands); - fputs (ASM_SHORT "0x6666\n", asm_out_file); - fputs ("\trex64\n", asm_out_file); - if (TARGET_SUN_TLS) -@@ -12635,14 +12650,15 @@ - (set (attr "length") - (symbol_ref "TARGET_X32 ? 15 : 16"))]) - --(define_expand "tls_global_dynamic_64" -+(define_expand "tls_global_dynamic_64_" - [(parallel -- [(set (match_operand:DI 0 "register_operand" "") -- (call:DI -- (mem:QI (match_operand:DI 2 "constant_call_address_operand" "")) -+ [(set (match_operand:P 0 "register_operand" "") -+ (call:P -+ (mem:QI (match_operand:P 2 "constant_call_address_operand" "")) - (const_int 0))) -- (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] -- UNSPEC_TLS_GD)])]) -+ (unspec:P [(match_operand 1 "tls_symbolic_operand" "")] -+ UNSPEC_TLS_GD)])] -+ "TARGET_64BIT") - - (define_insn "*tls_local_dynamic_base_32_gnu" - [(set (match_operand:SI 0 "register_operand" "=a") -@@ -12679,12 +12695,12 @@ - (clobber (match_scratch:SI 4 "")) - (clobber (reg:CC FLAGS_REG))])]) - --(define_insn "*tls_local_dynamic_base_64" -- [(set (match_operand:DI 0 "register_operand" "=a") -- (call:DI -- (mem:QI (match_operand:DI 1 "constant_call_address_operand" "z")) -- (match_operand:DI 2 "" ""))) -- (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)] -+(define_insn "*tls_local_dynamic_base_64_" -+ [(set (match_operand:P 0 "register_operand" "=a") -+ (call:P -+ (mem:QI (match_operand:P 1 "constant_call_address_operand" "z")) -+ (match_operand:P 2 "" ""))) -+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)] - "TARGET_64BIT" - { - output_asm_insn -@@ -12696,13 +12712,14 @@ - [(set_attr "type" "multi") - (set_attr "length" "12")]) - --(define_expand "tls_local_dynamic_base_64" -+(define_expand "tls_local_dynamic_base_64_" - [(parallel -- [(set (match_operand:DI 0 "register_operand" "") -- (call:DI -- (mem:QI (match_operand:DI 1 "constant_call_address_operand" "")) -+ [(set (match_operand:P 0 "register_operand" "") -+ (call:P -+ (mem:QI (match_operand:P 1 "constant_call_address_operand" "")) - (const_int 0))) -- (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)])]) -+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)])] -+ "TARGET_64BIT") - - ;; Local dynamic of a single variable is a lose. Show combine how - ;; to convert that back to global dynamic. -@@ -12714,7 +12731,7 @@ - (match_operand:SI 2 "constant_call_address_operand" "z")] - UNSPEC_TLS_LD_BASE) - (const:SI (unspec:SI -- [(match_operand:SI 3 "tls_symbolic_operand" "")] -+ [(match_operand 3 "tls_symbolic_operand" "")] - UNSPEC_DTPOFF)))) - (clobber (match_scratch:SI 4 "=d")) - (clobber (match_scratch:SI 5 "=c")) -@@ -12812,7 +12829,7 @@ - (define_insn "tls_initial_exec_64_sun" - [(set (match_operand:DI 0 "register_operand" "=a") - (unspec:DI -- [(match_operand:DI 1 "tls_symbolic_operand" "")] -+ [(match_operand 1 "tls_symbolic_operand" "")] - UNSPEC_TLS_IE_SUN)) - (clobber (reg:CC FLAGS_REG))] - "TARGET_64BIT && TARGET_SUN_TLS" -@@ -12829,7 +12846,7 @@ - [(set (match_dup 3) - (plus:SI (match_operand:SI 2 "register_operand" "") - (const:SI -- (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "")] -+ (unspec:SI [(match_operand 1 "tls_symbolic_operand" "")] - UNSPEC_TLSDESC)))) - (parallel - [(set (match_operand:SI 0 "register_operand" "") -@@ -12847,10 +12864,10 @@ - [(set (match_operand:SI 0 "register_operand" "=r") - (plus:SI (match_operand:SI 1 "register_operand" "b") - (const:SI -- (unspec:SI [(match_operand:SI 2 "tls_symbolic_operand" "")] -+ (unspec:SI [(match_operand 2 "tls_symbolic_operand" "")] - UNSPEC_TLSDESC))))] - "!TARGET_64BIT && TARGET_GNU2_TLS" -- "lea{l}\t{%a2@TLSDESC(%1), %0|%0, %a2@TLSDESC[%1]}" -+ "lea{l}\t{%E2@TLSDESC(%1), %0|%0, %E2@TLSDESC[%1]}" - [(set_attr "type" "lea") - (set_attr "mode" "SI") - (set_attr "length" "6") -@@ -12858,7 +12875,7 @@ - - (define_insn "*tls_dynamic_gnu2_call_32" - [(set (match_operand:SI 0 "register_operand" "=a") -- (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "") -+ (unspec:SI [(match_operand 1 "tls_symbolic_operand" "") - (match_operand:SI 2 "register_operand" "0") - ;; we have to make sure %ebx still points to the GOT - (match_operand:SI 3 "register_operand" "b") -@@ -12874,13 +12891,13 @@ - (define_insn_and_split "*tls_dynamic_gnu2_combine_32" - [(set (match_operand:SI 0 "register_operand" "=&a") - (plus:SI -- (unspec:SI [(match_operand:SI 3 "tls_modbase_operand" "") -+ (unspec:SI [(match_operand 3 "tls_modbase_operand" "") - (match_operand:SI 4 "" "") - (match_operand:SI 2 "register_operand" "b") - (reg:SI SP_REG)] - UNSPEC_TLSDESC) - (const:SI (unspec:SI -- [(match_operand:SI 1 "tls_symbolic_operand" "")] -+ [(match_operand 1 "tls_symbolic_operand" "")] - UNSPEC_DTPOFF)))) - (clobber (reg:CC FLAGS_REG))] - "!TARGET_64BIT && TARGET_GNU2_TLS" -@@ -12912,7 +12929,7 @@ - (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] - UNSPEC_TLSDESC))] - "TARGET_64BIT && TARGET_GNU2_TLS" -- "lea{q}\t{%a1@TLSDESC(%%rip), %0|%0, %a1@TLSDESC[rip]}" -+ "lea{q}\t{%E1@TLSDESC(%%rip), %0|%0, %E1@TLSDESC[rip]}" - [(set_attr "type" "lea") - (set_attr "mode" "DI") - (set_attr "length" "7") -@@ -12934,7 +12951,7 @@ - (define_insn_and_split "*tls_dynamic_gnu2_combine_64" - [(set (match_operand:DI 0 "register_operand" "=&a") - (plus:DI -- (unspec:DI [(match_operand:DI 2 "tls_modbase_operand" "") -+ (unspec:DI [(match_operand 2 "tls_modbase_operand" "") - (match_operand:DI 3 "" "") - (reg:DI SP_REG)] - UNSPEC_TLSDESC) -@@ -15733,17 +15750,17 @@ - "ix86_current_function_needs_cld = 1;") - - (define_insn "*strmovdi_rex_1" -- [(set (mem:DI (match_operand:DI 2 "register_operand" "0")) -- (mem:DI (match_operand:DI 3 "register_operand" "1"))) -- (set (match_operand:DI 0 "register_operand" "=D") -- (plus:DI (match_dup 2) -- (const_int 8))) -- (set (match_operand:DI 1 "register_operand" "=S") -- (plus:DI (match_dup 3) -- (const_int 8)))] -+ [(set (mem:DI (match_operand:P 2 "register_operand" "0")) -+ (mem:DI (match_operand:P 3 "register_operand" "1"))) -+ (set (match_operand:P 0 "register_operand" "=D") -+ (plus:P (match_dup 2) -+ (const_int 8))) -+ (set (match_operand:P 1 "register_operand" "=S") -+ (plus:P (match_dup 3) -+ (const_int 8)))] - "TARGET_64BIT - && !(fixed_regs[SI_REG] || fixed_regs[DI_REG])" -- "movsq" -+ "%^movsq" - [(set_attr "type" "str") - (set_attr "memory" "both") - (set_attr "mode" "DI")]) -@@ -15758,7 +15775,7 @@ - (plus:P (match_dup 3) - (const_int 4)))] - "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])" -- "movs{l|d}" -+ "%^movs{l|d}" - [(set_attr "type" "str") - (set_attr "memory" "both") - (set_attr "mode" "SI")]) -@@ -15773,7 +15790,7 @@ - (plus:P (match_dup 3) - (const_int 2)))] - "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])" -- "movsw" -+ "%^movsw" - [(set_attr "type" "str") - (set_attr "memory" "both") - (set_attr "mode" "HI")]) -@@ -15788,7 +15805,7 @@ - (plus:P (match_dup 3) - (const_int 1)))] - "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])" -- "movsb" -+ "%^movsb" - [(set_attr "type" "str") - (set_attr "memory" "both") - (set (attr "prefix_rex") -@@ -15811,20 +15828,20 @@ - "ix86_current_function_needs_cld = 1;") - - (define_insn "*rep_movdi_rex64" -- [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0)) -- (set (match_operand:DI 0 "register_operand" "=D") -- (plus:DI (ashift:DI (match_operand:DI 5 "register_operand" "2") -- (const_int 3)) -- (match_operand:DI 3 "register_operand" "0"))) -- (set (match_operand:DI 1 "register_operand" "=S") -- (plus:DI (ashift:DI (match_dup 5) (const_int 3)) -- (match_operand:DI 4 "register_operand" "1"))) -+ [(set (match_operand:P 2 "register_operand" "=c") (const_int 0)) -+ (set (match_operand:P 0 "register_operand" "=D") -+ (plus:P (ashift:P (match_operand:P 5 "register_operand" "2") -+ (const_int 3)) -+ (match_operand:P 3 "register_operand" "0"))) -+ (set (match_operand:P 1 "register_operand" "=S") -+ (plus:P (ashift:P (match_dup 5) (const_int 3)) -+ (match_operand:P 4 "register_operand" "1"))) - (set (mem:BLK (match_dup 3)) - (mem:BLK (match_dup 4))) - (use (match_dup 5))] - "TARGET_64BIT - && !(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" -- "rep{%;} movsq" -+ "%^rep{%;} movsq" - [(set_attr "type" "str") - (set_attr "prefix_rep" "1") - (set_attr "memory" "both") -@@ -15843,7 +15860,7 @@ - (mem:BLK (match_dup 4))) - (use (match_dup 5))] - "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" -- "rep{%;} movs{l|d}" -+ "%^rep{%;} movs{l|d}" - [(set_attr "type" "str") - (set_attr "prefix_rep" "1") - (set_attr "memory" "both") -@@ -15860,7 +15877,7 @@ - (mem:BLK (match_dup 4))) - (use (match_dup 5))] - "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" -- "rep{%;} movsb" -+ "%^rep{%;} movsb" - [(set_attr "type" "str") - (set_attr "prefix_rep" "1") - (set_attr "memory" "both") -@@ -15921,14 +15938,14 @@ - "ix86_current_function_needs_cld = 1;") - - (define_insn "*strsetdi_rex_1" -- [(set (mem:DI (match_operand:DI 1 "register_operand" "0")) -+ [(set (mem:DI (match_operand:P 1 "register_operand" "0")) - (match_operand:DI 2 "register_operand" "a")) -- (set (match_operand:DI 0 "register_operand" "=D") -- (plus:DI (match_dup 1) -- (const_int 8)))] -+ (set (match_operand:P 0 "register_operand" "=D") -+ (plus:P (match_dup 1) -+ (const_int 8)))] - "TARGET_64BIT - && !(fixed_regs[AX_REG] || fixed_regs[DI_REG])" -- "stosq" -+ "%^stosq" - [(set_attr "type" "str") - (set_attr "memory" "store") - (set_attr "mode" "DI")]) -@@ -15940,7 +15957,7 @@ - (plus:P (match_dup 1) - (const_int 4)))] - "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" -- "stos{l|d}" -+ "%^stos{l|d}" - [(set_attr "type" "str") - (set_attr "memory" "store") - (set_attr "mode" "SI")]) -@@ -15952,7 +15969,7 @@ - (plus:P (match_dup 1) - (const_int 2)))] - "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" -- "stosw" -+ "%^stosw" - [(set_attr "type" "str") - (set_attr "memory" "store") - (set_attr "mode" "HI")]) -@@ -15964,7 +15981,7 @@ - (plus:P (match_dup 1) - (const_int 1)))] - "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" -- "stosb" -+ "%^stosb" - [(set_attr "type" "str") - (set_attr "memory" "store") - (set (attr "prefix_rex") -@@ -15985,18 +16002,18 @@ - "ix86_current_function_needs_cld = 1;") - - (define_insn "*rep_stosdi_rex64" -- [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0)) -- (set (match_operand:DI 0 "register_operand" "=D") -- (plus:DI (ashift:DI (match_operand:DI 4 "register_operand" "1") -- (const_int 3)) -- (match_operand:DI 3 "register_operand" "0"))) -+ [(set (match_operand:P 1 "register_operand" "=c") (const_int 0)) -+ (set (match_operand:P 0 "register_operand" "=D") -+ (plus:P (ashift:P (match_operand:P 4 "register_operand" "1") -+ (const_int 3)) -+ (match_operand:P 3 "register_operand" "0"))) - (set (mem:BLK (match_dup 3)) - (const_int 0)) - (use (match_operand:DI 2 "register_operand" "a")) - (use (match_dup 4))] - "TARGET_64BIT - && !(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" -- "rep{%;} stosq" -+ "%^rep{%;} stosq" - [(set_attr "type" "str") - (set_attr "prefix_rep" "1") - (set_attr "memory" "store") -@@ -16013,7 +16030,7 @@ - (use (match_operand:SI 2 "register_operand" "a")) - (use (match_dup 4))] - "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" -- "rep{%;} stos{l|d}" -+ "%^rep{%;} stos{l|d}" - [(set_attr "type" "str") - (set_attr "prefix_rep" "1") - (set_attr "memory" "store") -@@ -16029,7 +16046,7 @@ - (use (match_operand:QI 2 "register_operand" "a")) - (use (match_dup 4))] - "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" -- "rep{%;} stosb" -+ "%^rep{%;} stosb" - [(set_attr "type" "str") - (set_attr "prefix_rep" "1") - (set_attr "memory" "store") -@@ -16150,7 +16167,7 @@ - (clobber (match_operand:P 1 "register_operand" "=D")) - (clobber (match_operand:P 2 "register_operand" "=c"))] - "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" -- "repz{%;} cmpsb" -+ "%^repz{%;} cmpsb" - [(set_attr "type" "str") - (set_attr "mode" "QI") - (set (attr "prefix_rex") -@@ -16190,7 +16207,7 @@ - (clobber (match_operand:P 1 "register_operand" "=D")) - (clobber (match_operand:P 2 "register_operand" "=c"))] - "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" -- "repz{%;} cmpsb" -+ "%^repz{%;} cmpsb" - [(set_attr "type" "str") - (set_attr "mode" "QI") - (set (attr "prefix_rex") -@@ -16231,7 +16248,7 @@ - (clobber (match_operand:P 1 "register_operand" "=D")) - (clobber (reg:CC FLAGS_REG))] - "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" -- "repnz{%;} scasb" -+ "%^repnz{%;} scasb" - [(set_attr "type" "str") - (set_attr "mode" "QI") - (set (attr "prefix_rex") -@@ -16663,7 +16680,7 @@ - - default: - operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0)); -- return "lea{}\t{%a2, %0|%0, %a2}"; -+ return "lea{}\t{%E2, %0|%0, %E2}"; - } - } - [(set (attr "type") -@@ -17391,131 +17408,131 @@ - ;; alternative when no register is available later. - - (define_peephole2 -- [(match_scratch:P 1 "r") -+ [(match_scratch:W 1 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "(TARGET_SINGLE_PUSH || optimize_insn_for_size_p ()) -- && INTVAL (operands[0]) == -GET_MODE_SIZE (Pmode)" -+ && INTVAL (operands[0]) == -GET_MODE_SIZE (word_mode)" - [(clobber (match_dup 1)) -- (parallel [(set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) -+ (parallel [(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1)) - (clobber (mem:BLK (scratch)))])]) - - (define_peephole2 -- [(match_scratch:P 1 "r") -+ [(match_scratch:W 1 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "(TARGET_DOUBLE_PUSH || optimize_insn_for_size_p ()) -- && INTVAL (operands[0]) == -2*GET_MODE_SIZE (Pmode)" -+ && INTVAL (operands[0]) == -2*GET_MODE_SIZE (word_mode)" - [(clobber (match_dup 1)) -- (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) -- (parallel [(set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) -+ (set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1)) -+ (parallel [(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1)) - (clobber (mem:BLK (scratch)))])]) - - ;; Convert esp subtractions to push. - (define_peephole2 -- [(match_scratch:P 1 "r") -+ [(match_scratch:W 1 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] - "(TARGET_SINGLE_PUSH || optimize_insn_for_size_p ()) -- && INTVAL (operands[0]) == -GET_MODE_SIZE (Pmode)" -+ && INTVAL (operands[0]) == -GET_MODE_SIZE (word_mode)" - [(clobber (match_dup 1)) -- (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) -+ (set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) - - (define_peephole2 -- [(match_scratch:P 1 "r") -+ [(match_scratch:W 1 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] - "(TARGET_DOUBLE_PUSH || optimize_insn_for_size_p ()) -- && INTVAL (operands[0]) == -2*GET_MODE_SIZE (Pmode)" -+ && INTVAL (operands[0]) == -2*GET_MODE_SIZE (word_mode)" - [(clobber (match_dup 1)) -- (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) -- (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) -+ (set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1)) -+ (set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) - - ;; Convert epilogue deallocator to pop. - (define_peephole2 -- [(match_scratch:P 1 "r") -+ [(match_scratch:W 1 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "(TARGET_SINGLE_POP || optimize_insn_for_size_p ()) -- && INTVAL (operands[0]) == GET_MODE_SIZE (Pmode)" -- [(parallel [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) -+ && INTVAL (operands[0]) == GET_MODE_SIZE (word_mode)" -+ [(parallel [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) - (clobber (mem:BLK (scratch)))])]) - - ;; Two pops case is tricky, since pop causes dependency - ;; on destination register. We use two registers if available. - (define_peephole2 -- [(match_scratch:P 1 "r") -- (match_scratch:P 2 "r") -+ [(match_scratch:W 1 "r") -+ (match_scratch:W 2 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "(TARGET_DOUBLE_POP || optimize_insn_for_size_p ()) -- && INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" -- [(parallel [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) -+ && INTVAL (operands[0]) == 2*GET_MODE_SIZE (word_mode)" -+ [(parallel [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) - (clobber (mem:BLK (scratch)))]) -- (set (match_dup 2) (mem:P (post_inc:P (reg:P SP_REG))))]) -+ (set (match_dup 2) (mem:W (post_inc:P (reg:P SP_REG))))]) - - (define_peephole2 -- [(match_scratch:P 1 "r") -+ [(match_scratch:W 1 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG)) - (clobber (mem:BLK (scratch)))])] - "optimize_insn_for_size_p () -- && INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" -- [(parallel [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) -+ && INTVAL (operands[0]) == 2*GET_MODE_SIZE (word_mode)" -+ [(parallel [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) - (clobber (mem:BLK (scratch)))]) -- (set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG))))]) -+ (set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG))))]) - - ;; Convert esp additions to pop. - (define_peephole2 -- [(match_scratch:P 1 "r") -+ [(match_scratch:W 1 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] -- "INTVAL (operands[0]) == GET_MODE_SIZE (Pmode)" -- [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG))))]) -+ "INTVAL (operands[0]) == GET_MODE_SIZE (word_mode)" -+ [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG))))]) - - ;; Two pops case is tricky, since pop causes dependency - ;; on destination register. We use two registers if available. - (define_peephole2 -- [(match_scratch:P 1 "r") -- (match_scratch:P 2 "r") -+ [(match_scratch:W 1 "r") -+ (match_scratch:W 2 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] -- "INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" -- [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) -- (set (match_dup 2) (mem:P (post_inc:P (reg:P SP_REG))))]) -+ "INTVAL (operands[0]) == 2*GET_MODE_SIZE (word_mode)" -+ [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) -+ (set (match_dup 2) (mem:W (post_inc:P (reg:P SP_REG))))]) - - (define_peephole2 -- [(match_scratch:P 1 "r") -+ [(match_scratch:W 1 "r") - (parallel [(set (reg:P SP_REG) - (plus:P (reg:P SP_REG) - (match_operand:P 0 "const_int_operand" ""))) - (clobber (reg:CC FLAGS_REG))])] - "optimize_insn_for_size_p () -- && INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" -- [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) -- (set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG))))]) -+ && INTVAL (operands[0]) == 2*GET_MODE_SIZE (word_mode)" -+ [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) -+ (set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG))))]) - - ;; Convert compares with 1 to shorter inc/dec operations when CF is not - ;; required and register dies. Similarly for 128 to -128. -@@ -17626,7 +17643,7 @@ - ;; leal (%edx,%eax,4), %eax - - (define_peephole2 -- [(match_scratch:P 5 "r") -+ [(match_scratch:W 5 "r") - (parallel [(set (match_operand 0 "register_operand" "") - (ashift (match_operand 1 "register_operand" "") - (match_operand 2 "const_int_operand" ""))) -@@ -17652,16 +17669,16 @@ - enum machine_mode op1mode = GET_MODE (operands[1]); - enum machine_mode mode = op1mode == DImode ? DImode : SImode; - int scale = 1 << INTVAL (operands[2]); -- rtx index = gen_lowpart (Pmode, operands[1]); -- rtx base = gen_lowpart (Pmode, operands[5]); -+ rtx index = gen_lowpart (word_mode, operands[1]); -+ rtx base = gen_lowpart (word_mode, operands[5]); - rtx dest = gen_lowpart (mode, operands[3]); - -- operands[1] = gen_rtx_PLUS (Pmode, base, -- gen_rtx_MULT (Pmode, index, GEN_INT (scale))); -+ operands[1] = gen_rtx_PLUS (word_mode, base, -+ gen_rtx_MULT (word_mode, index, GEN_INT (scale))); - operands[5] = base; -- if (mode != Pmode) -+ if (mode != word_mode) - operands[1] = gen_rtx_SUBREG (mode, operands[1], 0); -- if (op1mode != Pmode) -+ if (op1mode != word_mode) - operands[5] = gen_rtx_SUBREG (op1mode, operands[5], 0); - operands[0] = dest; - }) -@@ -18052,7 +18069,7 @@ - { - rtx (*insn)(rtx); - -- insn = (TARGET_64BIT -+ insn = (Pmode == DImode - ? gen_lwp_slwpcbdi - : gen_lwp_slwpcbsi); - ---- a/gcc/config/i386/i386.opt -+++ b/gcc/config/i386/i386.opt -@@ -159,6 +159,20 @@ Enum(cmodel) String(32) Value(CM_32) - EnumValue - Enum(cmodel) String(kernel) Value(CM_KERNEL) - -+maddress-mode= -+Target RejectNegative Joined Enum(pmode) Var(ix86_pmode) Init(PMODE_SI) -+Use given address mode -+ -+Enum -+Name(pmode) Type(enum pmode) -+Known address mode (for use with the -maddress-mode= option): -+ -+EnumValue -+Enum(pmode) String(short) Value(PMODE_SI) -+ -+EnumValue -+Enum(pmode) String(long) Value(PMODE_DI) -+ - mcpu= - Target RejectNegative Joined Undocumented Alias(mtune=) Warn(%<-mcpu=%> is deprecated; use %<-mtune=%> or %<-march=%> instead) - -@@ -204,7 +218,7 @@ EnumValue - Enum(fpmath_unit) String(both) Value({(enum fpmath_unit) (FPMATH_SSE | FPMATH_387)}) - - mhard-float --Target RejectNegative Mask(80387) MaskExists Save -+Target RejectNegative Mask(80387) Save - Use hardware fp - - mieee-fp -@@ -411,11 +425,11 @@ Target RejectNegative Negative(m64) Report InverseMask(ISA_64BIT) Var(ix86_isa_f - Generate 32bit i386 code - - m64 --Target RejectNegative Negative(mx32) Report Mask(ISA_64BIT) Var(ix86_isa_flags) Save -+Target RejectNegative Negative(mx32) Report Mask(ABI_64) Var(ix86_isa_flags) Save - Generate 64bit x86-64 code - - mx32 --Target RejectNegative Negative(m32) Report Mask(ISA_X32) Var(ix86_isa_flags) Save -+Target RejectNegative Negative(m32) Report Mask(ABI_X32) Var(ix86_isa_flags) Save - Generate 32bit x86-64 code - - mmmx -@@ -455,11 +469,11 @@ Target Report Mask(ISA_SSE4_2) Var(ix86_isa_flags) Save - Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation - - msse4 --Target RejectNegative Report Mask(ISA_SSE4_2) MaskExists Var(ix86_isa_flags) Save -+Target RejectNegative Report Mask(ISA_SSE4_2) Var(ix86_isa_flags) Save - Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation - - mno-sse4 --Target RejectNegative Report InverseMask(ISA_SSE4_1) MaskExists Var(ix86_isa_flags) Save -+Target RejectNegative Report InverseMask(ISA_SSE4_1) Var(ix86_isa_flags) Save - Do not support SSE4.1 and SSE4.2 built-in functions and code generation - - msse5 ---- a/gcc/config/i386/predicates.md -+++ b/gcc/config/i386/predicates.md -@@ -1,5 +1,5 @@ - ;; Predicate definitions for IA-32 and x86-64. --;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 -+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 - ;; Free Software Foundation, Inc. - ;; - ;; This file is part of GCC. -@@ -341,6 +341,16 @@ - (match_operand 0 "general_operand"))) - - ;; Return true if OP is general operand representable on x86_64 -+;; as zero extended constant. This predicate is used in zero-extending -+;; conversion operations that require non-VOIDmode immediate operands. -+(define_predicate "x86_64_zext_general_operand" -+ (if_then_else (match_test "TARGET_64BIT") -+ (ior (match_operand 0 "nonimmediate_operand") -+ (and (match_operand 0 "x86_64_zext_immediate_operand") -+ (match_test "GET_MODE (op) != VOIDmode"))) -+ (match_operand 0 "general_operand"))) -+ -+;; Return true if OP is general operand representable on x86_64 - ;; as either sign extended or zero extended constant. - (define_predicate "x86_64_szext_general_operand" - (if_then_else (match_test "TARGET_64BIT") -@@ -483,11 +493,11 @@ - (match_operand 0 "local_symbolic_operand"))) - - ;; Test for various thread-local symbols. --(define_predicate "tls_symbolic_operand" -+(define_special_predicate "tls_symbolic_operand" - (and (match_code "symbol_ref") - (match_test "SYMBOL_REF_TLS_MODEL (op)"))) - --(define_predicate "tls_modbase_operand" -+(define_special_predicate "tls_modbase_operand" - (and (match_code "symbol_ref") - (match_test "op == ix86_tls_module_base ()"))) - -@@ -558,20 +568,23 @@ - - ;; Test for a valid operand for indirect branch. - (define_predicate "indirect_branch_operand" -- (if_then_else (match_test "TARGET_X32") -- (match_operand 0 "register_operand") -- (match_operand 0 "nonimmediate_operand"))) -+ (ior (match_operand 0 "register_operand") -+ (and (not (match_test "TARGET_X32")) -+ (match_operand 0 "memory_operand")))) - - ;; Test for a valid operand for a call instruction. --(define_predicate "call_insn_operand" -- (ior (match_operand 0 "constant_call_address_operand") -+;; Allow constant call address operands in Pmode only. -+(define_special_predicate "call_insn_operand" -+ (ior (match_test "constant_call_address_operand -+ (op, mode == VOIDmode ? mode : Pmode)") - (match_operand 0 "call_register_no_elim_operand") - (and (not (match_test "TARGET_X32")) - (match_operand 0 "memory_operand")))) - - ;; Similarly, but for tail calls, in which we cannot allow memory references. --(define_predicate "sibcall_insn_operand" -- (ior (match_operand 0 "constant_call_address_operand") -+(define_special_predicate "sibcall_insn_operand" -+ (ior (match_test "constant_call_address_operand -+ (op, mode == VOIDmode ? mode : Pmode)") - (match_operand 0 "register_no_elim_operand"))) - - ;; Match exactly zero. ---- a/gcc/config/i386/sse.md -+++ b/gcc/config/i386/sse.md -@@ -8126,8 +8126,8 @@ - "monitor\t%0, %1, %2" - [(set_attr "length" "3")]) - --(define_insn "sse3_monitor64" -- [(unspec_volatile [(match_operand:DI 0 "register_operand" "a") -+(define_insn "sse3_monitor64_" -+ [(unspec_volatile [(match_operand:P 0 "register_operand" "a") - (match_operand:SI 1 "register_operand" "c") - (match_operand:SI 2 "register_operand" "d")] - UNSPECV_MONITOR)] ---- a/gcc/config/m68k/m68k.opt -+++ b/gcc/config/m68k/m68k.opt -@@ -136,7 +136,7 @@ Target RejectNegative - Generate code for a Fido A - - mhard-float --Target RejectNegative Mask(HARD_FLOAT) MaskExists -+Target RejectNegative Mask(HARD_FLOAT) - Generate code which uses hardware floating point instructions - - mid-shared-library ---- a/gcc/config/mep/mep.opt -+++ b/gcc/config/mep/mep.opt -@@ -55,7 +55,7 @@ Target Mask(COP) - Enable MeP Coprocessor - - mcop32 --Target Mask(COP) MaskExists RejectNegative -+Target Mask(COP) RejectNegative - Enable MeP Coprocessor with 32-bit registers - - mcop64 ---- a/gcc/config/pa/pa-hpux.opt -+++ b/gcc/config/pa/pa-hpux.opt -@@ -23,7 +23,7 @@ Variable - int flag_pa_unix = TARGET_HPUX_11_31 ? 2003 : TARGET_HPUX_11_11 ? 1998 : TARGET_HPUX_10_10 ? 1995 : 1993 - - msio --Target RejectNegative Mask(SIO) MaskExists -+Target RejectNegative Mask(SIO) - Generate cpp defines for server IO - - munix=93 ---- a/gcc/config/pa/pa64-hpux.opt -+++ b/gcc/config/pa/pa64-hpux.opt -@@ -19,7 +19,7 @@ - ; . - - mgnu-ld --Target RejectNegative Mask(GNU_LD) MaskExists -+Target RejectNegative Mask(GNU_LD) - Assume code will be linked by GNU ld - - mhp-ld ---- a/gcc/config/picochip/picochip.opt -+++ b/gcc/config/picochip/picochip.opt -@@ -43,4 +43,4 @@ Target Mask(INEFFICIENT_WARNINGS) - Generate warnings when inefficient code is known to be generated. - - minefficient --Target Mask(INEFFICIENT_WARNINGS) MaskExists Undocumented -+Target Mask(INEFFICIENT_WARNINGS) Undocumented ---- a/gcc/config/rs6000/sysv4.opt -+++ b/gcc/config/rs6000/sysv4.opt -@@ -66,7 +66,7 @@ Target Report RejectNegative Mask(LITTLE_ENDIAN) - Produce little endian code - - mlittle --Target Report RejectNegative Mask(LITTLE_ENDIAN) MaskExists -+Target Report RejectNegative Mask(LITTLE_ENDIAN) - Produce little endian code - - mbig-endian ---- a/gcc/config/sh/sh.opt -+++ b/gcc/config/sh/sh.opt -@@ -316,7 +316,7 @@ Target Report RejectNegative Mask(RELAX) - Shorten address references during linking - - mrenesas --Target Mask(HITACHI) MaskExists -+Target Mask(HITACHI) - Follow Renesas (formerly Hitachi) / SuperH calling conventions - - msoft-atomic ---- a/gcc/config/sparc/long-double-switch.opt -+++ b/gcc/config/sparc/long-double-switch.opt -@@ -19,7 +19,7 @@ - ; . - - mlong-double-128 --Target Report RejectNegative Mask(LONG_DOUBLE_128) MaskExists -+Target Report RejectNegative Mask(LONG_DOUBLE_128) - Use 128-bit long double - - mlong-double-64 ---- a/gcc/config/sparc/sparc.opt -+++ b/gcc/config/sparc/sparc.opt -@@ -30,7 +30,7 @@ Target Report Mask(FPU) - Use hardware FP - - mhard-float --Target RejectNegative Mask(FPU) MaskExists -+Target RejectNegative Mask(FPU) - Use hardware FP - - msoft-float ---- a/gcc/config/v850/v850.opt -+++ b/gcc/config/v850/v850.opt -@@ -102,7 +102,7 @@ Target RejectNegative Mask(V850E1) - Compile for the v850e1 processor - - mv850es --Target RejectNegative Mask(V850E1) MaskExists -+Target RejectNegative Mask(V850E1) - Compile for the v850es variant of the v850e1 - - mv850e2 ---- a/gcc/config/vax/vax.opt -+++ b/gcc/config/vax/vax.opt -@@ -31,7 +31,7 @@ Target RejectNegative Mask(G_FLOAT) - Generate GFLOAT double precision code - - mg-float --Target RejectNegative Mask(G_FLOAT) MaskExists -+Target RejectNegative Mask(G_FLOAT) - Generate GFLOAT double precision code - - mgnu ---- a/gcc/configure -+++ b/gcc/configure -@@ -13756,7 +13756,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -636,7 +636,7 @@ Objective-C and Objective-C++ Dialects}. - -mveclibabi=@var{type} -mvect8-ret-in-mem @gol - -mpc32 -mpc64 -mpc80 -mstackrealign @gol - -momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol ---mcmodel=@var{code-model} -mabi=@var{name} @gol -+-mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol - -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol - -msse2avx -mfentry -m8bit-idiv @gol - -mavx256-split-unaligned-load -mavx256-split-unaligned-store} -@@ -13763,6 +13763,18 @@ be statically or dynamically linked. - @opindex mcmodel=large - Generate code for the large model: This model makes no assumptions - about addresses and sizes of sections. -+ -+@item -maddress-mode=long -+@opindex maddress-mode=long -+Generate code for long address mode. This is only supported for 64-bit -+and x32 environments. It is the default address mode for 64-bit -+environments. -+ -+@item -maddress-mode=short -+@opindex maddress-mode=short -+Generate code for short address mode. This is only supported for 32-bit -+and x32 environments. It is the default address mode for 32-bit and -+x32 environments. - @end table - - @node i386 and x86-64 Windows Options ---- a/gcc/doc/options.texi -+++ b/gcc/doc/options.texi -@@ -346,8 +346,6 @@ the value 1 when the option is active and 0 otherwise. If you use @code{Var} - to attach the option to a different variable, the associated macros are - called @code{OPTION_MASK_@var{name}} and @code{OPTION_@var{name}} respectively. - --You can disable automatic bit allocation using @code{MaskExists}. -- - @item InverseMask(@var{othername}) - @itemx InverseMask(@var{othername}, @var{thisname}) - The option is the inverse of another option that has the -@@ -355,15 +353,6 @@ The option is the inverse of another option that has the - the options-processing script will declare a @code{TARGET_@var{thisname}} - macro that is 1 when the option is active and 0 otherwise. - --@item MaskExists --The mask specified by the @code{Mask} property already exists. --No @code{MASK} or @code{TARGET} definitions should be added to --@file{options.h} in response to this option record. -- --The main purpose of this property is to support synonymous options. --The first option should use @samp{Mask(@var{name})} and the others --should use @samp{Mask(@var{name}) MaskExists}. -- - @item Enum(@var{name}) - The option's argument is a string from the set of strings associated - with the corresponding @samp{Enum} record. The string is checked and ---- a/gcc/dwarf2out.c -+++ b/gcc/dwarf2out.c -@@ -10178,7 +10178,9 @@ dbx_reg_number (const_rtx rtl) - } - #endif - -- return DBX_REGISTER_NUMBER (regno); -+ regno = DBX_REGISTER_NUMBER (regno); -+ gcc_assert (regno != INVALID_REGNUM); -+ return regno; - } - - /* Optionally add a DW_OP_piece term to a location description expression. ---- a/gcc/emit-rtl.c -+++ b/gcc/emit-rtl.c -@@ -964,6 +964,22 @@ void - set_reg_attrs_from_value (rtx reg, rtx x) - { - int offset; -+ bool can_be_reg_pointer = true; -+ -+ /* Don't call mark_reg_pointer for incompatible pointer sign -+ extension. */ -+ while (GET_CODE (x) == SIGN_EXTEND -+ || GET_CODE (x) == ZERO_EXTEND -+ || GET_CODE (x) == TRUNCATE -+ || (GET_CODE (x) == SUBREG && subreg_lowpart_p (x))) -+ { -+#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend) -+ if ((GET_CODE (x) == SIGN_EXTEND && POINTERS_EXTEND_UNSIGNED) -+ || (GET_CODE (x) != SIGN_EXTEND && ! POINTERS_EXTEND_UNSIGNED)) -+ can_be_reg_pointer = false; -+#endif -+ x = XEXP (x, 0); -+ } - - /* Hard registers can be reused for multiple purposes within the same - function, so setting REG_ATTRS, REG_POINTER and REG_POINTER_ALIGN -@@ -977,14 +993,14 @@ set_reg_attrs_from_value (rtx reg, rtx x) - if (MEM_OFFSET_KNOWN_P (x)) - REG_ATTRS (reg) = get_reg_attrs (MEM_EXPR (x), - MEM_OFFSET (x) + offset); -- if (MEM_POINTER (x)) -+ if (can_be_reg_pointer && MEM_POINTER (x)) - mark_reg_pointer (reg, 0); - } - else if (REG_P (x)) - { - if (REG_ATTRS (x)) - update_reg_offset (reg, x, offset); -- if (REG_POINTER (x)) -+ if (can_be_reg_pointer && REG_POINTER (x)) - mark_reg_pointer (reg, REGNO_POINTER_ALIGN (REGNO (x))); - } - } ---- a/gcc/opth-gen.awk -+++ b/gcc/opth-gen.awk -@@ -298,16 +298,25 @@ print ""; - - for (i = 0; i < n_opts; i++) { - name = opt_args("Mask", flags[i]) -- vname = var_name(flags[i]) -- mask = "MASK_" -- mask_1 = "1" -- if (vname != "") { -- mask = "OPTION_MASK_" -- if (host_wide_int[vname] == "yes") -- mask_1 = "HOST_WIDE_INT_1" -+ if (name == "") { -+ opt = opt_args("InverseMask", flags[i]) -+ if (opt ~ ",") -+ name = nth_arg(0, opt) -+ else -+ name = opt - } -- if (name != "" && !flag_set_p("MaskExists", flags[i])) -+ if (name != "" && mask_bits[name] == 0) { -+ mask_bits[name] = 1 -+ vname = var_name(flags[i]) -+ mask = "MASK_" -+ mask_1 = "1" -+ if (vname != "") { -+ mask = "OPTION_MASK_" -+ if (host_wide_int[vname] == "yes") -+ mask_1 = "HOST_WIDE_INT_1" -+ } - print "#define " mask name " (" mask_1 " << " masknum[vname]++ ")" -+ } - } - for (i = 0; i < n_extra_masks; i++) { - print "#define MASK_" extra_masks[i] " (1 << " masknum[""]++ ")" -@@ -330,17 +339,26 @@ print "" - - for (i = 0; i < n_opts; i++) { - name = opt_args("Mask", flags[i]) -- vname = var_name(flags[i]) -- macro = "OPTION_" -- mask = "OPTION_MASK_" -- if (vname == "") { -- vname = "target_flags" -- macro = "TARGET_" -- mask = "MASK_" -+ if (name == "") { -+ opt = opt_args("InverseMask", flags[i]) -+ if (opt ~ ",") -+ name = nth_arg(0, opt) -+ else -+ name = opt - } -- if (name != "" && !flag_set_p("MaskExists", flags[i])) -+ if (name != "" && mask_macros[name] == 0) { -+ mask_macros[name] = 1 -+ vname = var_name(flags[i]) -+ macro = "OPTION_" -+ mask = "OPTION_MASK_" -+ if (vname == "") { -+ vname = "target_flags" -+ macro = "TARGET_" -+ mask = "MASK_" -+ } - print "#define " macro name \ - " ((" vname " & " mask name ") != 0)" -+ } - } - for (i = 0; i < n_extra_masks; i++) { - print "#define TARGET_" extra_masks[i] \ ---- a/gcc/reginfo.c -+++ b/gcc/reginfo.c -@@ -1222,17 +1222,7 @@ reg_scan_mark_refs (rtx x, rtx insn) - /* If this is setting a register from a register or from a simple - conversion of a register, propagate REG_EXPR. */ - if (REG_P (dest) && !REG_ATTRS (dest)) -- { -- rtx src = SET_SRC (x); -- -- while (GET_CODE (src) == SIGN_EXTEND -- || GET_CODE (src) == ZERO_EXTEND -- || GET_CODE (src) == TRUNCATE -- || (GET_CODE (src) == SUBREG && subreg_lowpart_p (src))) -- src = XEXP (src, 0); -- -- set_reg_attrs_from_value (dest, src); -- } -+ set_reg_attrs_from_value (dest, SET_SRC (x)); - - /* ... fall through ... */ - ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/torture/pr52530.c -@@ -0,0 +1,30 @@ -+/* { dg-do run } */ -+ -+extern void abort (void); -+ -+struct foo -+{ -+ int *f; -+ int i; -+}; -+ -+int baz; -+ -+void __attribute__ ((noinline)) -+bar (struct foo x) -+{ -+ *(x.f) = x.i; -+} -+ -+int -+main () -+{ -+ struct foo x = { &baz, 0xdeadbeef }; -+ -+ bar (x); -+ -+ if (baz != 0xdeadbeef) -+ abort (); -+ -+ return 0; -+} ---- a/gcc/testsuite/gcc.target/i386/pr52146.c -+++ b/gcc/testsuite/gcc.target/i386/pr52146.c -@@ -15,4 +15,4 @@ test2 (void) - *apic_tpr_addr = 0; - } - --/* { dg-final { scan-assembler-not "-18874240" } } */ -+/* { dg-final { scan-assembler-not "\[,\\t \]+-18874240" } } */ ---- /dev/null -+++ b/gcc/testsuite/gcc.target/i386/pr52876.c -@@ -0,0 +1,25 @@ -+/* { dg-do run { target { x32 } } } */ -+/* { dg-options "-O2 -mx32 -maddress-mode=long" } */ -+ -+extern void abort (void); -+ -+long long li; -+ -+long long -+__attribute__ ((noinline)) -+testfunc (void* addr) -+{ -+ li = (long long)(int)addr; -+ li &= 0xffffffff; -+ return li; -+} -+ -+int main (void) -+{ -+ volatile long long rv_test; -+ rv_test = testfunc((void*)0x87651234); -+ if (rv_test != 0x87651234ULL) -+ abort (); -+ -+ return 0; -+} ---- /dev/null -+++ b/gcc/testsuite/gcc.target/i386/pr52882.c -@@ -0,0 +1,19 @@ -+/* { dg-do compile } */ -+/* { dg-options "-O" } */ -+ -+struct S1 { -+ int f0; -+ int f1; -+}; -+ -+int fn1 (); -+void fn2 (struct S1); -+ -+void -+fn3 () { -+ struct S1 a = { 1, 0 }; -+ if (fn1 ()) -+ fn2 (a); -+ for (; a.f1;) { -+ } -+} ---- /dev/null -+++ b/gcc/testsuite/gcc.target/i386/pr52883.c -@@ -0,0 +1,25 @@ -+/* { dg-do compile } */ -+/* { dg-options "-O" } */ -+ -+int a, b, d, e, f, i, j, k, l, m; -+unsigned c; -+int g[] = { }, h[0]; -+ -+int -+fn1 () { -+ return 0; -+} -+ -+void -+fn2 () { -+ c = 0; -+ e = 0; -+ for (;; e = 0) -+ if (f > j) { -+ k = fn1 (); -+ l = (d || k) * b; -+ m = l * a; -+ h[0] = m <= i; -+ } else -+ i = g[c]; -+} ---- a/libffi/configure -+++ b/libffi/configure -@@ -6282,7 +6282,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libffi/src/x86/ffi64.c -+++ b/libffi/src/x86/ffi64.c -@@ -426,7 +426,7 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) - /* If the return value is passed in memory, add the pointer as the - first integer argument. */ - if (ret_in_memory) -- reg_args->gpr[gprcount++] = (long) rvalue; -+ reg_args->gpr[gprcount++] = (unsigned long) rvalue; - - avn = cif->nargs; - arg_types = cif->arg_types; -@@ -501,9 +501,11 @@ ffi_prep_closure_loc (ffi_closure* closure, - tramp = (volatile unsigned short *) &closure->tramp[0]; - - tramp[0] = 0xbb49; /* mov , %r11 */ -- *(void * volatile *) &tramp[1] = ffi_closure_unix64; -+ *((unsigned long long * volatile) &tramp[1]) -+ = (unsigned long) ffi_closure_unix64; - tramp[5] = 0xba49; /* mov , %r10 */ -- *(void * volatile *) &tramp[6] = codeloc; -+ *((unsigned long long * volatile) &tramp[6]) -+ = (unsigned long) codeloc; - - /* Set the carry bit iff the function uses any sse registers. - This is clc or stc, together with the first byte of the jmp. */ -@@ -542,7 +544,7 @@ ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue, - { - /* The return value goes in memory. Arrange for the closure - return value to go directly back to the original caller. */ -- rvalue = (void *) reg_args->gpr[gprcount++]; -+ rvalue = (void *) (unsigned long) reg_args->gpr[gprcount++]; - /* We don't have to do anything in asm for the return. */ - ret = FFI_TYPE_VOID; - } ---- a/libffi/src/x86/ffitarget.h -+++ b/libffi/src/x86/ffitarget.h -@@ -53,9 +53,15 @@ typedef unsigned long long ffi_arg; - typedef long long ffi_sarg; - #endif - #else -+#if defined __x86_64__ && !defined __LP64__ -+#define FFI_SIZEOF_ARG 8 -+typedef unsigned long long ffi_arg; -+typedef long long ffi_sarg; -+#else - typedef unsigned long ffi_arg; - typedef signed long ffi_sarg; - #endif -+#endif - - typedef enum ffi_abi { - FFI_FIRST_ABI = 0, ---- a/libgcc/unwind-dw2.c -+++ b/libgcc/unwind-dw2.c -@@ -294,7 +294,8 @@ _Unwind_SetGRValue (struct _Unwind_Context *context, int index, - { - index = DWARF_REG_TO_UNWIND_COLUMN (index); - gcc_assert (index < (int) sizeof(dwarf_reg_size_table)); -- gcc_assert (dwarf_reg_size_table[index] == sizeof (_Unwind_Context_Reg_Val)); -+ /* Return column size may be smaller than _Unwind_Context_Reg_Val. */ -+ gcc_assert (dwarf_reg_size_table[index] <= sizeof (_Unwind_Context_Reg_Val)); - - context->by_value[index] = 1; - context->reg[index] = _Unwind_Get_Unwind_Context_Reg_Val (val); ---- a/libgfortran/configure -+++ b/libgfortran/configure -@@ -8071,7 +8071,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libgomp/configure -+++ b/libgomp/configure -@@ -6596,7 +6596,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libgomp/configure.tgt -+++ b/libgomp/configure.tgt -@@ -59,7 +59,7 @@ if test $enable_linux_futex = yes; then - i[456]86-*-linux*) - config_path="linux/x86 linux posix" - case " ${CC} ${CFLAGS} " in -- *" -m64 "*) -+ *" -m64 "*|*" -mx32 "*) - ;; - *) - if test -z "$with_arch"; then ---- a/libitm/configure -+++ b/libitm/configure -@@ -7285,7 +7285,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libitm/configure.tgt -+++ b/libitm/configure.tgt -@@ -53,7 +53,7 @@ case "${target_cpu}" in - - i[3456]86) - case " ${CC} ${CFLAGS} " in -- *" -m64 "*) -+ *" -m64 "*|*" -mx32 "*) - ;; - *) - if test -z "$with_arch"; then ---- a/libjava/classpath/configure -+++ b/libjava/classpath/configure -@@ -7592,7 +7592,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libjava/configure -+++ b/libjava/configure -@@ -8843,7 +8843,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libmudflap/configure -+++ b/libmudflap/configure -@@ -6393,7 +6393,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libobjc/configure -+++ b/libobjc/configure -@@ -6079,7 +6079,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libquadmath/configure -+++ b/libquadmath/configure -@@ -6264,7 +6264,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libssp/configure -+++ b/libssp/configure -@@ -6401,7 +6401,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -7120,7 +7119,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/libtool.m4 -+++ b/libtool.m4 -@@ -1232,7 +1232,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/lto-plugin/configure -+++ b/lto-plugin/configure -@@ -6060,7 +6060,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" ---- a/zlib/configure -+++ b/zlib/configure -@@ -5869,7 +5869,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) -- LD="${LD-ld} -m elf_i386" -+ case `/usr/bin/file conftest.o` in -+ *x86-64*) -+ LD="${LD-ld} -m elf32_x86_64" -+ ;; -+ *) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/chromeos-version.sh b/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/chromeos-version.sh deleted file mode 100755 index c3f4eb7464..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/chromeos-version.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -# -# This script is given one argument: the base of the source directory of -# the package, and it prints a string on stdout with the numerical version -# number for said repo. -# -# The reason we extract the version from the ChangeLog instead of BASE-VER is -# because BASE-VER contains a custom google string that lacks the x.y.z info. - - -exec awk '$1 == "*" && $2 == "GCC" && $4 == "released." { print $3; exit }' \ - "$1"/ChangeLog diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/sysroot_wrapper b/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/sysroot_wrapper deleted file mode 100755 index e72a7155d5..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/sysroot_wrapper +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2009 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This script ensures that "--sysroot" is passed to whatever it is wrapping. -# To use: -# mv .real -# ln -s - -SYSROOT_WRAPPER_LOG=/tmp/sysroot_wrapper.error -if [ -n "$SYSROOT" ] ; then - exec "${0}.real" --sysroot="$SYSROOT" "$@" -else - if [[ ! -f $SYSROOT_WRAPPER_LOG ]]; then - touch $SYSROOT_WRAPPER_LOG - chmod a+w $SYSROOT_WRAPPER_LOG - fi - echo "Invocation with missing SYSROOT: ${0} $@" >> $SYSROOT_WRAPPER_LOG - exec "${0}.real" "$@" -fi diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/sysroot_wrapper.hardened b/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/sysroot_wrapper.hardened deleted file mode 100755 index d568e07af0..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/files/sysroot_wrapper.hardened +++ /dev/null @@ -1,292 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This script is a meta-driver for the toolchain. It transforms the command -# line to allow the following: -# 1. This script ensures that '--sysroot' is passed to whatever it is wrapping. -# -# 2. It adds hardened flags to gcc invocation. The hardened flags are: -# -fstack-protector-strong -# -fPIE -# -pie -# -D_FORTIFY_SOURCE=2 -# -# It can disable -fPIE -pie by checking if -nopie is passed to gcc. In this -# case it removes -nopie as it is a non-standard flag. -# -# 3. Enable clang diagnostics with -clang option -# -# 4. Add new -print-cmdline option to print the command line before executon -# -# This is currently implemented as two loops on the list of arguments. The -# first loop # identifies hardening flags, as well as determining if clang -# invocation is specified. The second loop build command line for clang -# invocation as well adjusting gcc command line. -# -# This implementation ensure compile time of default path remains mostly -# the same. -# -# There is a similar hardening wrapper that wraps ld and adds -z now -z relro -# to the link command line (see ldwrapper). -# -# To use: -# mv .real -# ln -s - -import os -import re -import sys - -# Full hardening. Some/all of these may be discarded depending on -# other flags. -flags_to_add = set(['-fstack-protector-strong', '-fPIE', '-pie', - '-D_FORTIFY_SOURCE=2', '-frecord-gcc-switches']) -disable_flags = set(['-mno-movbe', '-mno-ssse3']) - -# Only FORTIFY_SOURCE hardening flag is applicable for clang parser. -clang_cmdline = ['-fsyntax-only', '-Qunused-arguments', '-D_FORTIFY_SOURCE=2'] - -# If -clang is present. -clang_compile_requested = 0 - -# If -print-cmdline is present. -print_cmdline = 0 - -# If ccache should be used automatically. -use_ccache = True # @CCACHE_DEFAULT@ Keep this comment for code. - -fstack = set(['-D__KERNEL__', '-fno-stack-protector', '-nodefaultlibs', - '-nostdlib']) -fPIE = set(['-D__KERNEL__', '-fPIC', '-fPIE', '-fno-PIC', '-fno-PIE', - '-fno-pic', '-fno-pie', '-fpic', '-fpie', '-nopie', '-nostartfiles', - '-nostdlib', '-pie', '-static']) -pie = set(['-D__KERNEL__', '-A', '-fno-PIC', '-fno-PIE', '-fno-pic', '-fno-pie', - '-nopie', '-nostartfiles', '-nostdlib', '-pie', '-r', '--shared', '-shared', - '-static']) -sse = set(['-msse3', '-mssse3', '-msse4.1', '-msse4.2', '-msse4', '-msse4a']) -wrapper_only_options = set(['-clang', '-print-cmdline', '-nopie', '-noccache']) - -myargs = sys.argv[1:] -if fstack.intersection(myargs): - flags_to_add.remove('-fstack-protector-strong') - flags_to_add.add('-fno-stack-protector') -if fPIE.intersection(myargs): - flags_to_add.remove('-fPIE') -if pie.intersection(myargs): - flags_to_add.remove('-pie') -if sse.intersection(myargs): - disable_flags.remove('-mno-ssse3') -clang_compile_requested = '-clang' in myargs -print_cmdline = '-print-cmdline' in myargs -if '-noccache' in myargs: - # Only explicitly disable so we can set defaults up top. - use_ccache = False -cmdline = [x for x in myargs if x not in wrapper_only_options] - -if not clang_compile_requested: - gcc_cmdline = cmdline -else: - import subprocess - # Gcc flags to remove from the clang command line. - # TODO: Once clang supports gcc compatibility mode, remove - # these checks. - # - # Use of -Qunused-arguments allows this set to be small, just those - # that clang still warns about. - clang_unsupported = set(['-pass-exit-codes', '-Ofast', '-Wclobbered', - '-fvisibility=internal', '-Woverride-init', '-Wunsafe-loop-optimizations', - '-Wlogical-op', '-Wmissing-parameter-type', '-Wold-style-declaration']) - clang_unsupported_prefixes = ('-Wstrict-aliasing=') - - # Clang may use different options for the same or similar functionality. - gcc_to_clang = { - '-Wno-error=unused-but-set-variable': '-Wno-error=unused-variable', - '-Wno-error=maybe-uninitialized': '-Wno-error=uninitialized', - } - - # If these options are specified, do not run clang, even if -clang is - # specified. - # This is mainly for utilities that depend on compiler output. - skip_clang_prefixes = ('-print-', '-dump', '@') - skip_clang_set = set(['-', '-E', '-M', '-x']) - - # Reset gcc cmdline too. Only change is to remove -Xclang-only - # options if specified. - gcc_cmdline = [] - - skip_clang = False - for flag in cmdline: - if flag.startswith(skip_clang_prefixes) or flag in skip_clang_set or flag.endswith('.S'): - skip_clang = True - elif not (flag in clang_unsupported or - flag.startswith(clang_unsupported_prefixes)): - # Strip off -Xclang-only= if present. - if flag.startswith('-Xclang-only='): - opt = flag.partition('=')[2] - clang_cmdline.append(opt) - # No need to add to gcc_cmdline. - continue - elif flag in gcc_to_clang.keys(): - clang_cmdline.append(gcc_to_clang[flag]) - else: - clang_cmdline.append(flag) - gcc_cmdline.append(flag) - -if re.match(r'i.86|x86_64', os.path.basename(sys.argv[0])): - gcc_cmdline.extend(disable_flags) - - -def get_proc_cmdline(pid): - with open('/proc/%i/cmdline' % pid) as fp: - return fp.read().replace('\0', ' ') - return None - - -def get_proc_status(pid, item): - with open('/proc/%i/status' % pid) as fp: - for line in fp: - m = re.match(r'%s:\s*(.*)' % re.escape(item), line) - if m: - return m.group(1) - return None - - -def log_parent_process_tree(log, ppid): - depth = 0 - - while ppid > 1: - cmdline = get_proc_cmdline(ppid) - log.warning(' %*s {%5i}: %s' % (depth, '', ppid, cmdline)) - - ppid = get_proc_status(ppid, 'PPid') - if not ppid: - break - ppid = int(ppid) - depth += 2 - - -sysroot = os.environ.get('SYSROOT', '') -if sysroot: - clang_cmdline.append('--sysroot=%s' % sysroot) - gcc_cmdline.append('--sysroot=%s' % sysroot) -else: - import logging - import logging.handlers - import traceback - - log_file = '/tmp/sysroot_wrapper.error' - - log = logging.getLogger('sysroot_wrapper') - log.setLevel(logging.DEBUG) - - handler = logging.handlers.RotatingFileHandler(log_file, maxBytes=0x20000000, - backupCount=1) - formatter = logging.Formatter('%(asctime)s %(message)s') - handler.setFormatter(formatter) - log.addHandler(handler) - - log.warning('Invocation with missing SYSROOT: %s' % ' '.join(sys.argv)) - try: - log_parent_process_tree(log, os.getppid()) - except IOError: - log.error('%s' % traceback.format_exc()) - - try: - # The logging module does not support setting permissions. - os.chmod(log_file, 0666) - except OSError: - pass - -if clang_compile_requested and not skip_clang: - clang_comp = os.environ.get('CLANG', '/usr/bin/clang') - - # Specify the target for clang. - gcc_comp = os.path.basename(sys.argv[0]) - arch = gcc_comp.split('-')[0] - if arch == 'i386' or arch == 'i486' or arch == 'i586' or arch == 'i686': - clang_cmdline.insert(0, '-m32') - elif arch == 'x86_64': - clang_cmdline.insert(0, '-m64') - elif arch.startswith('arm'): - clang_cmdline.insert(0, 'armv7a-cros-linux-gnueabi') - clang_cmdline.insert(0, '-target') - - # Check for clang or clang++. - if sys.argv[0].endswith('++'): - clang_comp += '++' - - if print_cmdline: - print '%s %s\n' % (clang_comp, ' '.join(clang_cmdline)) - - p = subprocess.Popen([clang_comp] + clang_cmdline) - p.wait() - if p.returncode != 0: - sys.exit(p.returncode) - -execargs = [] -real_gcc = '%s.real' % sys.argv[0] -if use_ccache: - # Portage likes to set this for us when it has FEATURES=-ccache. - # The other vars we need to setup manually because of tools like - # scons that scrubs the env before we get executed. - os.environ.pop('CCACHE_DISABLE', None) - - # We should be able to share the objects across compilers as - # the pre-processed output will differ. This allows boards - # that share compiler flags (like x86 boards) to share caches. - ccache_dir = '/var/cache/distfiles/ccache' - os.environ['CCACHE_DIR'] = ccache_dir - - # If RESTRICT=sandbox is enabled, then sandbox won't be setup, - # and the env vars won't be available for appending. - if 'SANDBOX_WRITE' in os.environ: - os.environ['SANDBOX_WRITE'] += ':%s' % ccache_dir - - # We need to get ccache to make relative paths from within the - # sysroot. This lets us share cached files across boards (if - # all other things are equal of course like CFLAGS) as well as - # across versions. A quick test is something like: - # $ export CFLAGS='-O2 -g -pipe' CXXFLAGS='-O2 -g -pipe' - # $ BOARD=x86-alex - # $ cros_workon-$BOARD stop cros-disks - # $ emerge-$BOARD cros-disks - # $ cros_workon-$BOARD start cros-disks - # $ emerge-$BOARD cros-disks - # $ BOARD=amd64-generic - # $ cros_workon-$BOARD stop cros-disks - # $ emerge-$BOARD cros-disks - # $ cros_workon-$BOARD start cros-disks - # $ emerge-$BOARD cros-disks - # All of those will get cache hits (ignoring the first one - # which will seed the cache) due to this setting. - if sysroot: - os.environ['CCACHE_BASEDIR'] = sysroot - - # Minor speed up as we don't care about this in general. - #os.environ['CCACHE_NOSTATS'] = 'no' - # Useful for debugging. - #os.environ['CCACHE_LOG'] = '/dev/stderr' - - # We take care of nuking the cache in the gcc ebuild whenever - # it revbumps in a way that matters, so disable ccache's check. - os.environ['CCACHE_COMPILERCHECK'] = 'none' - - # Make sure we keep the cached files group writable. - os.environ['CCACHE_UMASK'] = '002' - - argv0 = '/usr/bin/ccache' - execargs += ['ccache'] - #gcc_cmdline += ['-noccache'] -else: - argv0 = real_gcc - -execargs += [real_gcc] + list(flags_to_add) + gcc_cmdline - -if print_cmdline: - print '[%s] %s' % (argv0, ' '.join(execargs)) - -sys.stdout.flush() -os.execv(argv0, execargs) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/gcc-4.7.1-r41.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/gcc-4.7.1-r41.ebuild deleted file mode 100644 index 23e6b9cb9e..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/gcc-4.7.1-r41.ebuild +++ /dev/null @@ -1,548 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.4.3-r3.ebuild,v 1.1 2010/06/19 01:53:09 zorry Exp $ - -EAPI=1 -CROS_WORKON_COMMIT="164c96f2f2c2aec1854ec2866d1ad865b2326251" -CROS_WORKON_TREE="896542d4852cae24c8117b2a0706e0e8c2a51fdd" -CROS_WORKON_LOCALNAME=gcc -CROS_WORKON_PROJECT=chromiumos/third_party/gcc - -inherit eutils cros-workon binutils-funcs - -GCC_FILESDIR="${PORTDIR}/sys-devel/gcc/files" - -DESCRIPTION="The GNU Compiler Collection. Includes C/C++, java compilers, pie+ssp extensions, Haj Ten Brugge runtime bounds checking. This Compiler is based off of Crosstoolv14." - -LICENSE="GPL-3 LGPL-3 || ( GPL-3 libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2" -KEYWORDS="amd64 arm x86" - -RDEPEND=">=sys-libs/zlib-1.1.4 - >=sys-devel/gcc-config-1.6 - virtual/libiconv - >=dev-libs/gmp-4.2.1 - >=dev-libs/mpc-0.8.1 - >=dev-libs/mpfr-2.3.2 - graphite? ( - >=dev-libs/ppl-0.10 - >=dev-libs/cloog-ppl-0.15.4 - ) - !build? ( - gcj? ( - gtk? ( - x11-libs/libXt - x11-libs/libX11 - x11-libs/libXtst - x11-proto/xproto - x11-proto/xextproto - >=x11-libs/gtk+-2.2 - x11-libs/pango - ) - >=media-libs/libart_lgpl-2.1 - app-arch/zip - app-arch/unzip - ) - >=sys-libs/ncurses-5.2-r2 - nls? ( sys-devel/gettext ) - )" -DEPEND="${RDEPEND} - test? ( >=dev-util/dejagnu-1.4.4 >=sys-devel/autogen-5.5.4 ) - >=sys-apps/texinfo-4.8 - >=sys-devel/bison-1.875 - elibc_glibc? ( >=sys-libs/glibc-2.8 ) - amd64? ( multilib? ( gcj? ( app-emulation/emul-linux-x86-xlibs ) ) ) - ppc? ( >=${CATEGORY}/binutils-2.17 ) - ppc64? ( >=${CATEGORY}/binutils-2.17 ) - >=${CATEGORY}/binutils-2.15.94" -PDEPEND=">=sys-devel/gcc-config-1.4" -if [[ ${CATEGORY} != cross-* ]] ; then - PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )" -fi - -RESTRICT="mirror strip" - -IUSE="gcj git_gcc graphite gtk hardened hardfp mounted_gcc multilib multislot - nls cxx openmp tests +thumb upstream_gcc vanilla +wrapper_ccache" - -is_crosscompile() { [[ ${CHOST} != ${CTARGET} ]] ; } - -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} = ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi - -if use multislot ; then - SLOT="${CTARGET}-${PV}" -else - SLOT="${CTARGET}" -fi - -PREFIX=/usr - -src_unpack() { - if use mounted_gcc ; then - if [[ ! -d "$(get_gcc_dir)" ]] ; then - die "gcc dir not mounted/present at: $(get_gcc_dir)" - fi - elif use upstream_gcc ; then - GCC_MIRROR=ftp://mirrors.kernel.org/gnu/gcc - GCC_TARBALL=${GCC_MIRROR}/${P}/${P}.tar.bz2 - wget $GCC_TARBALL - tar xf ${GCC_TARBALL##*/} - elif use git_gcc ; then - git clone "${CROS_WORKON_REPO}/${CROS_WORKON_PROJECT}.git" "${S}" - if [[ -n ${GCC_GITHASH} ]] ; then - einfo "Checking out: ${GCC_GITHASH}" - pushd "$(get_gcc_dir)" >/dev/null - git checkout ${GCC_GITHASH} || \ - die "Couldn't checkout ${GCC_GITHASH}" - popd >/dev/null - fi - else - cros-workon_src_unpack - cd "${S}" - [[ ${ABI} == "x32" ]] && epatch "${FILESDIR}"/90_all_gcc-4.7-x32.patch - fi - - COST_PKG_VERSION="$("${FILESDIR}"/chromeos-version.sh "${S}")_cos_gg" - - if [[ -d ${S}/.git ]]; then - COST_PKG_VERSION+="_$(cd ${S}; git describe --always)" - elif [[ -n ${VCSID} ]]; then - COST_PKG_VERSION+="_${VCSID}" - fi -} - -src_compile() -{ - src_configure - cd $(get_gcc_build_dir) || "Build dir $(get_gcc_build_dir) not found" - GCC_CFLAGS="$(portageq envvar CFLAGS)" - TARGET_FLAGS="" - - if use hardened - then - TARGET_FLAGS="${TARGET_FLAGS} -fstack-protector-strong -D_FORTIFY_SOURCE=2" - fi - - # Do not link libgcc with gold. That is known to fail on internal linker - # errors. See crosbug.com/16719 - local LD_NON_GOLD="$(get_binutils_path_ld ${CTARGET})/ld" - - emake CFLAGS="${GCC_CFLAGS}" \ - LDFLAGS="-Wl,-O1" \ - STAGE1_CFLAGS="-O2 -pipe" \ - BOOT_CFLAGS="-O2" \ - CFLAGS_FOR_TARGET="$(get_make_var CFLAGS_FOR_TARGET) ${TARGET_FLAGS}" \ - CXXFLAGS_FOR_TARGET="$(get_make_var CXXFLAGS_FOR_TARGET) ${TARGET_FLAGS}" \ - LD_FOR_TARGET="${LD_NON_GOLD}" \ - all || die -} - -# Logic copied from Gentoo's toolchain.eclass. -toolchain_src_install() { - BINPATH=$(get_bin_dir) # cros to Gentoo glue - - # These should be symlinks - dodir /usr/bin - cd "${D}"${BINPATH} - for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do - # For some reason, g77 gets made instead of ${CTARGET}-g77... - # this should take care of that - [[ -f ${x} ]] && mv ${x} ${CTARGET}-${x} - - if [[ -f ${CTARGET}-${x} ]] ; then - if ! is_crosscompile ; then - ln -sf ${CTARGET}-${x} ${x} - dosym ${BINPATH}/${CTARGET}-${x} \ - /usr/bin/${x}-${GCC_CONFIG_VER} - fi - - # Create version-ed symlinks - dosym ${BINPATH}/${CTARGET}-${x} \ - /usr/bin/${CTARGET}-${x}-${GCC_CONFIG_VER} - fi - - if [[ -f ${CTARGET}-${x}-${GCC_CONFIG_VER} ]] ; then - rm -f ${CTARGET}-${x}-${GCC_CONFIG_VER} - ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_CONFIG_VER} - fi - done -} - -src_install() -{ - cd $(get_gcc_build_dir) || "Build dir $(get_gcc_build_dir) not found" - emake DESTDIR="${D}" install || die "Could not install gcc" - - find "${D}" -name libiberty.a -exec rm -f "{}" \; - - # Move the libraries to the proper location - gcc_movelibs - - # Move pretty-printers to gdb datadir to shut ldconfig up - gcc_move_pretty_printers - - GCC_CONFIG_VER=$(get_gcc_base_ver) - dodir /etc/env.d/gcc - insinto /etc/env.d/gcc - - local LDPATH=$(get_lib_dir) - for SUBDIR in 32 64 ; do - if [[ -d ${D}/${LDPATH}/${SUBDIR} ]] - then - LDPATH="${LDPATH}:${LDPATH}/${SUBDIR}" - fi - done - - cat <<-EOF > env.d -LDPATH="${LDPATH}" -MANPATH="$(get_data_dir)/man" -INFOPATH="$(get_data_dir)/info" -STDCXX_INCDIR="$(get_stdcxx_incdir)" -CTARGET=${CTARGET} -GCC_PATH="$(get_bin_dir)" -GCC_VER="$(get_gcc_base_ver)" -EOF - newins env.d $(get_gcc_config_file) - cd - - - toolchain_src_install - - if is_crosscompile ; then - if use hardened - then - SYSROOT_WRAPPER_FILE=sysroot_wrapper.hardened - else - SYSROOT_WRAPPER_FILE=sysroot_wrapper - fi - - exeinto "$(get_bin_dir)" - doexe "${FILESDIR}/${SYSROOT_WRAPPER_FILE}" || die - sed -i \ - -e "/^use_ccache = .*@CCACHE_DEFAULT@/s:=[^#]*:= $(usex wrapper_ccache True False) :" \ - "${D}$(get_bin_dir)/${SYSROOT_WRAPPER_FILE}" || die - for x in c++ cpp g++ gcc; do - if [[ -f "${CTARGET}-${x}" ]]; then - mv "${CTARGET}-${x}" "${CTARGET}-${x}.real" - dosym "${SYSROOT_WRAPPER_FILE}" "$(get_bin_dir)/${CTARGET}-${x}" || die - fi - done - fi - - if use tests - then - TEST_INSTALL_DIR="usr/local/dejagnu/gcc" - dodir ${TEST_INSTALL_DIR} - cd ${D}/${TEST_INSTALL_DIR} - tar -czf "tests.tar.gz" ${WORKDIR} - fi -} - -pkg_preinst() -{ - # We handle ccache ourselves in the sysroot wrapper. - rm -f /usr/lib/ccache/bin/*-* - - local ccache_dir="/var/cache/distfiles/ccache" - local vcsid_file="${ccache_dir}/.gcc.vcsid.${CTARGET}" - # Clean out the ccache whenever the gcc code changes. - # If we are using a live ebuild, nuke it everytime just - # to be safe. - [[ ${PV} == "9999" ]] && rm -f "${vcsid_file}" - local old_vcsid=$(cat "${vcsid_file}" 2>/dev/null) - if [[ ${old_vcsid} != ${CROS_WORKON_COMMIT} ]] ; then - # Don't just delete the whole dir as that would punt - # the vcsid tag files from other targets too. - rm -rf "${ccache_dir}"/* - fi - mkdir -p -m 2775 "${ccache_dir}" - echo "${CROS_WORKON_COMMIT}" > "${vcsid_file}" - - # Use a 10G limit as our bots have finite resources. A full - # x86-generic build uses ~6GB, while an amd64-generic uses - # ~8GB, so this limit should be sufficient. - CCACHE_UMASK=002 CCACHE_DIR=${ccache_dir} ccache -F 0 -M 11G - - # Make sure the dirs have perms for emerge builders. - chown -R ${PORTAGE_USERNAME}:portage "${ccache_dir}" -} - -pkg_postinst() -{ - gcc-config $(get_gcc_config_file) -} - -pkg_postrm() -{ - if is_crosscompile ; then - if [[ -z $(ls "${ROOT}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then - rm -f "${ROOT}"/etc/env.d/gcc/config-${CTARGET} - rm -f "${ROOT}"/etc/env.d/??gcc-${CTARGET} - rm -f "${ROOT}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64} - fi - fi -} - -src_configure() -{ - if use mounted_gcc && [[ -f $(get_gcc_build_dir)/Makefile ]] ; then - return - fi - - # Set configuration based on path variables - local DATAPATH=$(get_data_dir) - local confgcc="$(use_enable multilib) - --prefix=${PREFIX} \ - --bindir=$(get_bin_dir) \ - --datadir=${DATAPATH} \ - --mandir=${DATAPATH}/man \ - --infodir=${DATAPATH}/info \ - --includedir=$(get_lib_dir)/include \ - --with-gxx-include-dir=$(get_stdcxx_incdir) - --with-python-dir=${DATAPATH#${PREFIX}}/python" - confgcc="${confgcc} --host=${CHOST}" - confgcc="${confgcc} --target=${CTARGET}" - confgcc="${confgcc} --build=${CBUILD}" - - # Language options for stage1/stage2. - if ! use cxx - then - GCC_LANG="c" - else - GCC_LANG="c,c++" - fi - confgcc="${confgcc} --enable-languages=${GCC_LANG}" - - if use hardfp && [[ ${CTARGET} == arm* ]] ; - then - confgcc="${confgcc} --with-float=hard" - fi - - if use thumb && [[ ${CTARGET} == arm* ]] ; - then - confgcc="${confgcc} --with-mode=thumb" - fi - - if is_crosscompile ; then - local needed_libc="glibc" - if [[ -n ${needed_libc} ]] ; then - if ! has_version ${CATEGORY}/${needed_libc} ; then - confgcc="${confgcc} --disable-shared --disable-threads --without-headers" - elif built_with_use --hidden --missing false ${CATEGORY}/${needed_libc} crosscompile_opts_headers-only ; then - confgcc="${confgcc} --disable-shared --with-sysroot=/usr/${CTARGET}" - else - confgcc="${confgcc} --with-sysroot=/usr/${CTARGET}" - fi - fi - else - confgcc="${confgcc} --enable-shared --enable-threads=posix" - fi - - confgcc="${confgcc} $(get_gcc_configure_options ${CTARGET})" - - EXTRA_ECONF="--with-bugurl=http://code.google.com/p/chromium-os/issues/entry\ - --with-pkgversion=${COST_PKG_VERSION} --enable-linker-build-id" - confgcc="${confgcc} ${EXTRA_ECONF}" - - # Build in a separate build tree - mkdir -p $(get_gcc_build_dir) || \ - die "Could not create build dir $(get_gcc_build_dir)" - cd $(get_gcc_build_dir) || die "Build dir $(get_gcc_build_dir) not found" - - # and now to do the actual configuration - addwrite /dev/zero - echo "Running this:" - echo "configure ${confgcc}" - echo "$(get_gcc_dir)"/configure "$@" - "$(get_gcc_dir)"/configure ${confgcc} || die "failed to run configure" -} - -get_gcc_configure_options() -{ - local CTARGET=$1; shift - local confgcc=$(get_gcc_common_options) - case ${CTARGET} in - arm*) #264534 - local arm_arch="${CTARGET%%-*}" - # Only do this if arm_arch is armv* - if [[ ${arm_arch} == armv* ]] ; then - # Convert armv7{a,r,m} to armv7-{a,r,m} - [[ ${arm_arch} == armv7? ]] && arm_arch=${arm_arch/7/7-} - # Remove endian ('l' / 'eb') - [[ ${arm_arch} == *l ]] && arm_arch=${arm_arch%l} - [[ ${arm_arch} == *eb ]] && arm_arch=${arm_arch%eb} - confgcc="${confgcc} --with-arch=${arm_arch}" - confgcc="${confgcc} --disable-esp" - fi - ;; - i?86*) - # Hardened is enabled for x86, but disabled for ARM. - confgcc="${confgcc} --enable-esp" - confgcc="${confgcc} --with-arch=atom" - confgcc="${confgcc} --with-tune=atom" - # Remove this once crash2 supports larger symbols. - # http://code.google.com/p/chromium-os/issues/detail?id=23321 - confgcc="${confgcc} --enable-frame-pointer" - ;; - x86_64*-gnux32) - confgcc="${confgcc} --with-abi=x32 --with-multilib-list=mx32" - ;; - esac - echo ${confgcc} -} - -get_gcc_common_options() -{ - local confgcc - confgcc="${confgcc} --disable-libmudflap" - confgcc="${confgcc} --disable-libssp" - confgcc+=" $(use_enable openmp libgomp)" - confgcc="${confgcc} --enable-__cxa_atexit" - confgcc="${confgcc} --enable-checking=release" - confgcc="${confgcc} --disable-libquadmath" - echo ${confgcc} -} - -get_gcc_dir() -{ - local GCCDIR - if use mounted_gcc ; then - GCCDIR=${GCC_SOURCE_PATH:=/usr/local/toolchain_root/gcc} - elif use upstream_gcc ; then - GCCDIR=${P} - else - GCCDIR=${S} - fi - echo "${GCCDIR}" -} - -get_gcc_build_dir() -{ - echo "$(get_gcc_dir)-build-${CTARGET}" -} - -get_gcc_base_ver() -{ - cat "$(get_gcc_dir)/gcc/BASE-VER" -} - -get_stdcxx_incdir() -{ - echo "$(get_lib_dir)/include/g++-v4" -} - -get_lib_dir() -{ - echo "${PREFIX}/lib/gcc/${CTARGET}/$(get_gcc_base_ver)" -} - -get_bin_dir() -{ - if is_crosscompile ; then - echo ${PREFIX}/${CHOST}/${CTARGET}/gcc-bin/$(get_gcc_base_ver) - else - echo ${PREFIX}/${CTARGET}/gcc-bin/$(get_gcc_base_ver) - fi -} - -get_data_dir() -{ - echo "${PREFIX}/share/gcc-data/${CTARGET}/$(get_gcc_base_ver)" -} - -get_gcc_config_file() -{ - echo ${CTARGET}-${PV} -} - -# Grab a variable from the build system (taken from linux-info.eclass) -get_make_var() { - local var=$1 makefile=${2:-$(get_gcc_build_dir)/Makefile} - echo -e "e:\\n\\t@echo \$(${var})\\ninclude ${makefile}" | \ - r=${makefile%/*} emake --no-print-directory -s -f - 2>/dev/null -} -XGCC() { get_make_var GCC_FOR_TARGET ; } - -gcc_move_pretty_printers() { - LIBPATH=$(get_lib_dir) # cros to Gentoo glue - - local py gdbdir=/usr/share/gdb/auto-load${LIBPATH} - pushd "${D}"${LIBPATH} >/dev/null - for py in $(find . -name '*-gdb.py') ; do - local multidir=${py%/*} - insinto "${gdbdir}/${multidir}" - sed -i "/^libdir =/s:=.*:= '${LIBPATH}/${multidir}':" "${py}" || die #348128 - doins "${py}" || die - rm "${py}" || die - done - popd >/dev/null -} - -# make sure the libtool archives have libdir set to where they actually -# -are-, and not where they -used- to be. also, any dependencies we have -# on our own .la files need to be updated. -fix_libtool_libdir_paths() { - pushd "${D}" >/dev/null - - pushd "./${1}" >/dev/null - local dir="${PWD#${D%/}}" - local allarchives=$(echo *.la) - allarchives="\(${allarchives// /\\|}\)" - popd >/dev/null - - sed -i \ - -e "/^libdir=/s:=.*:='${dir}':" \ - ./${dir}/*.la - sed -i \ - -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" \ - $(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') \ - ./${dir}/*.la - - popd >/dev/null -} - -gcc_movelibs() { - LIBPATH=$(get_lib_dir) # cros to Gentoo glue - - local multiarg removedirs="" - for multiarg in $($(XGCC) -print-multi-lib) ; do - multiarg=${multiarg#*;} - multiarg=${multiarg//@/ -} - - local OS_MULTIDIR=$($(XGCC) ${multiarg} --print-multi-os-directory) - local MULTIDIR=$($(XGCC) ${multiarg} --print-multi-directory) - local TODIR=${D}${LIBPATH}/${MULTIDIR} - local FROMDIR= - - [[ -d ${TODIR} ]] || mkdir -p ${TODIR} - - for FROMDIR in \ - ${LIBPATH}/${OS_MULTIDIR} \ - ${LIBPATH}/../${MULTIDIR} \ - ${PREFIX}/lib/${OS_MULTIDIR} \ - ${PREFIX}/${CTARGET}/lib/${OS_MULTIDIR} - do - removedirs="${removedirs} ${FROMDIR}" - FROMDIR=${D}${FROMDIR} - if [[ ${FROMDIR} != "${TODIR}" && -d ${FROMDIR} ]] ; then - local files=$(find "${FROMDIR}" -maxdepth 1 ! -type d 2>/dev/null) - if [[ -n ${files} ]] ; then - mv ${files} "${TODIR}" - fi - fi - done - fix_libtool_libdir_paths "${LIBPATH}/${MULTIDIR}" - done - - # We remove directories separately to avoid this case: - # mv SRC/lib/../lib/*.o DEST - # rmdir SRC/lib/../lib/ - # mv SRC/lib/../lib32/*.o DEST # Bork - for FROMDIR in ${removedirs} ; do - rmdir "${D}"${FROMDIR} >& /dev/null - done - find "${D}" -type d | xargs rmdir >& /dev/null -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/gcc-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/gcc-9999.ebuild deleted file mode 100644 index 7fd839dbc5..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gcc/gcc-9999.ebuild +++ /dev/null @@ -1,546 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.4.3-r3.ebuild,v 1.1 2010/06/19 01:53:09 zorry Exp $ - -EAPI=1 -CROS_WORKON_LOCALNAME=gcc -CROS_WORKON_PROJECT=chromiumos/third_party/gcc - -inherit eutils cros-workon binutils-funcs - -GCC_FILESDIR="${PORTDIR}/sys-devel/gcc/files" - -DESCRIPTION="The GNU Compiler Collection. Includes C/C++, java compilers, pie+ssp extensions, Haj Ten Brugge runtime bounds checking. This Compiler is based off of Crosstoolv14." - -LICENSE="GPL-3 LGPL-3 || ( GPL-3 libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2" -KEYWORDS="~amd64 ~arm ~x86" - -RDEPEND=">=sys-libs/zlib-1.1.4 - >=sys-devel/gcc-config-1.6 - virtual/libiconv - >=dev-libs/gmp-4.2.1 - >=dev-libs/mpc-0.8.1 - >=dev-libs/mpfr-2.3.2 - graphite? ( - >=dev-libs/ppl-0.10 - >=dev-libs/cloog-ppl-0.15.4 - ) - !build? ( - gcj? ( - gtk? ( - x11-libs/libXt - x11-libs/libX11 - x11-libs/libXtst - x11-proto/xproto - x11-proto/xextproto - >=x11-libs/gtk+-2.2 - x11-libs/pango - ) - >=media-libs/libart_lgpl-2.1 - app-arch/zip - app-arch/unzip - ) - >=sys-libs/ncurses-5.2-r2 - nls? ( sys-devel/gettext ) - )" -DEPEND="${RDEPEND} - test? ( >=dev-util/dejagnu-1.4.4 >=sys-devel/autogen-5.5.4 ) - >=sys-apps/texinfo-4.8 - >=sys-devel/bison-1.875 - elibc_glibc? ( >=sys-libs/glibc-2.8 ) - amd64? ( multilib? ( gcj? ( app-emulation/emul-linux-x86-xlibs ) ) ) - ppc? ( >=${CATEGORY}/binutils-2.17 ) - ppc64? ( >=${CATEGORY}/binutils-2.17 ) - >=${CATEGORY}/binutils-2.15.94" -PDEPEND=">=sys-devel/gcc-config-1.4" -if [[ ${CATEGORY} != cross-* ]] ; then - PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )" -fi - -RESTRICT="mirror strip" - -IUSE="gcj git_gcc graphite gtk hardened hardfp mounted_gcc multilib multislot - nls cxx openmp tests +thumb upstream_gcc vanilla +wrapper_ccache" - -is_crosscompile() { [[ ${CHOST} != ${CTARGET} ]] ; } - -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} = ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi - -if use multislot ; then - SLOT="${CTARGET}-${PV}" -else - SLOT="${CTARGET}" -fi - -PREFIX=/usr - -src_unpack() { - if use mounted_gcc ; then - if [[ ! -d "$(get_gcc_dir)" ]] ; then - die "gcc dir not mounted/present at: $(get_gcc_dir)" - fi - elif use upstream_gcc ; then - GCC_MIRROR=ftp://mirrors.kernel.org/gnu/gcc - GCC_TARBALL=${GCC_MIRROR}/${P}/${P}.tar.bz2 - wget $GCC_TARBALL - tar xf ${GCC_TARBALL##*/} - elif use git_gcc ; then - git clone "${CROS_WORKON_REPO}/${CROS_WORKON_PROJECT}.git" "${S}" - if [[ -n ${GCC_GITHASH} ]] ; then - einfo "Checking out: ${GCC_GITHASH}" - pushd "$(get_gcc_dir)" >/dev/null - git checkout ${GCC_GITHASH} || \ - die "Couldn't checkout ${GCC_GITHASH}" - popd >/dev/null - fi - else - cros-workon_src_unpack - cd "${S}" - [[ ${ABI} == "x32" ]] && epatch "${FILESDIR}"/90_all_gcc-4.7-x32.patch - fi - - COST_PKG_VERSION="$("${FILESDIR}"/chromeos-version.sh "${S}")_cos_gg" - - if [[ -d ${S}/.git ]]; then - COST_PKG_VERSION+="_$(cd ${S}; git describe --always)" - elif [[ -n ${VCSID} ]]; then - COST_PKG_VERSION+="_${VCSID}" - fi -} - -src_compile() -{ - src_configure - cd $(get_gcc_build_dir) || "Build dir $(get_gcc_build_dir) not found" - GCC_CFLAGS="$(portageq envvar CFLAGS)" - TARGET_FLAGS="" - - if use hardened - then - TARGET_FLAGS="${TARGET_FLAGS} -fstack-protector-strong -D_FORTIFY_SOURCE=2" - fi - - # Do not link libgcc with gold. That is known to fail on internal linker - # errors. See crosbug.com/16719 - local LD_NON_GOLD="$(get_binutils_path_ld ${CTARGET})/ld" - - emake CFLAGS="${GCC_CFLAGS}" \ - LDFLAGS="-Wl,-O1" \ - STAGE1_CFLAGS="-O2 -pipe" \ - BOOT_CFLAGS="-O2" \ - CFLAGS_FOR_TARGET="$(get_make_var CFLAGS_FOR_TARGET) ${TARGET_FLAGS}" \ - CXXFLAGS_FOR_TARGET="$(get_make_var CXXFLAGS_FOR_TARGET) ${TARGET_FLAGS}" \ - LD_FOR_TARGET="${LD_NON_GOLD}" \ - all || die -} - -# Logic copied from Gentoo's toolchain.eclass. -toolchain_src_install() { - BINPATH=$(get_bin_dir) # cros to Gentoo glue - - # These should be symlinks - dodir /usr/bin - cd "${D}"${BINPATH} - for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do - # For some reason, g77 gets made instead of ${CTARGET}-g77... - # this should take care of that - [[ -f ${x} ]] && mv ${x} ${CTARGET}-${x} - - if [[ -f ${CTARGET}-${x} ]] ; then - if ! is_crosscompile ; then - ln -sf ${CTARGET}-${x} ${x} - dosym ${BINPATH}/${CTARGET}-${x} \ - /usr/bin/${x}-${GCC_CONFIG_VER} - fi - - # Create version-ed symlinks - dosym ${BINPATH}/${CTARGET}-${x} \ - /usr/bin/${CTARGET}-${x}-${GCC_CONFIG_VER} - fi - - if [[ -f ${CTARGET}-${x}-${GCC_CONFIG_VER} ]] ; then - rm -f ${CTARGET}-${x}-${GCC_CONFIG_VER} - ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_CONFIG_VER} - fi - done -} - -src_install() -{ - cd $(get_gcc_build_dir) || "Build dir $(get_gcc_build_dir) not found" - emake DESTDIR="${D}" install || die "Could not install gcc" - - find "${D}" -name libiberty.a -exec rm -f "{}" \; - - # Move the libraries to the proper location - gcc_movelibs - - # Move pretty-printers to gdb datadir to shut ldconfig up - gcc_move_pretty_printers - - GCC_CONFIG_VER=$(get_gcc_base_ver) - dodir /etc/env.d/gcc - insinto /etc/env.d/gcc - - local LDPATH=$(get_lib_dir) - for SUBDIR in 32 64 ; do - if [[ -d ${D}/${LDPATH}/${SUBDIR} ]] - then - LDPATH="${LDPATH}:${LDPATH}/${SUBDIR}" - fi - done - - cat <<-EOF > env.d -LDPATH="${LDPATH}" -MANPATH="$(get_data_dir)/man" -INFOPATH="$(get_data_dir)/info" -STDCXX_INCDIR="$(get_stdcxx_incdir)" -CTARGET=${CTARGET} -GCC_PATH="$(get_bin_dir)" -GCC_VER="$(get_gcc_base_ver)" -EOF - newins env.d $(get_gcc_config_file) - cd - - - toolchain_src_install - - if is_crosscompile ; then - if use hardened - then - SYSROOT_WRAPPER_FILE=sysroot_wrapper.hardened - else - SYSROOT_WRAPPER_FILE=sysroot_wrapper - fi - - exeinto "$(get_bin_dir)" - doexe "${FILESDIR}/${SYSROOT_WRAPPER_FILE}" || die - sed -i \ - -e "/^use_ccache = .*@CCACHE_DEFAULT@/s:=[^#]*:= $(usex wrapper_ccache True False) :" \ - "${D}$(get_bin_dir)/${SYSROOT_WRAPPER_FILE}" || die - for x in c++ cpp g++ gcc; do - if [[ -f "${CTARGET}-${x}" ]]; then - mv "${CTARGET}-${x}" "${CTARGET}-${x}.real" - dosym "${SYSROOT_WRAPPER_FILE}" "$(get_bin_dir)/${CTARGET}-${x}" || die - fi - done - fi - - if use tests - then - TEST_INSTALL_DIR="usr/local/dejagnu/gcc" - dodir ${TEST_INSTALL_DIR} - cd ${D}/${TEST_INSTALL_DIR} - tar -czf "tests.tar.gz" ${WORKDIR} - fi -} - -pkg_preinst() -{ - # We handle ccache ourselves in the sysroot wrapper. - rm -f /usr/lib/ccache/bin/*-* - - local ccache_dir="/var/cache/distfiles/ccache" - local vcsid_file="${ccache_dir}/.gcc.vcsid.${CTARGET}" - # Clean out the ccache whenever the gcc code changes. - # If we are using a live ebuild, nuke it everytime just - # to be safe. - [[ ${PV} == "9999" ]] && rm -f "${vcsid_file}" - local old_vcsid=$(cat "${vcsid_file}" 2>/dev/null) - if [[ ${old_vcsid} != ${CROS_WORKON_COMMIT} ]] ; then - # Don't just delete the whole dir as that would punt - # the vcsid tag files from other targets too. - rm -rf "${ccache_dir}"/* - fi - mkdir -p -m 2775 "${ccache_dir}" - echo "${CROS_WORKON_COMMIT}" > "${vcsid_file}" - - # Use a 10G limit as our bots have finite resources. A full - # x86-generic build uses ~6GB, while an amd64-generic uses - # ~8GB, so this limit should be sufficient. - CCACHE_UMASK=002 CCACHE_DIR=${ccache_dir} ccache -F 0 -M 11G - - # Make sure the dirs have perms for emerge builders. - chown -R ${PORTAGE_USERNAME}:portage "${ccache_dir}" -} - -pkg_postinst() -{ - gcc-config $(get_gcc_config_file) -} - -pkg_postrm() -{ - if is_crosscompile ; then - if [[ -z $(ls "${ROOT}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then - rm -f "${ROOT}"/etc/env.d/gcc/config-${CTARGET} - rm -f "${ROOT}"/etc/env.d/??gcc-${CTARGET} - rm -f "${ROOT}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64} - fi - fi -} - -src_configure() -{ - if use mounted_gcc && [[ -f $(get_gcc_build_dir)/Makefile ]] ; then - return - fi - - # Set configuration based on path variables - local DATAPATH=$(get_data_dir) - local confgcc="$(use_enable multilib) - --prefix=${PREFIX} \ - --bindir=$(get_bin_dir) \ - --datadir=${DATAPATH} \ - --mandir=${DATAPATH}/man \ - --infodir=${DATAPATH}/info \ - --includedir=$(get_lib_dir)/include \ - --with-gxx-include-dir=$(get_stdcxx_incdir) - --with-python-dir=${DATAPATH#${PREFIX}}/python" - confgcc="${confgcc} --host=${CHOST}" - confgcc="${confgcc} --target=${CTARGET}" - confgcc="${confgcc} --build=${CBUILD}" - - # Language options for stage1/stage2. - if ! use cxx - then - GCC_LANG="c" - else - GCC_LANG="c,c++" - fi - confgcc="${confgcc} --enable-languages=${GCC_LANG}" - - if use hardfp && [[ ${CTARGET} == arm* ]] ; - then - confgcc="${confgcc} --with-float=hard" - fi - - if use thumb && [[ ${CTARGET} == arm* ]] ; - then - confgcc="${confgcc} --with-mode=thumb" - fi - - if is_crosscompile ; then - local needed_libc="glibc" - if [[ -n ${needed_libc} ]] ; then - if ! has_version ${CATEGORY}/${needed_libc} ; then - confgcc="${confgcc} --disable-shared --disable-threads --without-headers" - elif built_with_use --hidden --missing false ${CATEGORY}/${needed_libc} crosscompile_opts_headers-only ; then - confgcc="${confgcc} --disable-shared --with-sysroot=/usr/${CTARGET}" - else - confgcc="${confgcc} --with-sysroot=/usr/${CTARGET}" - fi - fi - else - confgcc="${confgcc} --enable-shared --enable-threads=posix" - fi - - confgcc="${confgcc} $(get_gcc_configure_options ${CTARGET})" - - EXTRA_ECONF="--with-bugurl=http://code.google.com/p/chromium-os/issues/entry\ - --with-pkgversion=${COST_PKG_VERSION} --enable-linker-build-id" - confgcc="${confgcc} ${EXTRA_ECONF}" - - # Build in a separate build tree - mkdir -p $(get_gcc_build_dir) || \ - die "Could not create build dir $(get_gcc_build_dir)" - cd $(get_gcc_build_dir) || die "Build dir $(get_gcc_build_dir) not found" - - # and now to do the actual configuration - addwrite /dev/zero - echo "Running this:" - echo "configure ${confgcc}" - echo "$(get_gcc_dir)"/configure "$@" - "$(get_gcc_dir)"/configure ${confgcc} || die "failed to run configure" -} - -get_gcc_configure_options() -{ - local CTARGET=$1; shift - local confgcc=$(get_gcc_common_options) - case ${CTARGET} in - arm*) #264534 - local arm_arch="${CTARGET%%-*}" - # Only do this if arm_arch is armv* - if [[ ${arm_arch} == armv* ]] ; then - # Convert armv7{a,r,m} to armv7-{a,r,m} - [[ ${arm_arch} == armv7? ]] && arm_arch=${arm_arch/7/7-} - # Remove endian ('l' / 'eb') - [[ ${arm_arch} == *l ]] && arm_arch=${arm_arch%l} - [[ ${arm_arch} == *eb ]] && arm_arch=${arm_arch%eb} - confgcc="${confgcc} --with-arch=${arm_arch}" - confgcc="${confgcc} --disable-esp" - fi - ;; - i?86*) - # Hardened is enabled for x86, but disabled for ARM. - confgcc="${confgcc} --enable-esp" - confgcc="${confgcc} --with-arch=atom" - confgcc="${confgcc} --with-tune=atom" - # Remove this once crash2 supports larger symbols. - # http://code.google.com/p/chromium-os/issues/detail?id=23321 - confgcc="${confgcc} --enable-frame-pointer" - ;; - x86_64*-gnux32) - confgcc="${confgcc} --with-abi=x32 --with-multilib-list=mx32" - ;; - esac - echo ${confgcc} -} - -get_gcc_common_options() -{ - local confgcc - confgcc="${confgcc} --disable-libmudflap" - confgcc="${confgcc} --disable-libssp" - confgcc+=" $(use_enable openmp libgomp)" - confgcc="${confgcc} --enable-__cxa_atexit" - confgcc="${confgcc} --enable-checking=release" - confgcc="${confgcc} --disable-libquadmath" - echo ${confgcc} -} - -get_gcc_dir() -{ - local GCCDIR - if use mounted_gcc ; then - GCCDIR=${GCC_SOURCE_PATH:=/usr/local/toolchain_root/gcc} - elif use upstream_gcc ; then - GCCDIR=${P} - else - GCCDIR=${S} - fi - echo "${GCCDIR}" -} - -get_gcc_build_dir() -{ - echo "$(get_gcc_dir)-build-${CTARGET}" -} - -get_gcc_base_ver() -{ - cat "$(get_gcc_dir)/gcc/BASE-VER" -} - -get_stdcxx_incdir() -{ - echo "$(get_lib_dir)/include/g++-v4" -} - -get_lib_dir() -{ - echo "${PREFIX}/lib/gcc/${CTARGET}/$(get_gcc_base_ver)" -} - -get_bin_dir() -{ - if is_crosscompile ; then - echo ${PREFIX}/${CHOST}/${CTARGET}/gcc-bin/$(get_gcc_base_ver) - else - echo ${PREFIX}/${CTARGET}/gcc-bin/$(get_gcc_base_ver) - fi -} - -get_data_dir() -{ - echo "${PREFIX}/share/gcc-data/${CTARGET}/$(get_gcc_base_ver)" -} - -get_gcc_config_file() -{ - echo ${CTARGET}-${PV} -} - -# Grab a variable from the build system (taken from linux-info.eclass) -get_make_var() { - local var=$1 makefile=${2:-$(get_gcc_build_dir)/Makefile} - echo -e "e:\\n\\t@echo \$(${var})\\ninclude ${makefile}" | \ - r=${makefile%/*} emake --no-print-directory -s -f - 2>/dev/null -} -XGCC() { get_make_var GCC_FOR_TARGET ; } - -gcc_move_pretty_printers() { - LIBPATH=$(get_lib_dir) # cros to Gentoo glue - - local py gdbdir=/usr/share/gdb/auto-load${LIBPATH} - pushd "${D}"${LIBPATH} >/dev/null - for py in $(find . -name '*-gdb.py') ; do - local multidir=${py%/*} - insinto "${gdbdir}/${multidir}" - sed -i "/^libdir =/s:=.*:= '${LIBPATH}/${multidir}':" "${py}" || die #348128 - doins "${py}" || die - rm "${py}" || die - done - popd >/dev/null -} - -# make sure the libtool archives have libdir set to where they actually -# -are-, and not where they -used- to be. also, any dependencies we have -# on our own .la files need to be updated. -fix_libtool_libdir_paths() { - pushd "${D}" >/dev/null - - pushd "./${1}" >/dev/null - local dir="${PWD#${D%/}}" - local allarchives=$(echo *.la) - allarchives="\(${allarchives// /\\|}\)" - popd >/dev/null - - sed -i \ - -e "/^libdir=/s:=.*:='${dir}':" \ - ./${dir}/*.la - sed -i \ - -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" \ - $(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') \ - ./${dir}/*.la - - popd >/dev/null -} - -gcc_movelibs() { - LIBPATH=$(get_lib_dir) # cros to Gentoo glue - - local multiarg removedirs="" - for multiarg in $($(XGCC) -print-multi-lib) ; do - multiarg=${multiarg#*;} - multiarg=${multiarg//@/ -} - - local OS_MULTIDIR=$($(XGCC) ${multiarg} --print-multi-os-directory) - local MULTIDIR=$($(XGCC) ${multiarg} --print-multi-directory) - local TODIR=${D}${LIBPATH}/${MULTIDIR} - local FROMDIR= - - [[ -d ${TODIR} ]] || mkdir -p ${TODIR} - - for FROMDIR in \ - ${LIBPATH}/${OS_MULTIDIR} \ - ${LIBPATH}/../${MULTIDIR} \ - ${PREFIX}/lib/${OS_MULTIDIR} \ - ${PREFIX}/${CTARGET}/lib/${OS_MULTIDIR} - do - removedirs="${removedirs} ${FROMDIR}" - FROMDIR=${D}${FROMDIR} - if [[ ${FROMDIR} != "${TODIR}" && -d ${FROMDIR} ]] ; then - local files=$(find "${FROMDIR}" -maxdepth 1 ! -type d 2>/dev/null) - if [[ -n ${files} ]] ; then - mv ${files} "${TODIR}" - fi - fi - done - fix_libtool_libdir_paths "${LIBPATH}/${MULTIDIR}" - done - - # We remove directories separately to avoid this case: - # mv SRC/lib/../lib/*.o DEST - # rmdir SRC/lib/../lib/ - # mv SRC/lib/../lib32/*.o DEST # Bork - for FROMDIR in ${removedirs} ; do - rmdir "${D}"${FROMDIR} >& /dev/null - done - find "${D}" -type d | xargs rmdir >& /dev/null -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/Manifest b/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/Manifest deleted file mode 100644 index d807c0efda..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/Manifest +++ /dev/null @@ -1,2 +0,0 @@ -DIST gdb-7.1-patches-1.tar.lzma 9207 RMD160 61d829abcfe7186f679ead31540fc9c2c9f0aad9 SHA1 35ca21761d451481a1ff0caa12c95eb9eb0f4e67 SHA256 d2efe1ee66110e4e0c55bbe4365380bdb6e159c45ea849a1e329ac293b4e7e3c -DIST gdb-7.1.tar.bz2 17977195 RMD160 800d224496240a360c996e588490f2d87367c4e3 SHA1 417e2e637a296ea0e1cdddf56233311b8708fa19 SHA256 142c27d7970a4e652dc225d61d887777ae00cf22fdd75cd1e8e4e13bfbd85352 diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/files/chromeos-version.sh b/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/files/chromeos-version.sh deleted file mode 100755 index 366df78d2f..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/files/chromeos-version.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -# -# This script is given one argument: the base of the source directory of -# the package, and it prints a string on stdout with the numerical version -# number for said repo. - -exec sed 's:-gg:_p:' "$1"/gdb/version.in diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/gdb-7.2-r2.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/gdb-7.2-r2.ebuild deleted file mode 100644 index cd43f6dac1..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/gdb-7.2-r2.ebuild +++ /dev/null @@ -1,150 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/gdb-9999.ebuild,v 1.3 2011/08/23 16:21:56 vapier Exp $ - -EAPI="3" - -inherit flag-o-matic eutils - -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} == ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } - -RPM= -MY_PV=${PV} -case ${PV} in -*.*.*.*.*.*) - # fedora version: gdb-6.8.50.20090302-8.fc11.src.rpm - inherit versionator rpm - gvcr() { get_version_component_range "$@"; } - MY_PV=$(gvcr 1-4) - RPM="${PN}-${MY_PV}-$(gvcr 5).fc$(gvcr 6).src.rpm" - SRC_URI="mirror://fedora/development/source/SRPMS/${RPM}" - ;; -*.*.50.*) - # weekly snapshots - SRC_URI="ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.bz2" - ;; -7.2 | 9999*) - # live git tree - EGIT_REPO_URI="http://git.chromium.org/chromiumos/third_party/gdb.git" - EGIT_COMMIT=c4aa8d2c86b0fbfd969fd80fbc91727740a2dd27 - inherit git - SRC_URI="" - ;; -*) - # Normal upstream release - SRC_URI="http://ftp.gnu.org/gnu/gdb/${P}.tar.bz2 - ftp://sources.redhat.com/pub/gdb/releases/${P}.tar.bz2" - ;; -esac - -PATCH_VER="" -DESCRIPTION="GNU debugger" -HOMEPAGE="http://sourceware.org/gdb/" -SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}" - -LICENSE="GPL-2 LGPL-2" -is_cross \ - && SLOT="${CTARGET}" \ - || SLOT="0" -if [[ ${PV} != 9999* ]] ; then - KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86 ~x86-fbsd" -fi -IUSE="expat multitarget nls python test vanilla mounted_sources" - -RDEPEND=">=sys-libs/ncurses-5.2-r2 - sys-libs/readline - expat? ( dev-libs/expat ) - python? ( =dev-lang/python-2* )" -DEPEND="${RDEPEND} - app-arch/xz-utils - virtual/yacc - test? ( dev-util/dejagnu ) - nls? ( sys-devel/gettext )" - -S=${WORKDIR}/${PN}-${MY_PV} - -src_unpack () { - if use mounted_sources ; then - : ${GDBDIR:=/usr/local/toolchain_root/gdb/gdb-7.2.x} - if [[ ! -d ${GDBDIR} ]] ; then - die "gdb dir not mounted/present at: ${GDBDIR}" - fi - cp -R ${GDBDIR} ${S} - else - git_src_unpack - fi -} - -src_prepare() { - [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec - use vanilla || [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch - strip-linguas -u bfd/po opcodes/po -} - -gdb_branding() { - printf "Gentoo ${PV} " - if [[ -n ${PATCH_VER} ]] ; then - printf "p${PATCH_VER}" - else - printf "vanilla" - fi -} - -src_configure() { - strip-unsupported-flags - econf \ - --with-pkgversion="$(gdb_branding)" \ - --with-bugurl='http://bugs.gentoo.org/' \ - --disable-werror \ - --enable-64-bit-bfd \ - --with-system-readline \ - --with-separate-debug-dir=/usr/lib/debug \ - $(is_cross && echo --with-sysroot=/usr/${CTARGET}) \ - $(use_with expat) \ - $(use_enable nls) \ - $(use multitarget && echo --enable-targets=all) \ - $(use_with python python "${EPREFIX}/usr/bin/python2") -} - -src_test() { - emake check || ewarn "tests failed" -} - -src_install() { - emake \ - DESTDIR="${D}" \ - {include,lib}dir=/nukeme/pretty/pretty/please \ - install || die - rm -r "${D}"/nukeme || die - - # Don't install docs when building a cross-gdb - if [[ ${CTARGET} != ${CHOST} ]] ; then - rm -r "${D}"/usr/share - return 0 - fi - - dodoc README - docinto gdb - dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \ - gdb/NEWS gdb/ChangeLog gdb/PROBLEMS - docinto sim - dodoc sim/ChangeLog sim/MAINTAINERS sim/README-HACKING - - if [[ -n ${PATCH_VER} ]] ; then - dodoc "${WORKDIR}"/extra/gdbinit.sample - fi - - # Remove shared info pages - rm -f "${D}"/usr/share/info/{annotate,bfd,configure,standards}.info* -} - -pkg_postinst() { - # portage sucks and doesnt unmerge files in /etc - rm -vf "${ROOT}"/etc/skel/.gdbinit -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/gdb-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/gdb-9999.ebuild deleted file mode 100644 index e0f3245fdd..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-devel/gdb/gdb-9999.ebuild +++ /dev/null @@ -1,150 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/gdb-9999.ebuild,v 1.3 2011/08/23 16:21:56 vapier Exp $ - -EAPI="3" - -inherit flag-o-matic eutils - -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} == ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } - -RPM= -MY_PV=${PV} -case ${PV} in -*.*.*.*.*.*) - # fedora version: gdb-6.8.50.20090302-8.fc11.src.rpm - inherit versionator rpm - gvcr() { get_version_component_range "$@"; } - MY_PV=$(gvcr 1-4) - RPM="${PN}-${MY_PV}-$(gvcr 5).fc$(gvcr 6).src.rpm" - SRC_URI="mirror://fedora/development/source/SRPMS/${RPM}" - ;; -*.*.50.*) - # weekly snapshots - SRC_URI="ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.bz2" - ;; -*) - # live git tree - EGIT_REPO_URI="http://git.chromium.org/chromiumos/third_party/gdb.git" - EGIT_COMMIT=c4aa8d2c86b0fbfd969fd80fbc91727740a2dd27 - inherit git - SRC_URI="" - ;; -*) - # Normal upstream release - SRC_URI="http://ftp.gnu.org/gnu/gdb/${P}.tar.bz2 - ftp://sources.redhat.com/pub/gdb/releases/${P}.tar.bz2" - ;; -esac - -PATCH_VER="" -DESCRIPTION="GNU debugger" -HOMEPAGE="http://sourceware.org/gdb/" -SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}" - -LICENSE="GPL-2 LGPL-2" -is_cross \ - && SLOT="${CTARGET}" \ - || SLOT="0" -if [[ ${PV} != 9999* ]] ; then - KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86 ~x86-fbsd" -fi -IUSE="expat multitarget nls python test vanilla mounted_sources" - -RDEPEND=">=sys-libs/ncurses-5.2-r2 - sys-libs/readline - expat? ( dev-libs/expat ) - python? ( =dev-lang/python-2* )" -DEPEND="${RDEPEND} - app-arch/xz-utils - virtual/yacc - test? ( dev-util/dejagnu ) - nls? ( sys-devel/gettext )" - -S=${WORKDIR}/${PN}-${MY_PV} - -src_unpack () { - if use mounted_sources ; then - : ${GDBDIR:=/usr/local/toolchain_root/gdb/gdb-7.2.x} - if [[ ! -d ${GDBDIR} ]] ; then - die "gdb dir not mounted/present at: ${GDBDIR}" - fi - cp -R ${GDBDIR} ${S} - else - git_src_unpack - fi -} - -src_prepare() { - [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec - use vanilla || [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch - strip-linguas -u bfd/po opcodes/po -} - -gdb_branding() { - printf "Gentoo ${PV} " - if [[ -n ${PATCH_VER} ]] ; then - printf "p${PATCH_VER}" - else - printf "vanilla" - fi -} - -src_configure() { - strip-unsupported-flags - econf \ - --with-pkgversion="$(gdb_branding)" \ - --with-bugurl='http://bugs.gentoo.org/' \ - --disable-werror \ - --enable-64-bit-bfd \ - --with-system-readline \ - --with-separate-debug-dir=/usr/lib/debug \ - $(is_cross && echo --with-sysroot=/usr/${CTARGET}) \ - $(use_with expat) \ - $(use_enable nls) \ - $(use multitarget && echo --enable-targets=all) \ - $(use_with python python "${EPREFIX}/usr/bin/python2") -} - -src_test() { - emake check || ewarn "tests failed" -} - -src_install() { - emake \ - DESTDIR="${D}" \ - {include,lib}dir=/nukeme/pretty/pretty/please \ - install || die - rm -r "${D}"/nukeme || die - - # Don't install docs when building a cross-gdb - if [[ ${CTARGET} != ${CHOST} ]] ; then - rm -r "${D}"/usr/share - return 0 - fi - - dodoc README - docinto gdb - dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \ - gdb/NEWS gdb/ChangeLog gdb/PROBLEMS - docinto sim - dodoc sim/ChangeLog sim/MAINTAINERS sim/README-HACKING - - if [[ -n ${PATCH_VER} ]] ; then - dodoc "${WORKDIR}"/extra/gdbinit.sample - fi - - # Remove shared info pages - rm -f "${D}"/usr/share/info/{annotate,bfd,configure,standards}.info* -} - -pkg_postinst() { - # portage sucks and doesnt unmerge files in /etc - rm -vf "${ROOT}"/etc/skel/.gdbinit -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/Manifest b/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/Manifest deleted file mode 100644 index a030846a3f..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/Manifest +++ /dev/null @@ -1,2 +0,0 @@ -DIST gentoo-headers-3.4-1.tar.xz 3524 SHA256 96575df8c65d749b832880d41db4b694ccaa76a6386eef80e4e9cd123625bfee SHA512 29baad764311d100815c2572e1ba868cf75f0fbf8a1ae38e047daf729b305e059fb94a8c521b88735f5d4678316c314a191e066efa96263347c2c7612a5ab6ee WHIRLPOOL 0160261bc0397a101fefaf66c1e647d7696fe64203b288f358ff8448c49c22e4e37eae7411dde3c11decd578355c825c27bd959e41b209f029d688e184da784e -DIST gentoo-headers-base-3.4.tar.xz 5115932 SHA256 c1aceea837dc6c05c869f41897e393cc14ef4b8b3e77440b40ae1684360fc154 SHA512 2400cb99d275c6d3be8fa9d3e5a4e2e1db9377227b1ae561ac3511659f10c7d1dc667d5fd5b43b9acde8d69bd299273b03b2413a98de70e6f79f0df210cf8ee2 WHIRLPOOL 5d0039e1bfdea386c20d58e84a170c69db48876fc31c09843dd48583c4fc095d15cc19a353c162b709536c8893740175ba86dca5c4e7322c36fa036cc510e50b diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-Add-DMABUF-as-a-memory-type.patch b/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-Add-DMABUF-as-a-memory-type.patch deleted file mode 100644 index a7c28134f0..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-Add-DMABUF-as-a-memory-type.patch +++ /dev/null @@ -1,50 +0,0 @@ -From eb12f7626253e47c8a3394bd07c8460d4775eae7 Mon Sep 17 00:00:00 2001 -From: Sean Paul -Date: Wed, 20 Jun 2012 11:39:22 -0400 -Subject: [PATCH] v4l: Add DMABUF as a memory type - -Adds DMABUF memory type to v4l framework. Also adds the related file -descriptor in v4l2_plane and v4l2_buffer. - -Change-Id: If6b8d3e16bf487d87352008f9ac5d3bdad5ab732 -Signed-off-by: Tomasz Stanislawski -[original work in the PoC for buffer sharing] -Signed-off-by: Sumit Semwal -Signed-off-by: Sumit Semwal -Acked-by: Laurent Pinchart -Signed-off-by: Sean Paul ---- - include/linux/videodev2.h | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h -index 7915525..92a495d 100644 ---- a/include/linux/videodev2.h -+++ b/include/linux/videodev2.h -@@ -185,6 +185,7 @@ enum v4l2_memory { - V4L2_MEMORY_MMAP = 1, - V4L2_MEMORY_USERPTR = 2, - V4L2_MEMORY_OVERLAY = 3, -+ V4L2_MEMORY_DMABUF = 4, - }; - - /* see also http://vektor.theorem.ca/graphics/ycbcr/ */ -@@ -617,6 +618,7 @@ struct v4l2_plane { - union { - __u32 mem_offset; - unsigned long userptr; -+ int fd; - } m; - __u32 data_offset; - __u32 reserved[11]; -@@ -667,6 +669,7 @@ struct v4l2_buffer { - __u32 offset; - unsigned long userptr; - struct v4l2_plane *planes; -+ int fd; - } m; - __u32 length; - __u32 input; --- -1.7.7.3 - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-CHROMIUM-v4l2-exynos-move-CID-enums-into-videodev2.h.patch b/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-CHROMIUM-v4l2-exynos-move-CID-enums-into-videodev2.h.patch deleted file mode 100644 index 8b2cdfe88f..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-CHROMIUM-v4l2-exynos-move-CID-enums-into-videodev2.h.patch +++ /dev/null @@ -1,48 +0,0 @@ -sheu@chromium.org: trimmed from 3.4 kernel patch - -From e5b2998def807693aa5796112423117022318db2 Mon Sep 17 00:00:00 2001 -From: John Sheu -Date: Fri, 4 Jan 2013 19:08:53 -0800 -Subject: [PATCH] CHROMIUM: v4l2/exynos: move CID enums into videodev2.h - -Move some #defines for V4L_CID_* values out of gsc-core.h and into -videodev2.h, where they belong, as they are part of the userspace API. - -Signed-off-by: John Sheu - -BUG=chromium-os:37294 -BUG=chrome-os-partner:10057 -TEST=local build, run on snow - -Change-Id: Ib06cd97f8c294a0d5f42f0b2adfefe4d761b256f ---- - drivers/media/video/exynos/gsc/gsc-core.h | 12 ------------ - include/linux/videodev2.h | 13 ++++++++++++- - 2 files changed, 12 insertions(+), 13 deletions(-) - -diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h -index 09f7f6d..405313f 100644 ---- a/include/linux/videodev2.h -+++ b/include/linux/videodev2.h -@@ -1342,6 +1342,18 @@ enum v4l2_colorfx { - /* last CID + 1 */ - #define V4L2_CID_LASTP1 (V4L2_CID_BASE+42) - -+#define V4L2_CID_CACHEABLE (V4L2_CID_LASTP1 + 1) -+#define V4L2_CID_TV_LAYER_BLEND_ENABLE (V4L2_CID_LASTP1 + 2) -+#define V4L2_CID_TV_LAYER_BLEND_ALPHA (V4L2_CID_LASTP1 + 3) -+#define V4L2_CID_TV_PIXEL_BLEND_ENABLE (V4L2_CID_LASTP1 + 4) -+#define V4L2_CID_TV_CHROMA_ENABLE (V4L2_CID_LASTP1 + 5) -+#define V4L2_CID_TV_CHROMA_VALUE (V4L2_CID_LASTP1 + 6) -+/* for color space conversion equation selection */ -+#define V4L2_CID_CSC_EQ_MODE (V4L2_CID_LASTP1 + 8) -+#define V4L2_CID_CSC_EQ (V4L2_CID_LASTP1 + 9) -+#define V4L2_CID_CSC_RANGE (V4L2_CID_LASTP1 + 10) -+#define V4L2_CID_GLOBAL_ALPHA (V4L2_CID_LASTP1 + 11) -+#define V4L2_CID_CODEC_DISPLAY_STATUS (V4L2_CID_LASTP1 + 12) - - /* MPEG-class control IDs defined by V4L2 */ - #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) --- -1.7.8.6 - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-MFC-update-MFC-v4l2-driver-to-support-MFC6.x.patch b/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-MFC-update-MFC-v4l2-driver-to-support-MFC6.x.patch deleted file mode 100644 index 9ce247623d..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-MFC-update-MFC-v4l2-driver-to-support-MFC6.x.patch +++ /dev/null @@ -1,609 +0,0 @@ -sheu@chromium.org: trimmed from 3.4 kernel patch - -From 122c0bd18b7df7d40e28be846d57eba291fae955 Mon Sep 17 00:00:00 2001 -From: Naveen Krishna Chatradhi -Date: Wed, 23 May 2012 10:21:26 +0100 -Subject: [PATCH] MFC: update MFC v4l2 driver to support MFC6.x - -Multi Format Codec 6.x is a hardware video coding acceleration -module fount in new Exynos5 SoC series. -It is capable of handling a range of video codecs and this driver -provides a V4L2 interface for video decoding and encoding. - -Change-Id: I69854c51ef20599add4e17b5d4df338785b5432f -Signed-off-by: Jeongtae Park -Singed-off-by: Janghyuck Kim -Singed-off-by: Jaeryul Oh -Cc: Marek Szyprowski -Cc: Kamil Debski ---- - drivers/media/video/Kconfig | 26 +- - drivers/media/video/s5p-mfc/Makefile | 7 +- - drivers/media/video/s5p-mfc/regs-mfc-v6.h | 671 ++++++++++ - drivers/media/video/s5p-mfc/regs-mfc.h | 29 + - drivers/media/video/s5p-mfc/s5p_mfc.c | 192 ++- - drivers/media/video/s5p-mfc/s5p_mfc_cmd.c | 4 +- - drivers/media/video/s5p-mfc/s5p_mfc_cmd.h | 3 + - drivers/media/video/s5p-mfc/s5p_mfc_cmd_v6.c | 130 ++ - drivers/media/video/s5p-mfc/s5p_mfc_common.h | 125 ++- - drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c | 161 ++- - drivers/media/video/s5p-mfc/s5p_mfc_dec.c | 237 +++- - drivers/media/video/s5p-mfc/s5p_mfc_dec.h | 1 + - drivers/media/video/s5p-mfc/s5p_mfc_enc.c | 374 +++++-- - drivers/media/video/s5p-mfc/s5p_mfc_enc.h | 1 + - drivers/media/video/s5p-mfc/s5p_mfc_opr.c | 266 +++-- - drivers/media/video/s5p-mfc/s5p_mfc_opr.h | 20 +- - drivers/media/video/s5p-mfc/s5p_mfc_opr_v6.c | 1677 ++++++++++++++++++++++++++ - drivers/media/video/s5p-mfc/s5p_mfc_opr_v6.h | 137 +++ - drivers/media/video/s5p-mfc/s5p_mfc_pm.c | 6 +- - drivers/media/video/s5p-mfc/s5p_mfc_shm.c | 27 +- - drivers/media/video/s5p-mfc/s5p_mfc_shm.h | 13 +- - include/linux/videodev2.h | 364 +++++- - 22 files changed, 4015 insertions(+), 456 deletions(-) - mode change 100644 => 100755 drivers/media/video/s5p-mfc/Makefile - create mode 100644 drivers/media/video/s5p-mfc/regs-mfc-v6.h - mode change 100644 => 100755 drivers/media/video/s5p-mfc/regs-mfc.h - mode change 100644 => 100755 drivers/media/video/s5p-mfc/s5p_mfc.c - create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_cmd_v6.c - mode change 100644 => 100755 drivers/media/video/s5p-mfc/s5p_mfc_common.h - mode change 100644 => 100755 drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c - mode change 100644 => 100755 drivers/media/video/s5p-mfc/s5p_mfc_dec.c - mode change 100644 => 100755 drivers/media/video/s5p-mfc/s5p_mfc_enc.c - create mode 100755 drivers/media/video/s5p-mfc/s5p_mfc_opr_v6.c - create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_opr_v6.h - mode change 100644 => 100755 drivers/media/video/s5p-mfc/s5p_mfc_pm.c - mode change 100644 => 100755 drivers/media/video/s5p-mfc/s5p_mfc_shm.h - -diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h -index 320ce9c..a58bdd1 100644 ---- a/include/linux/videodev2.h -+++ b/include/linux/videodev2.h -@@ -289,12 +289,12 @@ struct v4l2_capability { - * V I D E O I M A G E F O R M A T - */ - struct v4l2_pix_format { -- __u32 width; -+ __u32 width; - __u32 height; - __u32 pixelformat; -- enum v4l2_field field; -- __u32 bytesperline; /* for padding, zero if unused */ -- __u32 sizeimage; -+ enum v4l2_field field; -+ __u32 bytesperline; /* for padding, zero if unused */ -+ __u32 sizeimage; - enum v4l2_colorspace colorspace; - __u32 priv; /* private data, depends on pixelformat */ - }; -@@ -359,6 +359,7 @@ struct v4l2_pix_format { - - /* two non contiguous planes - one Y, one Cr + Cb interleaved */ - #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ -+#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */ - #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */ - - /* three non contiguous planes - Y, Cb, Cr */ -@@ -392,13 +393,23 @@ struct v4l2_pix_format { - #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */ - #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */ - #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */ -+#define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */ - #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */ - #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */ - #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */ -+#define V4L2_PIX_FMT_MPEG12 v4l2_fourcc('M', 'P', '1', '2') /* MPEG-1/2 */ - #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */ -+#define V4L2_PIX_FMT_FIMV v4l2_fourcc('F', 'I', 'M', 'V') /* FIMV */ -+#define V4L2_PIX_FMT_FIMV1 v4l2_fourcc('F', 'I', 'M', '1') /* FIMV1 */ -+#define V4L2_PIX_FMT_FIMV2 v4l2_fourcc('F', 'I', 'M', '2') /* FIMV2 */ -+#define V4L2_PIX_FMT_FIMV3 v4l2_fourcc('F', 'I', 'M', '3') /* FIMV3 */ -+#define V4L2_PIX_FMT_FIMV4 v4l2_fourcc('F', 'I', 'M', '4') /* FIMV4 */ - #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */ - #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */ - #define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */ -+#define V4L2_PIX_FMT_VC1 v4l2_fourcc('V', 'C', '1', 'A') /* VC-1 */ -+#define V4L2_PIX_FMT_VC1_RCV v4l2_fourcc('V', 'C', '1', 'R') /* VC-1 RCV */ -+#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */ - - /* Vendor-specific formats */ - #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ -@@ -859,7 +870,7 @@ typedef __u64 v4l2_std_id; - V4L2_STD_NTSC_M_JP |\ - V4L2_STD_NTSC_M_KR) - /* Secam macros */ --#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ -+#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ - V4L2_STD_SECAM_K |\ - V4L2_STD_SECAM_K1) - /* All Secam Standards */ -@@ -1162,8 +1173,9 @@ struct v4l2_ext_controls { - #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ - #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ - #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ --#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */ --#define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */ -+#define V4L2_CTRL_CLASS_CODEC 0x009c0000 /* Codec control class */ -+#define V4L2_CTRL_CLASS_FLASH 0x009d0000 /* Camera flash controls */ -+#define V4L2_CTRL_CLASS_JPEG 0x009e0000 /* JPEG-compression controls */ - - #define V4L2_CTRL_ID_MASK (0x0fffffff) - -@@ -1206,11 +1218,11 @@ struct v4l2_querymenu { - /* Control flags */ - #define V4L2_CTRL_FLAG_DISABLED 0x0001 - #define V4L2_CTRL_FLAG_GRABBED 0x0002 --#define V4L2_CTRL_FLAG_READ_ONLY 0x0004 --#define V4L2_CTRL_FLAG_UPDATE 0x0008 --#define V4L2_CTRL_FLAG_INACTIVE 0x0010 --#define V4L2_CTRL_FLAG_SLIDER 0x0020 --#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 -+#define V4L2_CTRL_FLAG_READ_ONLY 0x0004 -+#define V4L2_CTRL_FLAG_UPDATE 0x0008 -+#define V4L2_CTRL_FLAG_INACTIVE 0x0010 -+#define V4L2_CTRL_FLAG_SLIDER 0x0020 -+#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 - #define V4L2_CTRL_FLAG_VOLATILE 0x0080 - - /* Query flag, to be ORed with the control ID */ -@@ -1223,7 +1235,7 @@ struct v4l2_querymenu { - /* IDs reserved for driver specific controls */ - #define V4L2_CID_PRIVATE_BASE 0x08000000 - --#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1) -+#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1) - #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) - #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) - #define V4L2_CID_SATURATION (V4L2_CID_BASE+2) -@@ -1261,21 +1273,21 @@ enum v4l2_power_line_frequency { - #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25) - #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26) - #define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27) --#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28) --#define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29) --#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30) -+#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28) -+#define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29) -+#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30) - #define V4L2_CID_COLORFX (V4L2_CID_BASE+31) - enum v4l2_colorfx { - V4L2_COLORFX_NONE = 0, - V4L2_COLORFX_BW = 1, - V4L2_COLORFX_SEPIA = 2, -- V4L2_COLORFX_NEGATIVE = 3, -- V4L2_COLORFX_EMBOSS = 4, -- V4L2_COLORFX_SKETCH = 5, -- V4L2_COLORFX_SKY_BLUE = 6, -+ V4L2_COLORFX_NEGATIVE = 3, -+ V4L2_COLORFX_EMBOSS = 4, -+ V4L2_COLORFX_SKETCH = 5, -+ V4L2_COLORFX_SKY_BLUE = 6, - V4L2_COLORFX_GRASS_GREEN = 7, - V4L2_COLORFX_SKIN_WHITEN = 8, -- V4L2_COLORFX_VIVID = 9, -+ V4L2_COLORFX_VIVID = 9, - }; - #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) - #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) -@@ -1310,13 +1322,13 @@ enum v4l2_mpeg_stream_type { - V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */ - V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */ - }; --#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1) --#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2) --#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3) --#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) --#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) --#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) --#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7) -+#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1) -+#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2) -+#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3) -+#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) -+#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) -+#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) -+#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7) - enum v4l2_mpeg_stream_vbi_fmt { - V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */ - V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ -@@ -1329,7 +1341,7 @@ enum v4l2_mpeg_audio_sampling_freq { - V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1, - V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2, - }; --#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101) -+#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101) - enum v4l2_mpeg_audio_encoding { - V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0, - V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1, -@@ -1337,7 +1349,7 @@ enum v4l2_mpeg_audio_encoding { - V4L2_MPEG_AUDIO_ENCODING_AAC = 3, - V4L2_MPEG_AUDIO_ENCODING_AC3 = 4, - }; --#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) -+#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) - enum v4l2_mpeg_audio_l1_bitrate { - V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0, - V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1, -@@ -1371,7 +1383,7 @@ enum v4l2_mpeg_audio_l2_bitrate { - V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12, - V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13, - }; --#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104) -+#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104) - enum v4l2_mpeg_audio_l3_bitrate { - V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0, - V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1, -@@ -1388,32 +1400,32 @@ enum v4l2_mpeg_audio_l3_bitrate { - V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12, - V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13, - }; --#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105) -+#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105) - enum v4l2_mpeg_audio_mode { - V4L2_MPEG_AUDIO_MODE_STEREO = 0, - V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1, - V4L2_MPEG_AUDIO_MODE_DUAL = 2, - V4L2_MPEG_AUDIO_MODE_MONO = 3, - }; --#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106) -+#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106) - enum v4l2_mpeg_audio_mode_extension { - V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0, - V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1, - V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2, - V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3, - }; --#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107) -+#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107) - enum v4l2_mpeg_audio_emphasis { - V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0, - V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1, - V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2, - }; --#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108) -+#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108) - enum v4l2_mpeg_audio_crc { - V4L2_MPEG_AUDIO_CRC_NONE = 0, - V4L2_MPEG_AUDIO_CRC_CRC16 = 1, - }; --#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109) -+#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109) - #define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110) - #define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111) - enum v4l2_mpeg_audio_ac3_bitrate { -@@ -1449,33 +1461,33 @@ enum v4l2_mpeg_audio_dec_playback { - #define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113) - - /* MPEG video controls specific to multiplexed streams */ --#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) -+#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) - enum v4l2_mpeg_video_encoding { - V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, - V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, - V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2, - }; --#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) -+#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) - enum v4l2_mpeg_video_aspect { - V4L2_MPEG_VIDEO_ASPECT_1x1 = 0, - V4L2_MPEG_VIDEO_ASPECT_4x3 = 1, - V4L2_MPEG_VIDEO_ASPECT_16x9 = 2, - V4L2_MPEG_VIDEO_ASPECT_221x100 = 3, - }; --#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202) --#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203) --#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204) --#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205) --#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206) -+#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202) -+#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203) -+#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204) -+#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205) -+#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206) - enum v4l2_mpeg_video_bitrate_mode { - V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0, - V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1, - }; --#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) --#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) -+#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) -+#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) - #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) --#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) --#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) -+#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) -+#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) - #define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212) - #define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213) - #define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214) -@@ -1489,16 +1501,20 @@ enum v4l2_mpeg_video_header_mode { - #define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217) - #define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218) - #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219) -+#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BITS (V4L2_CID_MPEG_BASE+219) - #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220) - #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221) - enum v4l2_mpeg_video_multi_slice_mode { - V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0, - V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1, - V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2, -+ V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB = 1, -+ V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BITS = 2, - }; - #define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222) - #define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223) - #define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224) -+#define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225) - - #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300) - #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301) -@@ -1589,6 +1605,46 @@ enum v4l2_mpeg_video_h264_vui_sar_idc { - V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16, - V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17, - }; -+#define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_MPEG_BASE+368) -+#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_MPEG_BASE+369) -+#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_MPEG_BASE+370) -+enum v4l2_mpeg_video_h264_sei_fp_arrangement_type { -+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD = 0, -+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN = 1, -+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW = 2, -+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE = 3, -+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM = 4, -+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL = 5, -+}; -+#define V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_MPEG_BASE+371) -+#define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_MPEG_BASE+372) -+enum v4l2_mpeg_video_h264_fmo_map_type { -+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES = 0, -+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES = 1, -+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER = 2, -+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT = 3, -+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN = 4, -+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN = 5, -+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT = 6, -+}; -+#define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_MPEG_BASE+373) -+#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_MPEG_BASE+374) -+enum v4l2_mpeg_video_h264_fmo_change_dir { -+ V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT = 0, -+ V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT = 1, -+}; -+#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_MPEG_BASE+375) -+#define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_MPEG_BASE+376) -+#define V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_MPEG_BASE+377) -+#define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_MPEG_BASE+378) -+#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_MPEG_BASE+379) -+#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_MPEG_BASE+380) -+enum v4l2_mpeg_video_h264_hierarchical_coding_type { -+ V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B = 0, -+ V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P = 1, -+}; -+#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381) -+#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382) - #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400) - #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401) - #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402) -@@ -1683,6 +1739,220 @@ enum v4l2_mpeg_mfc51_video_force_frame_type { - #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53) - #define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54) - -+#define V4L2_CID_CODEC_BASE (V4L2_CTRL_CLASS_CODEC | 0x900) -+#define V4L2_CID_CODEC_CLASS (V4L2_CTRL_CLASS_CODEC | 1) -+ -+/* Codec class control IDs specific to the MFC5X driver */ -+#define V4L2_CID_CODEC_MFC5X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000) -+ -+/* For both decoding and encoding */ -+ -+/* For decoding */ -+ -+#define V4L2_CID_CODEC_LOOP_FILTER_MPEG4_ENABLE (V4L2_CID_CODEC_BASE + 110) -+#define V4L2_CID_CODEC_DISPLAY_DELAY (V4L2_CID_CODEC_BASE + 137) -+#define V4L2_CID_CODEC_REQ_NUM_BUFS (V4L2_CID_CODEC_BASE + 140) -+#define V4L2_CID_CODEC_SLICE_INTERFACE (V4L2_CID_CODEC_BASE + 141) -+#define V4L2_CID_CODEC_PACKED_PB (V4L2_CID_CODEC_BASE + 142) -+#define V4L2_CID_CODEC_FRAME_TAG (V4L2_CID_CODEC_BASE + 143) -+#define V4L2_CID_CODEC_CRC_ENABLE (V4L2_CID_CODEC_BASE + 144) -+#define V4L2_CID_CODEC_CRC_DATA_LUMA (V4L2_CID_CODEC_BASE + 145) -+#define V4L2_CID_CODEC_CRC_DATA_CHROMA (V4L2_CID_CODEC_BASE + 146) -+#define V4L2_CID_CODEC_CRC_DATA_LUMA_BOT (V4L2_CID_CODEC_BASE + 147) -+#define V4L2_CID_CODEC_CRC_DATA_CHROMA_BOT (V4L2_CID_CODEC_BASE + 148) -+#define V4L2_CID_CODEC_CRC_GENERATED (V4L2_CID_CODEC_BASE + 149) -+#define V4L2_CID_CODEC_FRAME_TYPE (V4L2_CID_CODEC_BASE + 154) -+#define V4L2_CID_CODEC_CHECK_STATE (V4L2_CID_CODEC_BASE + 155) -+#define V4L2_CID_CODEC_DISPLAY_STATUS (V4L2_CID_CODEC_BASE + 156) -+#define V4L2_CID_CODEC_FRAME_PACK_SEI_PARSE (V4L2_CID_CODEC_BASE + 157) -+#define V4L2_CID_CODEC_FRAME_PACK_SEI_AVAIL (V4L2_CID_CODEC_BASE + 158) -+#define V4L2_CID_CODEC_FRAME_PACK_ARRGMENT_ID (V4L2_CID_CODEC_BASE + 159) -+#define V4L2_CID_CODEC_FRAME_PACK_SEI_INFO (V4L2_CID_CODEC_BASE + 160) -+#define V4L2_CID_CODEC_FRAME_PACK_GRID_POS (V4L2_CID_CODEC_BASE + 161) -+ -+/* For encoding */ -+#define V4L2_CID_CODEC_LOOP_FILTER_H264 (V4L2_CID_CODEC_BASE + 9) -+enum v4l2_cid_codec_loop_filter_h264 { -+ V4L2_CID_CODEC_LOOP_FILTER_H264_ENABLE = 0, -+ V4L2_CID_CODEC_LOOP_FILTER_H264_DISABLE = 1, -+ V4L2_CID_CODEC_LOOP_FILTER_H264_DISABLE_AT_BOUNDARY = 2, -+}; -+ -+#define V4L2_CID_CODEC_FRAME_INSERTION (V4L2_CID_CODEC_BASE + 10) -+enum v4l2_cid_codec_frame_insertion { -+ V4L2_CID_CODEC_FRAME_INSERT_NONE = 0x0, -+ V4L2_CID_CODEC_FRAME_INSERT_I_FRAME = 0x1, -+ V4L2_CID_CODEC_FRAME_INSERT_NOT_CODED = 0x2, -+}; -+ -+#define V4L2_CID_CODEC_ENCODED_LUMA_ADDR (V4L2_CID_CODEC_BASE + 11) -+#define V4L2_CID_CODEC_ENCODED_CHROMA_ADDR (V4L2_CID_CODEC_BASE + 12) -+ -+#define V4L2_CID_CODEC_ENCODED_I_PERIOD_CH V4L2_CID_CODEC_MFC5X_ENC_GOP_SIZE -+#define V4L2_CID_CODEC_ENCODED_FRAME_RATE_CH V4L2_CID_CODEC_MFC5X_ENC_H264_RC_FRAME_RATE -+#define V4L2_CID_CODEC_ENCODED_BIT_RATE_CH V4L2_CID_CODEC_MFC5X_ENC_RC_BIT_RATE -+ -+#define V4L2_CID_CODEC_FRAME_PACK_SEI_GEN (V4L2_CID_CODEC_BASE + 13) -+#define V4L2_CID_CODEC_FRAME_PACK_FRM0_FLAG (V4L2_CID_CODEC_BASE + 14) -+enum v4l2_codec_mfc5x_enc_flag { -+ V4L2_CODEC_MFC5X_ENC_FLAG_DISABLE = 0, -+ V4L2_CODEC_MFC5X_ENC_FLAG_ENABLE = 1, -+}; -+#define V4L2_CID_CODEC_FRAME_PACK_ARRGMENT_TYPE (V4L2_CID_CODEC_BASE + 15) -+enum v4l2_codec_mfc5x_enc_frame_pack_arrgment_type { -+ V4L2_CODEC_MFC5X_ENC_FRAME_PACK_SIDE_BY_SIDE = 0, -+ V4L2_CODEC_MFC5X_ENC_FRAME_PACK_TOP_AND_BOT = 1, -+ V4L2_CODEC_MFC5X_ENC_FRAME_PACK_TMP_INTER = 2, -+}; -+ -+/* common */ -+enum v4l2_codec_mfc5x_enc_switch { -+ V4L2_CODEC_MFC5X_ENC_SW_DISABLE = 0, -+ V4L2_CODEC_MFC5X_ENC_SW_ENABLE = 1, -+}; -+enum v4l2_codec_mfc5x_enc_switch_inv { -+ V4L2_CODEC_MFC5X_ENC_SW_INV_ENABLE = 0, -+ V4L2_CODEC_MFC5X_ENC_SW_INV_DISABLE = 1, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_GOP_SIZE (V4L2_CID_CODEC_MFC5X_BASE+300) -+#define V4L2_CID_CODEC_MFC5X_ENC_MULTI_SLICE_MODE (V4L2_CID_CODEC_MFC5X_BASE+301) -+enum v4l2_codec_mfc5x_enc_multi_slice_mode { -+ V4L2_CODEC_MFC5X_ENC_MULTI_SLICE_MODE_DISABLE = 0, -+ V4L2_CODEC_MFC5X_ENC_MULTI_SLICE_MODE_MACROBLOCK_COUNT = 1, -+ V4L2_CODEC_MFC5X_ENC_MULTI_SLICE_MODE_BIT_COUNT = 3, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_MULTI_SLICE_MB (V4L2_CID_CODEC_MFC5X_BASE+302) -+#define V4L2_CID_CODEC_MFC5X_ENC_MULTI_SLICE_BIT (V4L2_CID_CODEC_MFC5X_BASE+303) -+#define V4L2_CID_CODEC_MFC5X_ENC_INTRA_REFRESH_MB (V4L2_CID_CODEC_MFC5X_BASE+304) -+#define V4L2_CID_CODEC_MFC5X_ENC_PAD_CTRL_ENABLE (V4L2_CID_CODEC_MFC5X_BASE+305) -+#define V4L2_CID_CODEC_MFC5X_ENC_PAD_LUMA_VALUE (V4L2_CID_CODEC_MFC5X_BASE+306) -+#define V4L2_CID_CODEC_MFC5X_ENC_PAD_CB_VALUE (V4L2_CID_CODEC_MFC5X_BASE+307) -+#define V4L2_CID_CODEC_MFC5X_ENC_PAD_CR_VALUE (V4L2_CID_CODEC_MFC5X_BASE+308) -+#define V4L2_CID_CODEC_MFC5X_ENC_RC_FRAME_ENABLE (V4L2_CID_CODEC_MFC5X_BASE+309) -+#define V4L2_CID_CODEC_MFC5X_ENC_RC_BIT_RATE (V4L2_CID_CODEC_MFC5X_BASE+310) -+#define V4L2_CID_CODEC_MFC5X_ENC_RC_REACTION_COEFF (V4L2_CID_CODEC_MFC5X_BASE+311) -+#define V4L2_CID_CODEC_MFC5X_ENC_STREAM_SIZE (V4L2_CID_CODEC_MFC5X_BASE+312) -+#define V4L2_CID_CODEC_MFC5X_ENC_FRAME_COUNT (V4L2_CID_CODEC_MFC5X_BASE+313) -+#define V4L2_CID_CODEC_MFC5X_ENC_FRAME_TYPE (V4L2_CID_CODEC_MFC5X_BASE+314) -+enum v4l2_codec_mfc5x_enc_frame_type { -+ V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_NOT_CODED = 0, -+ V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_I_FRAME = 1, -+ V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_P_FRAME = 2, -+ V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_B_FRAME = 3, -+ V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_SKIPPED = 4, -+ V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_OTHERS = 5, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_FORCE_FRAME_TYPE (V4L2_CID_CODEC_MFC5X_BASE+315) -+enum v4l2_codec_mfc5x_enc_force_frame_type { -+ V4L2_CODEC_MFC5X_ENC_FORCE_FRAME_TYPE_I_FRAME = 1, -+ V4L2_CODEC_MFC5X_ENC_FORCE_FRAME_TYPE_NOT_CODED = 2, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_VBV_BUF_SIZE (V4L2_CID_CODEC_MFC5X_BASE+316) -+#define V4L2_CID_CODEC_MFC5X_ENC_SEQ_HDR_MODE (V4L2_CID_CODEC_MFC5X_BASE+317) -+enum v4l2_codec_mfc5x_enc_seq_hdr_mode { -+ V4L2_CODEC_MFC5X_ENC_SEQ_HDR_MODE_SEQ = 0, -+ V4L2_CODEC_MFC5X_ENC_SEQ_HDR_MODE_SEQ_FRAME = 1, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_FRAME_SKIP_MODE (V4L2_CID_CODEC_MFC5X_BASE+318) -+enum v4l2_codec_mfc5x_enc_frame_skip_mode { -+ V4L2_CODEC_MFC5X_ENC_FRAME_SKIP_MODE_DISABLE = 0, -+ V4L2_CODEC_MFC5X_ENC_FRAME_SKIP_MODE_LEVEL = 1, -+ V4L2_CODEC_MFC5X_ENC_FRAME_SKIP_MODE_VBV_BUF_SIZE = 2, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_RC_FIXED_TARGET_BIT (V4L2_CID_CODEC_MFC5X_BASE+319) -+#define V4L2_CID_CODEC_MFC5X_ENC_FRAME_DELTA (V4L2_CID_CODEC_MFC5X_BASE+320) -+ -+/* codec specific */ -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_B_FRAMES (V4L2_CID_CODEC_MFC5X_BASE+400) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_PROFILE (V4L2_CID_CODEC_MFC5X_BASE+401) -+enum v4l2_codec_mfc5x_enc_h264_profile { -+ V4L2_CODEC_MFC5X_ENC_H264_PROFILE_MAIN = 0, -+ V4L2_CODEC_MFC5X_ENC_H264_PROFILE_HIGH = 1, -+ V4L2_CODEC_MFC5X_ENC_H264_PROFILE_BASELINE = 2, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LEVEL (V4L2_CID_CODEC_MFC5X_BASE+402) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_INTERLACE (V4L2_CID_CODEC_MFC5X_BASE+403) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LOOP_FILTER_MODE (V4L2_CID_CODEC_MFC5X_BASE+404) -+enum v4l2_codec_mfc5x_enc_h264_loop_filter { -+ V4L2_CODEC_MFC5X_ENC_H264_LOOP_FILTER_ENABLE = 0, -+ V4L2_CODEC_MFC5X_ENC_H264_LOOP_FILTER_DISABLE = 1, -+ V4L2_CODEC_MFC5X_ENC_H264_LOOP_FILTER_DISABLE_AT_BOUNDARY = 2, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LOOP_FILTER_ALPHA (V4L2_CID_CODEC_MFC5X_BASE+405) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LOOP_FILTER_BETA (V4L2_CID_CODEC_MFC5X_BASE+406) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ENTROPY_MODE (V4L2_CID_CODEC_MFC5X_BASE+407) -+enum v4l2_codec_mfc5x_enc_h264_entropy_mode { -+ V4L2_CODEC_MFC5X_ENC_H264_ENTROPY_MODE_CAVLC = 0, -+ V4L2_CODEC_MFC5X_ENC_H264_ENTROPY_MODE_CABAC = 1, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_MAX_REF_PIC (V4L2_CID_CODEC_MFC5X_BASE+408) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_NUM_REF_PIC_4P (V4L2_CID_CODEC_MFC5X_BASE+409) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_8X8_TRANSFORM (V4L2_CID_CODEC_MFC5X_BASE+410) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_ENABLE (V4L2_CID_CODEC_MFC5X_BASE+411) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_FRAME_RATE (V4L2_CID_CODEC_MFC5X_BASE+412) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_FRAME_QP (V4L2_CID_CODEC_MFC5X_BASE+413) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MIN_QP (V4L2_CID_CODEC_MFC5X_BASE+414) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MAX_QP (V4L2_CID_CODEC_MFC5X_BASE+415) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_DARK (V4L2_CID_CODEC_MFC5X_BASE+416) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_SMOOTH (V4L2_CID_CODEC_MFC5X_BASE+417) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_STATIC (V4L2_CID_CODEC_MFC5X_BASE+418) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_ACTIVITY (V4L2_CID_CODEC_MFC5X_BASE+419) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_P_FRAME_QP (V4L2_CID_CODEC_MFC5X_BASE+420) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_B_FRAME_QP (V4L2_CID_CODEC_MFC5X_BASE+421) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_AR_VUI_ENABLE (V4L2_CID_CODEC_MFC5X_BASE+422) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_AR_VUI_IDC (V4L2_CID_CODEC_MFC5X_BASE+423) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_EXT_SAR_WIDTH (V4L2_CID_CODEC_MFC5X_BASE+424) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_EXT_SAR_HEIGHT (V4L2_CID_CODEC_MFC5X_BASE+425) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_OPEN_GOP (V4L2_CID_CODEC_MFC5X_BASE+426) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_I_PERIOD (V4L2_CID_CODEC_MFC5X_BASE+427) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_HIER_P_ENABLE (V4L2_CID_CODEC_MFC5X_BASE+428) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LAYER0_QP (V4L2_CID_CODEC_MFC5X_BASE+429) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LAYER1_QP (V4L2_CID_CODEC_MFC5X_BASE+430) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LAYER2_QP (V4L2_CID_CODEC_MFC5X_BASE+431) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_FMO_ENABLE (V4L2_CID_CODEC_MFC5X_BASE+432) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ASO_ENABLE (V4L2_CID_CODEC_MFC5X_BASE+433) -+ -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_B_FRAMES (V4L2_CID_CODEC_MFC5X_BASE+440) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_PROFILE (V4L2_CID_CODEC_MFC5X_BASE+441) -+enum v4l2_codec_mfc5x_enc_mpeg4_profile { -+ V4L2_CODEC_MFC5X_ENC_MPEG4_PROFILE_SIMPLE = 0, -+ V4L2_CODEC_MFC5X_ENC_MPEG4_PROFILE_ADVANCED_SIMPLE = 1, -+}; -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_LEVEL (V4L2_CID_CODEC_MFC5X_BASE+442) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_FRAME_QP (V4L2_CID_CODEC_MFC5X_BASE+443) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_MIN_QP (V4L2_CID_CODEC_MFC5X_BASE+444) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_MAX_QP (V4L2_CID_CODEC_MFC5X_BASE+445) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_QUARTER_PIXEL (V4L2_CID_CODEC_MFC5X_BASE+446) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_P_FRAME_QP (V4L2_CID_CODEC_MFC5X_BASE+447) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_B_FRAME_QP (V4L2_CID_CODEC_MFC5X_BASE+448) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_VOP_TIME_RES (V4L2_CID_CODEC_MFC5X_BASE+449) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_VOP_FRM_DELTA (V4L2_CID_CODEC_MFC5X_BASE+450) -+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_MB_ENABLE (V4L2_CID_CODEC_MFC5X_BASE+451) -+ -+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_FRAME_RATE (V4L2_CID_CODEC_MFC5X_BASE+460) -+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_FRAME_QP (V4L2_CID_CODEC_MFC5X_BASE+461) -+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_MIN_QP (V4L2_CID_CODEC_MFC5X_BASE+462) -+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_MAX_QP (V4L2_CID_CODEC_MFC5X_BASE+463) -+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_P_FRAME_QP (V4L2_CID_CODEC_MFC5X_BASE+464) -+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_MB_ENABLE (V4L2_CID_CODEC_MFC5X_BASE+465) -+ -+/* FMO/ASO parameters */ -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_FMO_MAP_TYPE (V4L2_CID_CODEC_MFC5X_BASE+480) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_FMO_SLICE_NUM (V4L2_CID_CODEC_MFC5X_BASE+481) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_FMO_RUN_LEN1 (V4L2_CID_CODEC_MFC5X_BASE+482) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_FMO_RUN_LEN2 (V4L2_CID_CODEC_MFC5X_BASE+483) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_FMO_RUN_LEN3 (V4L2_CID_CODEC_MFC5X_BASE+484) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_FMO_RUN_LEN4 (V4L2_CID_CODEC_MFC5X_BASE+485) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_FMO_SG_DIR (V4L2_CID_CODEC_MFC5X_BASE+486) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_FMO_SG_RATE (V4L2_CID_CODEC_MFC5X_BASE+487) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ASO_SL_ORDER_0 (V4L2_CID_CODEC_MFC5X_BASE+488) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ASO_SL_ORDER_1 (V4L2_CID_CODEC_MFC5X_BASE+489) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ASO_SL_ORDER_2 (V4L2_CID_CODEC_MFC5X_BASE+490) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ASO_SL_ORDER_3 (V4L2_CID_CODEC_MFC5X_BASE+491) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ASO_SL_ORDER_4 (V4L2_CID_CODEC_MFC5X_BASE+492) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ASO_SL_ORDER_5 (V4L2_CID_CODEC_MFC5X_BASE+493) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ASO_SL_ORDER_6 (V4L2_CID_CODEC_MFC5X_BASE+494) -+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ASO_SL_ORDER_7 (V4L2_CID_CODEC_MFC5X_BASE+495) - /* Camera class control IDs */ - #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900) - #define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1) --- -1.7.8.6 - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-Media-Exynos-Header-file-support-for-G-Scaler-driver.patch b/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-Media-Exynos-Header-file-support-for-G-Scaler-driver.patch deleted file mode 100644 index ce2249670e..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-Media-Exynos-Header-file-support-for-G-Scaler-driver.patch +++ /dev/null @@ -1,38 +0,0 @@ -sheu@chromium.org: trimmed from 3.4 kernel patch - -From a282f22565b9e0d1aefdbe1b2956d11c21b81810 Mon Sep 17 00:00:00 2001 -From: Subash Patel -Date: Tue, 22 May 2012 20:18:30 +0100 -Subject: [PATCH] Media: Exynos: Header file support for G-Scaler driver - -This commit adds the header files required to define the controls -of the new G-Scaler driver. - -Change-Id: Iea9d01e18870501758326750c3b0051df9ec139f -Signed-off-by: Subash Patel -Signed-off-by: Kiran AVND ---- - arch/arm/mach-exynos/include/mach/videonode.h | 32 +++++++++++++++++++++++++ - include/linux/videodev2.h | 2 + - 2 files changed, 34 insertions(+), 0 deletions(-) - create mode 100644 arch/arm/mach-exynos/include/mach/videonode.h - -diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h -index 9bbd3b3..17715dd 100644 ---- a/include/linux/videodev2.h -+++ b/include/linux/videodev2.h -@@ -361,9 +361,11 @@ struct v4l2_pix_format { - #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ - #define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */ - #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */ -+#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */ - - /* three non contiguous planes - Y, Cb, Cr */ - #define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */ -+#define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'V', 'U', 'M') /* 12 YVU420 planar */ - - /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ - #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ --- -1.7.8.6 - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-add-buffer-exporting-via-dmabuf.patch b/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-add-buffer-exporting-via-dmabuf.patch deleted file mode 100644 index bb9ef14d0a..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/files/3.4-v4l-add-buffer-exporting-via-dmabuf.patch +++ /dev/null @@ -1,68 +0,0 @@ -sheu@chromium.org: trimmed from 3.4 kernel patch - -From ddbbf176f4e8cafcb4bd5cf215b82d30c721ed83 Mon Sep 17 00:00:00 2001 -From: Tomasz Stanislawski -Date: Thu, 14 Jun 2012 16:32:23 +0200 -Subject: [PATCH] v4l: add buffer exporting via dmabuf - -This patch adds extension to V4L2 api. It allow to export a mmap buffer as file -descriptor. New ioctl VIDIOC_EXPBUF is added. It takes a buffer offset used by -mmap and return a file descriptor on success. - -Signed-off-by: Tomasz Stanislawski -Signed-off-by: Kyungmin Park ---- - drivers/media/video/v4l2-compat-ioctl32.c | 1 + - drivers/media/video/v4l2-dev.c | 1 + - drivers/media/video/v4l2-ioctl.c | 6 ++++++ - include/linux/videodev2.h | 26 ++++++++++++++++++++++++++ - include/media/v4l2-ioctl.h | 2 ++ - 5 files changed, 36 insertions(+), 0 deletions(-) - -diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h -index d884d4a..52f2aa0 100644 ---- a/include/linux/videodev2.h -+++ b/include/linux/videodev2.h -@@ -679,6 +679,31 @@ struct v4l2_buffer { - #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 - #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 - -+/** -+ * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor -+ * -+ * @fd: file descriptor associated with DMABUF (set by driver) -+ * @mem_offset: buffer memory offset as returned by VIDIOC_QUERYBUF in struct -+ * v4l2_buffer::m.offset (for single-plane formats) or -+ * v4l2_plane::m.offset (for multi-planar formats) -+ * @flags: flags for newly created file, currently only O_CLOEXEC is -+ * supported, refer to manual of open syscall for more details -+ * -+ * Contains data used for exporting a video buffer as DMABUF file descriptor. -+ * The buffer is identified by a 'cookie' returned by VIDIOC_QUERYBUF -+ * (identical to the cookie used to mmap() the buffer to userspace). All -+ * reserved fields must be set to zero. The field reserved0 is expected to -+ * become a structure 'type' allowing an alternative layout of the structure -+ * content. Therefore this field should not be used for any other extensions. -+ */ -+struct v4l2_exportbuffer { -+ __u32 fd; -+ __u32 reserved0; -+ __u32 mem_offset; -+ __u32 flags; -+ __u32 reserved[12]; -+}; -+ - /* - * O V E R L A Y P R E V I E W - */ -@@ -2326,6 +2351,7 @@ struct v4l2_create_buffers { - #define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer) - #define VIDIOC_OVERLAY _IOW('V', 14, int) - #define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer) -+#define VIDIOC_EXPBUF _IOWR('V', 16, struct v4l2_exportbuffer) - #define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer) - #define VIDIOC_STREAMON _IOW('V', 18, int) - #define VIDIOC_STREAMOFF _IOW('V', 19, int) --- -1.7.8.6 - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/linux-headers-3.4-r3.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/linux-headers-3.4-r3.ebuild deleted file mode 120000 index ab19e5e047..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/linux-headers-3.4-r3.ebuild +++ /dev/null @@ -1 +0,0 @@ -linux-headers-3.4.ebuild \ No newline at end of file diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/linux-headers-3.4.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/linux-headers-3.4.ebuild deleted file mode 100644 index 9164559f7e..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/linux-headers/linux-headers-3.4.ebuild +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/linux-headers/linux-headers-3.4.ebuild,v 1.1 2012/05/22 03:21:59 vapier Exp $ - -EAPI="3" - -ETYPE="headers" -H_SUPPORTEDARCH="alpha amd64 arm bfin cris hppa m68k mips ia64 ppc ppc64 s390 sh sparc x86" -inherit kernel-2 -detect_version - -PATCH_VER="1" -SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz - ${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}" - -KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-linux ~x86-linux" - -DEPEND="app-arch/xz-utils - dev-lang/perl" -RDEPEND="" - -S=${WORKDIR}/gentoo-headers-base-${PV} - -src_unpack() { - unpack ${A} -} - -src_prepare() { - [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV} - epatch ${FILESDIR}/3.4-v4l-Add-DMABUF-as-a-memory-type.patch - epatch ${FILESDIR}/3.4-v4l-Media-Exynos-Header-file-support-for-G-Scaler-driver.patch - epatch ${FILESDIR}/3.4-v4l-MFC-update-MFC-v4l2-driver-to-support-MFC6.x.patch - epatch ${FILESDIR}/3.4-v4l-CHROMIUM-v4l2-exynos-move-CID-enums-into-videodev2.h.patch - epatch ${FILESDIR}/3.4-v4l-add-buffer-exporting-via-dmabuf.patch -} - -src_install() { - kernel-2_src_install - cd "${D}" - egrep -r \ - -e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \ - -e '\<([us](8|16|32|64))\>' \ - . - headers___fix $(find -type f) - - egrep -l -r -e '__[us](8|16|32|64)' "${D}" | xargs grep -L linux/types.h - - # hrm, build system sucks - find "${D}" '(' -name '.install' -o -name '*.cmd' ')' -print0 | xargs -0 rm -f - - # provided by libdrm (for now?) - rm -rf "${D}"/$(kernel_header_destdir)/drm -} - -src_test() { - emake ARCH=$(tc-arch-kernel) headers_check || die -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/Manifest b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/Manifest deleted file mode 100644 index 38057eee02..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/Manifest +++ /dev/null @@ -1,6 +0,0 @@ -DIST glibc-2.15-patches-22.tar.bz2 118537 SHA256 7a16c17f98b3efc8ceee8330dc54bbfd9efc7196404de25779aa944f0aa411c7 SHA512 1d594fab08e57f09dc2ca4e5fd5cf48a161b719f263d7da4b02697bd4a1cfac1b22e976f6c8517fc185c8ebf0474c6d0881380fa53a62192e97bb23c789a22a9 WHIRLPOOL 910f257be93577fcfb050ab979322b4767a5a52fb9969393c821cf67338910d7a0e2e8010f91809a1a4cd5a01b84808c8632098ec4bb17a83dcdb26a217f54a2 -DIST glibc-2.15.tar.xz 10280176 SHA256 321ec482abdc27b03244f7b345ee22dc431bc55daf9c000a4e7b040fbdbecb50 SHA512 fc8bc407cd9edfd79bd286d28c84e0b8224e1f57c1d318e73da098a9693257d78970178fd59f487f0321a079fcb772e8e78473fab52f091b2addb0a48fe8dcf7 WHIRLPOOL 061fc0c9915bd821dc31c2fea8e4f9a75b6c7ec0c935ea713d8c087408a8bf3c600179273438f3d9748fe40b946866b2f160e6da6fee4da51e549a30d0f0ebbc -DIST glibc-2.16.0-patches-8.tar.bz2 88635 SHA256 3dc60b033be747320e06d2cbe938beccfe5a781636d2285642066e42757475fa SHA512 c0d772492bd491633a6c84735f8efb4d0f3a3cc54a3eebe38cc7c75179fc69f9355ebe2b12746ece4db688980388a8df26c4bf9f814e4a598a1c5de1ce31670d WHIRLPOOL 3dae9f63fece0046becdf7044b6a2b39857363eb96fc31d6d239b664b0f03ea2d4903dabd6a2b6f671e9ff98fb65be67ddea29c8e69e56f4eea6dc3694433f86 -DIST glibc-2.16.0.tar.xz 9990512 SHA256 1edc36aa2a6cb7127971fce8e02eecffe9c7956297ad3ef10dd4c09f486d5924 SHA512 be9acc11b77ab3c01d5766fe626a6a51bc3192ac98f9554fbb5c37120cfc6f636c0b7a80beddc180f13b32ad06051d24c1999fa2e64eeb724d55a9498f0f634e WHIRLPOOL 9bfd4358a4488080e12e08deca5fca59c1555853d1c1978b7d1bb3b480eb8fb125dccab38c55644248ae5e18b0167aec85f8a7850bab9e11f980aae6f171eac3 -DIST glibc-ports-2.15.tar.xz 421820 SHA256 fcc271fcc3a808bf0f3aa1d144bc39b8d0d5f730aed6e206b883961515f0d1b9 SHA512 fc3c80a9a7ede0f35054e5be043fff4b967e6ef6678f42e617dd1dd498920edb4e4c785cf8e3cd97fc2914a35a892e0fd7e1aab24f0c3c8d207765a131bf3744 WHIRLPOOL a8a617eacb326615265832f86a7ef39678364b5b65d5c16d58680ec0debfbca6780018b7da9c1a86bdfffcde58aa1258b96ea4bd50b114901b522e62d48ae4a5 -DIST glibc-ports-2.16.0.tar.xz 925916 SHA256 93a10ac3b9ab70ccc59dfe50a4747d48a7e92f9481656f8a37558a2767ac02f3 SHA512 8653ad9f5cf239a55eb2e236f9510ba227e910168efefd74df8e4951f2e1e4bca69598bc23daa6581e0ba94fe334ac625524fb22f0d38c2a07e373eda1db821b WHIRLPOOL 60b0cb559e28bcab9c6625ccd24a13ecfc301cc055d7e18d1324627912b528ca8cc7c2f999e1e979d2685e407879b1bfffdb61f1536d91fa143cffb7ded72a8a diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c deleted file mode 100644 index 37711e8aac..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c +++ /dev/null @@ -1,315 +0,0 @@ -/* Copyright (C) 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Copyright (C) 2006-2008 Gentoo Foundation Inc. - * License terms as above. - * - * Hardened Gentoo SSP and FORTIFY handler - * - * An SSP failure handler that does not use functions from the rest of - * glibc; it uses the INTERNAL_SYSCALL methods directly. This ensures - * no possibility of recursion into the handler. - * - * Direct all bug reports to http://bugs.gentoo.org/ - * - * Re-written from the glibc-2.3 Hardened Gentoo SSP handler - * by Kevin F. Quinn - - * - * The following people contributed to the glibc-2.3 Hardened - * Gentoo SSP and FORTIFY handler, from which this implementation draws much: - * - * Ned Ludd - - * Alexander Gabert - - * The PaX Team - - * Peter S. Mazinger - - * Yoann Vandoorselaere - - * Robert Connolly - - * Cory Visi - * Mike Frysinger - * Magnus Granberg - */ - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include - -#include -/* from sysdeps */ -#include -/* for the stuff in bits/socket.h */ -#include -#include - -/* Sanity check on SYSCALL macro names - force compilation - * failure if the names used here do not exist - */ -#if !defined __NR_socketcall && !defined __NR_socket -# error Cannot do syscall socket or socketcall -#endif -#if !defined __NR_socketcall && !defined __NR_connect -# error Cannot do syscall connect or socketcall -#endif -#ifndef __NR_write -# error Cannot do syscall write -#endif -#ifndef __NR_close -# error Cannot do syscall close -#endif -#ifndef __NR_getpid -# error Cannot do syscall getpid -#endif -#ifndef __NR_kill -# error Cannot do syscall kill -#endif -#ifndef __NR_exit -# error Cannot do syscall exit -#endif -#ifdef SSP_SMASH_DUMPS_CORE -# define ENABLE_SSP_SMASH_DUMPS_CORE 1 -# if !defined _KERNEL_NSIG && !defined _NSIG -# error No _NSIG or _KERNEL_NSIG for rt_sigaction -# endif -# if !defined __NR_sigaction && !defined __NR_rt_sigaction -# error Cannot do syscall sigaction or rt_sigaction -# endif -/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size - * of the _kernel_ sigset_t which is not the same as the user sigset_t. - * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for - * some reason. - */ -# ifdef _KERNEL_NSIG -# define _SSP_NSIG _KERNEL_NSIG -# else -# define _SSP_NSIG _NSIG -# endif -#else -# define _SSP_NSIG 0 -# define ENABLE_SSP_SMASH_DUMPS_CORE 0 -#endif - -/* Define DO_SIGACTION - default to newer rt signal interface but - * fallback to old as needed. - */ -#ifdef __NR_rt_sigaction -# define DO_SIGACTION(signum, act, oldact) \ - INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8) -#else -# define DO_SIGACTION(signum, act, oldact) \ - INLINE_SYSCALL(sigaction, 3, signum, act, oldact) -#endif - -/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */ -#if defined(__NR_socket) && defined(__NR_connect) -# define USE_OLD_SOCKETCALL 0 -#else -# define USE_OLD_SOCKETCALL 1 -#endif - -/* stub out the __NR_'s so we can let gcc optimize away dead code */ -#ifndef __NR_socketcall -# define __NR_socketcall 0 -#endif -#ifndef __NR_socket -# define __NR_socket 0 -#endif -#ifndef __NR_connect -# define __NR_connect 0 -#endif -#define DO_SOCKET(result, domain, type, protocol) \ - do { \ - if (USE_OLD_SOCKETCALL) { \ - socketargs[0] = domain; \ - socketargs[1] = type; \ - socketargs[2] = protocol; \ - socketargs[3] = 0; \ - result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \ - } else \ - result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \ - } while (0) -#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \ - do { \ - if (USE_OLD_SOCKETCALL) { \ - socketargs[0] = sockfd; \ - socketargs[1] = (unsigned long int)serv_addr; \ - socketargs[2] = addrlen; \ - socketargs[3] = 0; \ - result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \ - } else \ - result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \ - } while (0) - -#ifndef _PATH_LOG -# define _PATH_LOG "/dev/log" -#endif - -static const char path_log[] = _PATH_LOG; - -/* For building glibc with SSP switched on, define __progname to a - * constant if building for the run-time loader, to avoid pulling - * in more of libc.so into ld.so - */ -#ifdef IS_IN_rtld -static char *__progname = ""; -#else -extern char *__progname; -#endif - -/* Common handler code, used by chk_fail - * Inlined to ensure no self-references to the handler within itself. - * Data static to avoid putting more than necessary on the stack, - * to aid core debugging. - */ -__attribute__ ((__noreturn__ , __always_inline__)) -static inline void -__hardened_gentoo_chk_fail(char func[], int damaged) -{ -#define MESSAGE_BUFSIZ 256 - static pid_t pid; - static int plen, i; - static char message[MESSAGE_BUFSIZ]; - static const char msg_ssa[] = ": buffer overflow attack"; - static const char msg_inf[] = " in function "; - static const char msg_ssd[] = "*** buffer overflow detected ***: "; - static const char msg_terminated[] = " - terminated\n"; - static const char msg_report[] = "Report to http://bugs.gentoo.org/\n"; - static const char msg_unknown[] = ""; - static int log_socket, connect_result; - static struct sockaddr_un sock; - static unsigned long int socketargs[4]; - - /* Build socket address - */ - sock.sun_family = AF_UNIX; - i = 0; - while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1))) { - sock.sun_path[i] = path_log[i]; - i++; - } - sock.sun_path[i] = '\0'; - - /* Try SOCK_DGRAM connection to syslog */ - connect_result = -1; - DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0); - if (log_socket != -1) - DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock)); - if (connect_result == -1) { - if (log_socket != -1) - INLINE_SYSCALL(close, 1, log_socket); - /* Try SOCK_STREAM connection to syslog */ - DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0); - if (log_socket != -1) - DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock)); - } - - /* Build message. Messages are generated both in the old style and new style, - * so that log watchers that are configured for the old-style message continue - * to work. - */ -#define strconcat(str) \ - {i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \ - {\ - message[plen+i]=str[i];\ - i++;\ - }\ - plen+=i;} - - /* R.Henderson post-gcc-4 style message */ - plen = 0; - strconcat(msg_ssd); - if (__progname != (char *)0) - strconcat(__progname) - else - strconcat(msg_unknown); - strconcat(msg_terminated); - - /* Write out error message to STDERR, to syslog if open */ - INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen); - if (connect_result != -1) - INLINE_SYSCALL(write, 3, log_socket, message, plen); - - /* Dr. Etoh pre-gcc-4 style message */ - plen = 0; - if (__progname != (char *)0) - strconcat(__progname) - else - strconcat(msg_unknown); - strconcat(msg_ssa); - strconcat(msg_inf); - if (func != NULL) - strconcat(func) - else - strconcat(msg_unknown); - strconcat(msg_terminated); - /* Write out error message to STDERR, to syslog if open */ - INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen); - if (connect_result != -1) - INLINE_SYSCALL(write, 3, log_socket, message, plen); - - /* Direct reports to bugs.gentoo.org */ - plen=0; - strconcat(msg_report); - message[plen++]='\0'; - - /* Write out error message to STDERR, to syslog if open */ - INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen); - if (connect_result != -1) - INLINE_SYSCALL(write, 3, log_socket, message, plen); - - if (log_socket != -1) - INLINE_SYSCALL(close, 1, log_socket); - - /* Suicide */ - pid = INLINE_SYSCALL(getpid, 0); - - if (ENABLE_SSP_SMASH_DUMPS_CORE) { - static struct sigaction default_abort_act; - /* Remove any user-supplied handler for SIGABRT, before using it */ - default_abort_act.sa_handler = SIG_DFL; - default_abort_act.sa_sigaction = NULL; - __sigfillset(&default_abort_act.sa_mask); - default_abort_act.sa_flags = 0; - if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0) - INLINE_SYSCALL(kill, 2, pid, SIGABRT); - } - - /* Note; actions cannot be added to SIGKILL */ - INLINE_SYSCALL(kill, 2, pid, SIGKILL); - - /* In case the kill didn't work, exit anyway - * The loop prevents gcc thinking this routine returns - */ - while (1) - INLINE_SYSCALL(exit, 0); -} - -__attribute__ ((__noreturn__)) -void __chk_fail(void) -{ - __hardened_gentoo_chk_fail(NULL, 0); -} - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch deleted file mode 100644 index e75ccc788c..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch +++ /dev/null @@ -1,30 +0,0 @@ -Prevent default-fPIE from confusing configure into thinking -PIC code is default. This causes glibc to build both PIC and -non-PIC code as normal, which on the hardened compiler generates -PIC and PIE. - -Patch by Kevin F. Quinn -Fixed for glibc 2.10 by Magnus Granberg - ---- configure.in -+++ configure.in -@@ -2145,7 +2145,7 @@ - # error PIC is default. - #endif - EOF --if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then -+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then - libc_cv_pic_default=no - fi - rm -f conftest.*]) ---- configure -+++ configure -@@ -7698,7 +7698,7 @@ - # error PIC is default. - #endif - EOF --if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then -+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&5 1>&5"; then - libc_cv_pic_default=no - fi - rm -f conftest.* diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch deleted file mode 100644 index cb6d8e3c78..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch +++ /dev/null @@ -1,274 +0,0 @@ -When building glibc PIE (which is not something upstream support), -several modifications are necessary to the glibc build process. - -First, any syscalls in PIEs must be of the PIC variant, otherwise -textrels ensue. Then, any syscalls made before the initialisation -of the TLS will fail on i386, as the sysenter variant on i386 uses -the TLS, giving rise to a chicken-and-egg situation. This patch -defines a PIC syscall variant that doesn't use sysenter, even when the sysenter -version is normally used, and uses the non-sysenter version for the brk -syscall that is performed by the TLS initialisation. Further, the TLS -initialisation is moved in this case prior to the initialisation of -dl_osversion, as that requires further syscalls. - -csu/libc-start.c: Move initial TLS initialization to before the -initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined - -csu/libc-tls.c: Use the no-sysenter version of sbrk when -INTERNAL_SYSCALL_NOSYSENTER is defined. - -misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter -version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined. - -misc/brk.c: Define a no-sysenter version of brk if -INTERNAL_SYSCALL_NOSYSENTER is defined. - -sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER -Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED. - -Patch by Kevin F. Quinn -Fixed for 2.10 by Magnus Granberg - ---- csu/libc-start.c -+++ csu/libc-start.c -@@ -28,6 +28,7 @@ - extern int __libc_multiple_libcs; - - #include -+#include - #ifndef SHARED - # include - extern void __pthread_initialize_minimal (void); -@@ -129,6 +130,11 @@ - # endif - _dl_aux_init (auxvec); - # endif -+# ifdef INTERNAL_SYSCALL_NOSYSENTER -+ /* Do the initial TLS initialization before _dl_osversion, -+ since the latter uses the uname syscall. */ -+ __pthread_initialize_minimal (); -+# endif - # ifdef DL_SYSDEP_OSCHECK - if (!__libc_multiple_libcs) - { -@@ -138,10 +144,12 @@ - } - # endif - -+# ifndef INTERNAL_SYSCALL_NOSYSENTER - /* Initialize the thread library at least a bit since the libgcc - functions are using thread functions if these are available and - we need to setup errno. */ - __pthread_initialize_minimal (); -+# endif - - /* Set up the stack checker's canary. */ - uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (); ---- csu/libc-tls.c -+++ csu/libc-tls.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - - #ifdef SHARED -@@ -29,6 +30,9 @@ - #error makefile bug, this file is for static only - #endif - -+#ifdef INTERNAL_SYSCALL_NOSYSENTER -+extern void *__sbrk_nosysenter (intptr_t __delta); -+#endif - extern ElfW(Phdr) *_dl_phdr; - extern size_t _dl_phnum; - -@@ -141,14 +145,26 @@ - - The initialized value of _dl_tls_static_size is provided by dl-open.c - to request some surplus that permits dynamic loading of modules with -- IE-model TLS. */ -+ IE-model TLS. -+ -+ Where the normal sbrk would use a syscall that needs the TLS (i386) -+ use the special non-sysenter version instead. */ - #if TLS_TCB_AT_TP - tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign); -+# ifdef INTERNAL_SYSCALL_NOSYSENTER -+ tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align); -+# else - tlsblock = __sbrk (tcb_offset + tcbsize + max_align); -+# endif - #elif TLS_DTV_AT_TP - tcb_offset = roundup (tcbsize, align ?: 1); -+# ifdef INTERNAL_SYSCALL_NOSYSENTER -+ tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align -+ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size)); -+# else - tlsblock = __sbrk (tcb_offset + memsz + max_align - + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size)); -+# endif - tlsblock += TLS_PRE_TCB_SIZE; - #else - /* In case a model with a different layout for the TCB and DTV ---- misc/sbrk.c -+++ misc/sbrk.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - - /* Defined in brk.c. */ - extern void *__curbrk; -@@ -29,6 +30,35 @@ - /* Extend the process's data space by INCREMENT. - If INCREMENT is negative, shrink data space by - INCREMENT. - Return start of new space allocated, or -1 for errors. */ -+#ifdef INTERNAL_SYSCALL_NOSYSENTER -+/* This version is used by csu/libc-tls.c whem initialising the TLS -+ if the SYSENTER version requires the TLS (which it does on i386). -+ Obviously using the TLS before it is initialised is broken. */ -+extern int __brk_nosysenter (void *addr); -+void * -+__sbrk_nosysenter (intptr_t increment) -+{ -+ void *oldbrk; -+ -+ /* If this is not part of the dynamic library or the library is used -+ via dynamic loading in a statically linked program update -+ __curbrk from the kernel's brk value. That way two separate -+ instances of __brk and __sbrk can share the heap, returning -+ interleaved pieces of it. */ -+ if (__curbrk == NULL || __libc_multiple_libcs) -+ if (__brk_nosysenter (0) < 0) /* Initialize the break. */ -+ return (void *) -1; -+ -+ if (increment == 0) -+ return __curbrk; -+ -+ oldbrk = __curbrk; -+ if (__brk_nosysenter (oldbrk + increment) < 0) -+ return (void *) -1; -+ -+ return oldbrk; -+} -+#endif - void * - __sbrk (intptr_t increment) - { ---- sysdeps/unix/sysv/linux/i386/brk.c -+++ sysdeps/unix/sysv/linux/i386/brk.c -@@ -31,6 +31,30 @@ - linker. */ - weak_alias (__curbrk, ___brk_addr) - -+#ifdef INTERNAL_SYSCALL_NOSYSENTER -+/* This version is used by csu/libc-tls.c whem initialising the TLS -+ * if the SYSENTER version requires the TLS (which it does on i386). -+ * Obviously using the TLS before it is initialised is broken. */ -+int -+__brk_nosysenter (void *addr) -+{ -+ void *__unbounded newbrk; -+ -+ INTERNAL_SYSCALL_DECL (err); -+ newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1, -+ __ptrvalue (addr)); -+ -+ __curbrk = newbrk; -+ -+ if (newbrk < addr) -+ { -+ __set_errno (ENOMEM); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif - int - __brk (void *addr) - { ---- sysdeps/unix/sysv/linux/i386/sysdep.h -+++ sysdeps/unix/sysv/linux/i386/sysdep.h -@@ -187,7 +187,7 @@ - /* The original calling convention for system calls on Linux/i386 is - to use int $0x80. */ - #ifdef I386_USE_SYSENTER --# ifdef SHARED -+# if defined SHARED || defined __PIC__ - # define ENTER_KERNEL call *%gs:SYSINFO_OFFSET - # else - # define ENTER_KERNEL call *_dl_sysinfo -@@ -358,7 +358,7 @@ - possible to use more than four parameters. */ - #undef INTERNAL_SYSCALL - #ifdef I386_USE_SYSENTER --# ifdef SHARED -+# if defined SHARED || defined __PIC__ - # define INTERNAL_SYSCALL(name, err, nr, args...) \ - ({ \ - register unsigned int resultvar; \ -@@ -384,6 +384,18 @@ - : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \ - ASMFMT_##nr(args) : "memory", "cc"); \ - (int) resultvar; }) -+# define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \ -+ ({ \ -+ register unsigned int resultvar; \ -+ EXTRAVAR_##nr \ -+ asm volatile ( \ -+ LOADARGS_NOSYSENTER_##nr \ -+ "movl %1, %%eax\n\t" \ -+ "int $0x80\n\t" \ -+ RESTOREARGS_NOSYSENTER_##nr \ -+ : "=a" (resultvar) \ -+ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \ -+ (int) resultvar; }) - # else - # define INTERNAL_SYSCALL(name, err, nr, args...) \ - ({ \ -@@ -447,12 +459,20 @@ - - #define LOADARGS_0 - #ifdef __PIC__ --# if defined I386_USE_SYSENTER && defined SHARED -+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ ) - # define LOADARGS_1 \ - "bpushl .L__X'%k3, %k3\n\t" - # define LOADARGS_5 \ - "movl %%ebx, %4\n\t" \ - "movl %3, %%ebx\n\t" -+# define LOADARGS_NOSYSENTER_1 \ -+ "bpushl .L__X'%k2, %k2\n\t" -+# define LOADARGS_NOSYSENTER_2 LOADARGS_NOSYSENTER_1 -+# define LOADARGS_NOSYSENTER_3 LOADARGS_3 -+# define LOADARGS_NOSYSENTER_4 LOADARGS_3 -+# define LOADARGS_NOSYSENTER_5 \ -+ "movl %%ebx, %3\n\t" \ -+ "movl %2, %%ebx\n\t" - # else - # define LOADARGS_1 \ - "bpushl .L__X'%k2, %k2\n\t" -@@ -474,11 +495,18 @@ - - #define RESTOREARGS_0 - #ifdef __PIC__ --# if defined I386_USE_SYSENTER && defined SHARED -+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ ) - # define RESTOREARGS_1 \ - "bpopl .L__X'%k3, %k3\n\t" - # define RESTOREARGS_5 \ - "movl %4, %%ebx" -+# define RESTOREARGS_NOSYSENTER_1 \ -+ "bpopl .L__X'%k2, %k2\n\t" -+# define RESTOREARGS_NOSYSENTER_2 RESTOREARGS_NOSYSENTER_1 -+# define RESTOREARGS_NOSYSENTER_3 RESTOREARGS_3 -+# define RESTOREARGS_NOSYSENTER_4 RESTOREARGS_3 -+# define RESTOREARGS_NOSYSENTER_5 \ -+ "movl %3, %%ebx" - # else - # define RESTOREARGS_1 \ - "bpopl .L__X'%k2, %k2\n\t" diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-disable-memset-warning.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-disable-memset-warning.patch deleted file mode 100644 index 6c00ef00f8..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-disable-memset-warning.patch +++ /dev/null @@ -1,31 +0,0 @@ -Disable memset warning that happens when the fill-value of memset is a non-zero -constant and the size parameter is zero. - -This warning is triggered when certain functions containing memset calls are -inlined, example: - -https://bugs.webkit.org/show_bug.cgi?id=78513 - -Warnings are treated as errors in the Chromium build. - - ---- string/bits/string3.h 2012-02-17 14:32:47.830600426 -0800 -+++ string/bits/string3.h 2012-02-17 14:32:47.830600426 -0800 -@@ -20,9 +20,6 @@ - # error "Never use directly; include instead." - #endif - --__warndecl (__warn_memset_zero_len, -- "memset used with constant zero length parameter; this could be due to transposed parameters"); -- - #ifndef __cplusplus - /* XXX This is temporarily. We should not redefine any of the symbols - and instead integrate the error checking into the original -@@ -79,7 +76,6 @@ - if (__builtin_constant_p (__len) && __len == 0 - && (!__builtin_constant_p (__ch) || __ch != 0)) - { -- __warn_memset_zero_len (); - return __dest; - } - return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest)); diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-frecord-gcc-switches.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-frecord-gcc-switches.patch deleted file mode 100644 index 53106323ca..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-frecord-gcc-switches.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ./glibc-2.11.1/csu/Makefile 2012-02-15 19:52:31.597382895 -0800 -+++ ./glibc-2.11.1/csu/Makefile 2012-02-15 19:53:24.557242505 -0800 -@@ -93,7 +93,7 @@ - $(crtstuff:%=$(objpfx)%.o): %.o: %.S $(objpfx)defs.h - $(compile.S) -g0 $(ASFLAGS-.os) -o $@ - --CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time) -+CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time) -fno-record-gcc-switches - - vpath initfini.c $(sysdirs) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-resolv-milliseconds.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-resolv-milliseconds.patch deleted file mode 100644 index ff5a1a7bf5..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-resolv-milliseconds.patch +++ /dev/null @@ -1,124 +0,0 @@ -This is a pending upstream change. -http://sourceware.org/ml/libc-alpha/2012-06/msg00571.html -Allow an option to specify DNS timeout in milliseconds instead -of seconds. ---- -v3 changes: - * Handle situations where the ns shift would have overflowed INT_MAX - * Removed RES_MINWAIT_MS; using 1 second universally, since this is now an - unlikely exceptional condition. - - resolv/res_debug.c | 1 + - resolv/res_init.c | 9 +++++++++ - resolv/res_send.c | 26 ++++++++++++++++++++++---- - resolv/resolv.h | 2 ++ - 4 files changed, 34 insertions(+), 4 deletions(-) - -diff --git a/resolv/res_debug.c b/resolv/res_debug.c -index 3daa44e..e4915f8 100644 ---- a/resolv/res_debug.c -+++ b/resolv/res_debug.c -@@ -589,6 +589,7 @@ p_option(u_long option) { - case RES_USE_EDNS0: return "edns0"; - case RES_USE_DNSSEC: return "dnssec"; - case RES_NOTLDQUERY: return "no-tld-query"; -+ case RES_TIMEOUT_MS: return "timeout-in-milliseconds"; - /* XXX nonreentrant */ - default: sprintf(nbuf, "?0x%lx?", (u_long)option); - return (nbuf); -diff --git a/resolv/res_init.c b/resolv/res_init.c -index c58c763..d00a7b0 100644 ---- a/resolv/res_init.c -+++ b/resolv/res_init.c -@@ -501,11 +501,20 @@ res_setoptions(res_state statp, const char *options, const char *source) { - printf(";;\tndots=%d\n", statp->ndots); - #endif - } else if (!strncmp(cp, "timeout:", sizeof("timeout:") - 1)) { -+ statp->options &= ~RES_TIMEOUT_MS; - i = atoi(cp + sizeof("timeout:") - 1); - if (i <= RES_MAXRETRANS) - statp->retrans = i; - else - statp->retrans = RES_MAXRETRANS; -+ } else if (!strncmp(cp, "timeout-ms:", -+ sizeof("timeout-ms:") - 1)) { -+ statp->options |= RES_TIMEOUT_MS; -+ i = atoi(cp + sizeof("timeout-ms:") - 1); -+ if (i <= RES_MAXRETRANS * 1000) -+ statp->retrans = i; -+ else -+ statp->retrans = RES_MAXRETRANS * 1000; - } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){ - i = atoi(cp + sizeof("attempts:") - 1); - if (i <= RES_MAXRETRY) -diff --git a/resolv/res_send.c b/resolv/res_send.c -index 0a28cd7..4d45335 100644 ---- a/resolv/res_send.c -+++ b/resolv/res_send.c -@@ -1008,11 +1008,29 @@ send_dg(res_state statp, - /* - * Compute time for the total operation. - */ -- int seconds = (statp->retrans << ns); -+ int operation_time; -+ if (statp->retrans > (INT_MAX >> ns)) { -+ /* -+ * Saturate operation_time if it would have exceeded INT_MAX -+ */ -+ operation_time = INT_MAX; -+ } else { -+ operation_time = (statp->retrans << ns); -+ } - if (ns > 0) -- seconds /= statp->nscount; -- if (seconds <= 0) -+ operation_time /= statp->nscount; -+ time_t seconds; -+ long milliseconds; -+ if (operation_time <= 0) { - seconds = 1; -+ milliseconds = 0; -+ } else if ((statp->options & RES_TIMEOUT_MS) != 0) { -+ seconds = operation_time / 1000; -+ milliseconds = operation_time % 1000; -+ } else { -+ seconds = operation_time; -+ milliseconds = 0; -+ } - bool single_request = (statp->options & RES_SNGLKUP) != 0; - bool single_request_reopen = (statp->options & RES_SNGLKUPREOP) != 0; - int save_gotsomewhere = *gotsomewhere; -@@ -1025,7 +1043,7 @@ send_dg(res_state statp, - return retval; - retry: - evNowTime(&now); -- evConsTime(&timeout, seconds, 0); -+ evConsTime(&timeout, seconds, milliseconds * 1000000L); - evAddTime(&finish, &now, &timeout); - int need_recompute = 0; - int nwritten = 0; -diff --git a/resolv/resolv.h b/resolv/resolv.h -index ed15a70..f09754a 100644 ---- a/resolv/resolv.h -+++ b/resolv/resolv.h -@@ -97,7 +97,7 @@ typedef res_sendhookact (*res_send_rhook - # define MAXRESOLVSORT 10 /* number of net to sort on */ - # define RES_MAXNDOTS 15 /* should reflect bit field size */ - # define RES_MAXRETRANS 30 /* only for resolv.conf/RES_OPTIONS */ --# define RES_MAXRETRY 5 /* only for resolv.conf/RES_OPTIONS */ -+# define RES_MAXRETRY 15 /* only for resolv.conf/RES_OPTIONS */ - # define RES_DFLRETRY 2 /* Default #/tries. */ - # define RES_MAXTIME 65535 /* Infinity, in milliseconds. */ - -@@ -221,6 +221,8 @@ struct res_sym { - #define RES_USE_DNSSEC 0x00800000 /* use DNSSEC using OK bit in OPT */ - #define RES_NOTLDQUERY 0x01000000 /* Do not look up unqualified name - as a TLD. */ -+#define RES_TIMEOUT_MS 0x02000000 /* Timeout is specified in -+ milliseconds instead of seconds. */ - - #define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT) - --- -1.7.7.3 - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-tls-stack-addition.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-tls-stack-addition.patch deleted file mode 100644 index e94e08b40f..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.11/glibc-2.11-tls-stack-addition.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 86b7236edcb4e1719a0da7273128286b3fda20eb Mon Sep 17 00:00:00 2001 -From: Ahmad Sharif -Date: Tue, 24 Apr 2012 11:19:19 -0700 -Subject: [PATCH] Added TLS size to stack size if it's lower than 16 * - TLS_SIZE. - -Under normal circumstances, the TLS size is substracted from the stack size -before allocaton. This can cause the application to crash if the TLS size is -close to the stack size. ---- - nptl/allocatestack.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c -index 79c4531..7864c8c 100644 ---- a/nptl/allocatestack.c -+++ b/nptl/allocatestack.c -@@ -463,6 +463,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, - size += pagesize_m1 + 1; - #endif - -+ if (size < 16 * __static_tls_size) -+ size = roundup (size + __static_tls_size, pagesize_m1 + 1); -+ - /* Adjust the stack size for alignment. */ - size &= ~__static_tls_align_m1; - assert (size != 0); --- -1.7.7.3 - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.12/glibc-2.12-hardened-pie.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.12/glibc-2.12-hardened-pie.patch deleted file mode 100644 index 3315171d95..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.12/glibc-2.12-hardened-pie.patch +++ /dev/null @@ -1,39 +0,0 @@ -2010-08-11 Magnus Granberg - - #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/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.6/glibc-2.6-gentoo-stack_chk_fail.c b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.6/glibc-2.6-gentoo-stack_chk_fail.c deleted file mode 100644 index 217bf1a907..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/2.6/glibc-2.6-gentoo-stack_chk_fail.c +++ /dev/null @@ -1,321 +0,0 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Copyright (C) 2006-2007 Gentoo Foundation Inc. - * License terms as above. - * - * Hardened Gentoo SSP handler - * - * An SSP failure handler that does not use functions from the rest of - * glibc; it uses the INTERNAL_SYSCALL methods directly. This ensures - * no possibility of recursion into the handler. - * - * Direct all bug reports to http://bugs.gentoo.org/ - * - * Re-written from the glibc-2.3 Hardened Gentoo SSP handler - * by Kevin F. Quinn - - * - * The following people contributed to the glibc-2.3 Hardened - * Gentoo SSP handler, from which this implementation draws much: - * - * Ned Ludd - - * Alexander Gabert - - * The PaX Team - - * Peter S. Mazinger - - * Yoann Vandoorselaere - - * Robert Connolly - - * Cory Visi - * Mike Frysinger - */ - -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include - -#include -/* from sysdeps */ -#include -/* for the stuff in bits/socket.h */ -#include -#include - - -/* Sanity check on SYSCALL macro names - force compilation - * failure if the names used here do not exist - */ -#if !defined __NR_socketcall && !defined __NR_socket -# error Cannot do syscall socket or socketcall -#endif -#if !defined __NR_socketcall && !defined __NR_connect -# error Cannot do syscall connect or socketcall -#endif -#ifndef __NR_write -# error Cannot do syscall write -#endif -#ifndef __NR_close -# error Cannot do syscall close -#endif -#ifndef __NR_getpid -# error Cannot do syscall getpid -#endif -#ifndef __NR_kill -# error Cannot do syscall kill -#endif -#ifndef __NR_exit -# error Cannot do syscall exit -#endif -#ifdef SSP_SMASH_DUMPS_CORE -# define ENABLE_SSP_SMASH_DUMPS_CORE 1 -# if !defined _KERNEL_NSIG && !defined _NSIG -# error No _NSIG or _KERNEL_NSIG for rt_sigaction -# endif -# if !defined __NR_sigaction && !defined __NR_rt_sigaction -# error Cannot do syscall sigaction or rt_sigaction -# endif -/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size - * of the _kernel_ sigset_t which is not the same as the user sigset_t. - * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for - * some reason. - */ -# ifdef _KERNEL_NSIG -# define _SSP_NSIG _KERNEL_NSIG -# else -# define _SSP_NSIG _NSIG -# endif -#else -# define _SSP_NSIG 0 -# define ENABLE_SSP_SMASH_DUMPS_CORE 0 -#endif - -/* Define DO_SIGACTION - default to newer rt signal interface but - * fallback to old as needed. - */ -#ifdef __NR_rt_sigaction -# define DO_SIGACTION(signum, act, oldact) \ - INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8) -#else -# define DO_SIGACTION(signum, act, oldact) \ - INLINE_SYSCALL(sigaction, 3, signum, act, oldact) -#endif - -/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */ -#if defined(__NR_socket) && defined(__NR_connect) -# define USE_OLD_SOCKETCALL 0 -#else -# define USE_OLD_SOCKETCALL 1 -#endif -/* stub out the __NR_'s so we can let gcc optimize away dead code */ -#ifndef __NR_socketcall -# define __NR_socketcall 0 -#endif -#ifndef __NR_socket -# define __NR_socket 0 -#endif -#ifndef __NR_connect -# define __NR_connect 0 -#endif -#define DO_SOCKET(result, domain, type, protocol) \ - do { \ - if (USE_OLD_SOCKETCALL) { \ - socketargs[0] = domain; \ - socketargs[1] = type; \ - socketargs[2] = protocol; \ - socketargs[3] = 0; \ - result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \ - } else \ - result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \ - } while (0) -#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \ - do { \ - if (USE_OLD_SOCKETCALL) { \ - socketargs[0] = sockfd; \ - socketargs[1] = (unsigned long int)serv_addr; \ - socketargs[2] = addrlen; \ - socketargs[3] = 0; \ - result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \ - } else \ - result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \ - } while (0) - -#ifndef _PATH_LOG -# define _PATH_LOG "/dev/log" -#endif - -static const char path_log[] = _PATH_LOG; - -/* For building glibc with SSP switched on, define __progname to a - * constant if building for the run-time loader, to avoid pulling - * in more of libc.so into ld.so - */ -#ifdef IS_IN_rtld -static char *__progname = ""; -#else -extern char *__progname; -#endif - - -/* Common handler code, used by stack_chk_fail and __stack_smash_handler - * Inlined to ensure no self-references to the handler within itself. - * Data static to avoid putting more than necessary on the stack, - * to aid core debugging. - */ -__attribute__ ((__noreturn__ , __always_inline__)) -static inline void -__hardened_gentoo_stack_chk_fail(char func[], int damaged) -{ -#define MESSAGE_BUFSIZ 256 - static pid_t pid; - static int plen, i; - static char message[MESSAGE_BUFSIZ]; - static const char msg_ssa[] = ": stack smashing attack"; - static const char msg_inf[] = " in function "; - static const char msg_ssd[] = "*** stack smashing detected ***: "; - static const char msg_terminated[] = " - terminated\n"; - static const char msg_report[] = "Report to http://bugs.gentoo.org/\n"; - static const char msg_unknown[] = ""; - static int log_socket, connect_result; - static struct sockaddr_un sock; - static unsigned long int socketargs[4]; - - /* Build socket address - */ - sock.sun_family = AF_UNIX; - i = 0; - while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1))) { - sock.sun_path[i] = path_log[i]; - i++; - } - sock.sun_path[i] = '\0'; - - /* Try SOCK_DGRAM connection to syslog */ - connect_result = -1; - DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0); - if (log_socket != -1) - DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock)); - if (connect_result == -1) { - if (log_socket != -1) - INLINE_SYSCALL(close, 1, log_socket); - /* Try SOCK_STREAM connection to syslog */ - DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0); - if (log_socket != -1) - DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock)); - } - - /* Build message. Messages are generated both in the old style and new style, - * so that log watchers that are configured for the old-style message continue - * to work. - */ -#define strconcat(str) \ - {i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \ - {\ - message[plen+i]=str[i];\ - i++;\ - }\ - plen+=i;} - - /* R.Henderson post-gcc-4 style message */ - plen = 0; - strconcat(msg_ssd); - if (__progname != (char *)0) - strconcat(__progname) - else - strconcat(msg_unknown); - strconcat(msg_terminated); - - /* Write out error message to STDERR, to syslog if open */ - INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen); - if (connect_result != -1) - INLINE_SYSCALL(write, 3, log_socket, message, plen); - - /* Dr. Etoh pre-gcc-4 style message */ - plen = 0; - if (__progname != (char *)0) - strconcat(__progname) - else - strconcat(msg_unknown); - strconcat(msg_ssa); - strconcat(msg_inf); - if (func != NULL) - strconcat(func) - else - strconcat(msg_unknown); - strconcat(msg_terminated); - /* Write out error message to STDERR, to syslog if open */ - INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen); - if (connect_result != -1) - INLINE_SYSCALL(write, 3, log_socket, message, plen); - - /* Direct reports to bugs.gentoo.org */ - plen=0; - strconcat(msg_report); - message[plen++]='\0'; - - /* Write out error message to STDERR, to syslog if open */ - INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen); - if (connect_result != -1) - INLINE_SYSCALL(write, 3, log_socket, message, plen); - - if (log_socket != -1) - INLINE_SYSCALL(close, 1, log_socket); - - /* Suicide */ - pid = INLINE_SYSCALL(getpid, 0); - - if (ENABLE_SSP_SMASH_DUMPS_CORE) { - static struct sigaction default_abort_act; - /* Remove any user-supplied handler for SIGABRT, before using it */ - default_abort_act.sa_handler = SIG_DFL; - default_abort_act.sa_sigaction = NULL; - __sigfillset(&default_abort_act.sa_mask); - default_abort_act.sa_flags = 0; - if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0) - INLINE_SYSCALL(kill, 2, pid, SIGABRT); - } - - /* Note; actions cannot be added to SIGKILL */ - INLINE_SYSCALL(kill, 2, pid, SIGKILL); - - /* In case the kill didn't work, exit anyway - * The loop prevents gcc thinking this routine returns - */ - while (1) - INLINE_SYSCALL(exit, 0); -} - -__attribute__ ((__noreturn__)) -void __stack_chk_fail(void) -{ - __hardened_gentoo_stack_chk_fail(NULL, 0); -} - -#ifdef ENABLE_OLD_SSP_COMPAT -__attribute__ ((__noreturn__)) -void __stack_smash_handler(char func[], int damaged) -{ - __hardened_gentoo_stack_chk_fail(func, damaged); -} -#endif diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/common.eblit b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/common.eblit deleted file mode 100644 index f47a25b402..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/common.eblit +++ /dev/null @@ -1,313 +0,0 @@ -# Copyright 1999-2012 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.28 2012/08/10 19:44:47 vapier Exp $ - -alt_prefix() { - is_crosscompile && echo /usr/${CTARGET} -} - -# We need to be able to set alternative headers for -# compiling for non-native platform -# Will also become useful for testing kernel-headers without screwing up -# the whole system. -# note: intentionally undocumented. -alt_headers() { - echo ${ALT_HEADERS:=$(alt_prefix)/usr/include} -} -alt_build_headers() { - if [[ -z ${ALT_BUILD_HEADERS} ]] ; then - ALT_BUILD_HEADERS=$(alt_headers) - if tc-is-cross-compiler ; then - ALT_BUILD_HEADERS=${ROOT}$(alt_headers) - if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then - local header_path=$(echo '#include ' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h') - ALT_BUILD_HEADERS=${header_path%/linux/version.h} - fi - fi - fi - echo "${ALT_BUILD_HEADERS}" -} - -alt_libdir() { - echo $(alt_prefix)/$(get_libdir) -} -alt_usrlibdir() { - echo $(alt_prefix)/usr/$(get_libdir) -} - -setup_target_flags() { - # This largely mucks with compiler flags. None of which should matter - # when building up just the headers. - just_headers && return 0 - - # Needed as workaround to fix: - # http://code.google.com/p/chromium-os/issues/detail?id=22373 - # Can be removed when we emerge glibc to the target: - # http://code.google.com/p/chromium-os/issues/detail?id=20792 - append-cflags "-ggdb" - - if ! use cros_host ; then - # ChromiumOS: Need to unset the SYSROOT value so that the - # compiler uses the default sysroot when building glibc. This - # is because the glibc startup objects are needed to configure - # glibc. We don't want to bootstrap libc again. - export SYSROOT="" - fi - - # Never use gold to build glibc. Manually force GNU ld, whatever the actual settings are. - # Glibc does not link with gold because of missing features. It also doesn't pass the - # configure check. - export CC="$(tc-getCC ${CTARGET}) -B$(get_binutils_path_ld ${CTARGET})" - - case $(tc-arch) in - x86) - # -march needed for #185404 #199334 - if ! glibc_compile_test "" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n' 2>/dev/null ; then - local t=${CTARGET_OPT:-${CTARGET}} - t=${t%%-*} - filter-flags '-march=*' - export CFLAGS="-march=${t} ${CFLAGS}" - einfo "Auto adding -march=${t} to CFLAGS #185404" - fi - ;; - amd64) - # -march needed for #185404 #199334 - if ! glibc_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n' 2>/dev/null ; then - local t=${CTARGET_OPT:-${CTARGET}} - t=${t%%-*} - filter-flags '-march=*' - # ugly, ugly, ugly. ugly. - CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}") - export CFLAGS_x86="${CFLAGS_x86} -march=${t}" - einfo "Auto adding -march=${t} to CFLAGS_x86 #185404" - fi - ;; - ppc) - append-flags "-freorder-blocks" - ;; - sparc) - # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though. - filter-flags "-fcall-used-g7" - append-flags "-fcall-used-g6" - filter-flags "-mvis" - - GLIBCMAJOR=$(get_version_component_range 1 ${PV}) - GLIBCMINOR=$(get_version_component_range 2 ${PV}) - - # set CTARGET_OPT so glibc can use cpu-specific .S files for better performance - # - UltraSPARC T1 (niagara) support requires >= glibc 2.8 - # - UltraSPARC T2 (niagara2) support requires >= glibc 2.7 - - if is_crosscompile || [[ ${PROFILE_ARCH} == "sparc64" ]] || { has_multilib_profile && ! tc-is-cross-compiler; } ; then - case ${ABI}:${CTARGET} in - sparc64:*|\ - default:sparc64*) - filter-flags -Wa,-xarch -Wa,-A - - if is-flagq "-mcpu=niagara2" && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.7 ]] ; then - CTARGET_OPT="sparc64v2-unknown-linux-gnu" - append-flags "-Wa,-xarch=v9b" - export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b" - elif { is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2" ; } && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.6 ]] ; then - CTARGET_OPT="sparc64v-unknown-linux-gnu" - append-flags "-Wa,-xarch=v9b" - export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b" - elif is-flagq "-mcpu=ultrasparc3" || is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2"; then - CTARGET_OPT="sparc64b-unknown-linux-gnu" - append-flags "-Wa,-xarch=v9b" - export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b" - else - CTARGET_OPT="sparc64-unknown-linux-gnu" - append-flags "-Wa,-xarch=v9a" - export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9a" - fi - ;; - *) - if is-flagq "-mcpu=niagara2" && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.7 ]] ; then - CTARGET_OPT="sparcv9v2-unknown-linux-gnu" - elif { is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2" ; } && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.6 ]] ; then - CTARGET_OPT="sparcv9v-unknown-linux-gnu" - elif is-flagq "-mcpu=ultrasparc3" || is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2"; then - CTARGET_OPT="sparcv9b-unknown-linux-gnu" - else - CTARGET_OPT="sparcv9-unknown-linux-gnu" - fi - ;; - esac - else - if is-flagq "-mcpu=niagara2" && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.7 ]] ; then - CTARGET_OPT="sparcv9v2-unknown-linux-gnu" - elif { is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2" ; } && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.6 ]] ; then - CTARGET_OPT="sparcv9v-unknown-linux-gnu" - elif is-flagq "-mcpu=ultrasparc3" || is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2"; then - CTARGET_OPT="sparcv9b-unknown-linux-gnu" - elif { is_crosscompile && want_nptl; } || is-flagq "-mcpu=ultrasparc2" || is-flagq "-mcpu=ultrasparc"; then - CTARGET_OPT="sparcv9-unknown-linux-gnu" - fi - fi - ;; - esac -} - -setup_flags() { - # Make sure host make.conf doesn't pollute us - if is_crosscompile || tc-is-cross-compiler ; then - CHOST=${CTARGET} strip-unsupported-flags - fi - - # Store our CFLAGS because it's changed depending on which CTARGET - # we are building when pulling glibc on a multilib profile - CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}} - CFLAGS=${CFLAGS_BASE} - CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}} - CXXFLAGS=${CXXFLAGS_BASE} - ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}} - ASFLAGS=${ASFLAGS_BASE} - - # Over-zealous CFLAGS can often cause problems. What may work for one - # person may not work for another. To avoid a large influx of bugs - # relating to failed builds, we strip most CFLAGS out to ensure as few - # problems as possible. - strip-flags - strip-unsupported-flags - filter-flags -m32 -m64 -mabi=* - - unset CBUILD_OPT CTARGET_OPT - if has_multilib_profile ; then - CTARGET_OPT=$(get_abi_CTARGET) - [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST) - fi - - setup_target_flags - - if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then - CBUILD_OPT=${CTARGET_OPT} - fi - - # Lock glibc at -O2 -- linuxthreads needs it and we want to be - # conservative here. -fno-strict-aliasing is to work around #155906 - filter-flags -O? - append-flags -O2 -fno-strict-aliasing - - # Can't build glibc itself with fortify code. Newer versions add - # this flag for us, so no need to do it manually. - version_is_at_least 2.16 ${PV} || append-cppflags -U_FORTIFY_SOURCE - - # Undefine USE_NSCD to disable of the use of nscd implementation - # in glibc functions (crosbug.com/21924). - append-cppflags -UUSE_NSCD - - # 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 #293721 - use hardened && gcc-ssp && append-cflags $(test-flags-CC -fno-stack-protector) - - if use hardened && gcc-pie; then - # Force PIC macro definition for all compilations since they're all - # either -fPIC or -fPIE with the default-PIE compiler. - append-cppflags -DPIC - else - # Don't build -fPIE without the default-PIE compiler and the - # hardened-pie patch - filter-flags -fPIE - fi -} - -want_nptl() { - [[ -z ${LT_VER} ]] && return 0 - want_tls || return 1 - use nptl || return 1 - - # Only list the arches that cannot do NPTL - case $(tc-arch) in - m68k) return 1;; - sparc) - # >= v9 is needed for nptl. - [[ ${PROFILE_ARCH} == "sparc" ]] && return 1 - ;; - esac - - return 0 -} - -want_linuxthreads() { - [[ -z ${LT_VER} ]] && return 1 - use linuxthreads -} - -want_tls() { - # Archs that can use TLS (Thread Local Storage) - case $(tc-arch) in - x86) - # requires i486 or better #106556 - [[ ${CTARGET} == i[4567]86* ]] && return 0 - return 1 - ;; - esac - - return 0 -} - -want__thread() { - want_tls || return 1 - - # For some reason --with-tls --with__thread is causing segfaults on sparc32. - [[ ${PROFILE_ARCH} == "sparc" ]] && return 1 - - [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD} - - # only test gcc -- cant test linking yet - tc-has-tls -c ${CTARGET} - WANT__THREAD=$? - - return ${WANT__THREAD} -} - -use_multiarch() { - # Make sure binutils is new enough to support indirect functions #336792 - local bver nver - bver=$($(tc-getLD ${CTARGET}) -v | sed -n -r '1{s:[^0-9]*::;s:^([0-9.]*).*:\1:;p}') - 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 had historically -# been defined in the profiles for these archs. -setup_env() { - # silly users - unset LD_RUN_PATH - - multilib_env ${CTARGET_OPT:-${CTARGET}} - if is_crosscompile || tc-is-cross-compiler ; then - if ! use multilib ; then - MULTILIB_ABIS=${DEFAULT_ABI} - else - MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}} - fi - - # If the user has CFLAGS_ in their make.conf, use that, - # and fall back on CFLAGS. - local VAR=CFLAGS_${CTARGET//[-.]/_} - CFLAGS=${!VAR-${CFLAGS}} - fi - - setup_flags - - export ABI=${ABI:-${DEFAULT_ABI:-default}} - - local VAR=CFLAGS_${ABI} - # We need to export CFLAGS with abi information in them because glibc's - # configure script checks CFLAGS for some targets (like mips). Keep - # around the original clean value to avoid appending multiple ABIs on - # top of each other. - : ${__GLIBC_CC:=$(tc-getCC ${CTARGET_OPT:-${CTARGET}})} - export __GLIBC_CC CC="${__GLIBC_CC} ${!VAR}" -} - -just_headers() { - is_crosscompile && use crosscompile_opts_headers-only -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/pkg_postinst.eblit b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/pkg_postinst.eblit deleted file mode 100644 index 9e5447d267..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/pkg_postinst.eblit +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_postinst.eblit,v 1.2 2012/04/15 20:04:44 vapier Exp $ - -eblit-glibc-pkg_postinst() { - # nothing to do if just installing headers - just_headers && return - - 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 ... if in a chroot or a diff init package, ignore - # errors from this step #253697 - /sbin/telinit U 2>/dev/null - - # 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 - locale-gen -j $(makeopts_jobs) --config "${locale_list}" - fi -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/pkg_preinst.eblit b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/pkg_preinst.eblit deleted file mode 100644 index bb1032ddcb..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/pkg_preinst.eblit +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 1999-2012 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.6 2012/10/02 07:12:17 vapier Exp $ - -eblit-glibc-pkg_preinst() { - # nothing to do if just installing headers - just_headers && return - - # prepare /etc/ld.so.conf.d/ for files - mkdir -p "${ROOT}"/etc/ld.so.conf.d - - # Default /etc/hosts.conf:multi to on for systems with small dbs. - if [[ $(wc -l < "${ROOT}"/etc/hosts) -lt 1000 ]] ; then - sed -i '/^multi off/s:off:on:' "${D}"/etc/host.conf - elog "Defaulting /etc/host.conf:multi to on" - fi - - # 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 - cd / #228809 - 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 - # 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/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/pkg_setup.eblit b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/pkg_setup.eblit deleted file mode 100644 index 640fce341c..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/pkg_setup.eblit +++ /dev/null @@ -1,122 +0,0 @@ -# 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/pkg_setup.eblit,v 1.10 2011/12/14 16:42:46 vapier Exp $ - -glibc_compile_test() { - local ret save_cflags=${CFLAGS} - CFLAGS+=" $1" - shift - - pushd "${T}" >/dev/null - - rm -f glibc-test* - printf '%b' "$*" > glibc-test.c - - emake -s glibc-test - ret=$? - - popd >/dev/null - - CFLAGS=${save_cflags} - return ${ret} -} - -glibc_run_test() { - local ret - - if [[ ${EMERGE_FROM} == "binary" ]] ; then - # ignore build failures when installing a binary package #324685 - glibc_compile_test "" "$@" 2>/dev/null || return 0 - else - if ! glibc_compile_test "" "$@" ; then - ewarn "Simple build failed ... assuming this is desired #324685" - return 0 - fi - fi - - pushd "${T}" >/dev/null - - ./glibc-test - ret=$? - rm -f glibc-test* - - popd >/dev/null - - return ${ret} -} - -eblit-glibc-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} == "/" ]] && [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; 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 - - if ! glibc_run_test '#include \nint main(){return getpwuid(0)==0;}\n' - then - eerror "Your patched vendor kernel is broken. You need to get an" - eerror "update from whoever is providing the kernel to you." - eerror "http://sourceware.org/bugzilla/show_bug.cgi?id=5227" - eerror "http://bugs.gentoo.org/262698" - die "keeping your system alive, say thank you" - fi - - if ! glibc_run_test '#include \n#include \nint main(){return syscall(1000)!=-1;}\n' - then - eerror "Your old kernel is broken. You need to update it to" - eerror "a newer version as syscall() will break." - eerror "http://bugs.gentoo.org/279260" - die "keeping your system alive, say thank you" - 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 [[ -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 when running with a 32bit" - ewarn "hypervisor, 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" - - # Make sure host system is up to date #394453 - if has_version ' /dev/null - local ADDONS=$(echo */configure | sed \ - -e 's:/configure::g' \ - -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \ - -e 's: \+$::' \ - -e 's! !,!g' \ - -e 's!^!,!' \ - -e '/^,\*$/d') - [[ -d ports ]] && ADDONS="${ADDONS},ports" - popd > /dev/null - - myconf="${myconf} $(use_enable hardened stackguard-randomization)" - if has_version ' "${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 - - # 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 even - # if the main library set isn't installed into the right place. Maybe - # we should query the active gcc for info instead of hardcoding it ? - local i ldso_abi ldso_name - local ldso_abi_list=( - # x86 - amd64 /lib64/ld-linux-x86-64.so.2 - x32 /libx32/ld-linux-x32.so.2 - x86 /lib/ld-linux.so.2 - # mips - o32 /lib/ld.so.1 - n32 /lib32/ld.so.1 - n64 /lib64/ld.so.1 - # powerpc - ppc /lib/ld.so.1 - ppc64 /lib64/ld64.so.1 - # s390 - s390 /lib/ld.so.1 - s390x /lib/ld64.so.1 - # sparc - sparc32 /lib/ld-linux.so.2 - sparc64 /lib64/ld-linux.so.2 - ) - if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${D}/$(alt_prefix)/lib ]] ; then - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib - fi - for (( i = 0; i < ${#ldso_abi_list[@]}; ++i )) ; do - ldso_abi=${ldso_abi_list[i]} - has ${ldso_abi} $(get_install_abis) || continue - - ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}" - if [[ ! -L ${D}/${ldso_name} && ! -e ${D}/${ldso_name} ]] ; then - dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name} - fi - done - - ################################################################# - # 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 - # We need to make sure that /lib and /usr/lib always exists. - # gcc likes to use relative paths to get to its multilibs like - # /usr/lib/../lib64/. So while we don't install any files into - # /usr/lib/, we do need it to exist. - cd "${D}"$(alt_libdir)/.. - [[ -e lib ]] || mkdir lib - cd "${D}"$(alt_usrlibdir)/.. - [[ -e lib ]] || mkdir lib - - dosym usr/include $(alt_prefix)/sys-include - return 0 - 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..." - - emake \ - -C "${GBUILDDIR}" \ - 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 - - local nscd_args=( - -e "s:@PIDFILE@:$(strings "${D}"/usr/sbin/nscd | grep nscd.pid):" - ) - version_is_at_least 2.16 || nscd_args+=( -e 's: --foreground : :' ) - sed -i "${nscd_args[@]}" "${D}"/etc/init.d/nscd - - echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc - doenvd "${T}"/00glibc || die - - for d in BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do - [[ -s ${d} ]] && dodoc ${d} - done - - # 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}" - emake install_root="${D}$(alt_prefix)" install-headers || die - if ! version_is_at_least 2.16 ; then - insinto $(alt_headers)/bits - doins bits/stdio_lim.h || die - fi - 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=$(has 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 ! has nostrip ${FEATURES} && ! has splitdebug ${FEATURES} ; then - ${STRIP:-${CTARGET}-strip} --strip-debug "${D}"/*/libpthread-*.so - fi -} - -eblit-glibc-src_install() { - if just_headers ; then - export ABI=default - 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/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_test.eblit b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_test.eblit deleted file mode 100644 index edcdac71de..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_test.eblit +++ /dev/null @@ -1,42 +0,0 @@ -# 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.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 - emake -j1 check && return 0 - einfo "make check failed - re-running with --keep-going to get the rest of the results" - emake -j1 -k check - ewarn "make check failed for ${ABI}-${CTARGET}-$1" - return 1 -} - -eblit-glibc-src_test() { - local ret=0 - - setup_env - - # give tests more time to complete - export TIMEOUTFACTOR=5 - - if [[ -z ${OABI} ]] && has_multilib_profile ; then - OABI=${ABI} - einfo "Testing multilib glibc for ABIs: $(get_install_abis)" - for ABI in $(get_install_abis) ; do - export ABI - einfo " Testing ${ABI} glibc" - src_test - ((ret+=$?)) - done - ABI=${OABI} - unset OABI - [[ ${ret} -ne 0 ]] \ - && die "tests failed" \ - || return 0 - fi - - want_linuxthreads && toolchain-glibc_src_test linuxthreads ; ((ret+=$?)) - want_nptl && toolchain-glibc_src_test nptl ; ((ret+=$?)) - return ${ret} -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_unpack.eblit b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_unpack.eblit deleted file mode 100644 index 5f04ef605e..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_unpack.eblit +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_unpack.eblit,v 1.19 2012/11/11 07:24:55 vapier Exp $ - -int_to_KV() { - local version=$1 major minor micro - major=$((version / 65536)) - minor=$(((version % 65536) / 256)) - micro=$((version % 256)) - echo ${major}.${minor}.${micro} -} - -eend_KV() { - [[ $(KV_to_int $1) -ge $(KV_to_int $2) ]] - eend $? -} - -get_kheader_version() { - printf '#include \nLINUX_VERSION_CODE\n' | \ - $(tc-getCPP ${CTARGET}) -I "$(alt_build_headers)" | \ - tail -n 1 -} - -check_nptl_support() { - # don't care about the compiler here as we arent using it - just_headers && return - - local run_kv build_kv want_kv - run_kv=$(int_to_KV $(get_KV)) - build_kv=$(int_to_KV $(get_kheader_version)) - want_kv=${NPTL_KERN_VER} - - ebegin "Checking gcc for __thread support" - if ! eend $(want__thread ; echo $?) ; then - echo - eerror "Could not find a gcc that supports the __thread directive!" - eerror "Please update your binutils/gcc and try again." - die "No __thread support in gcc!" - fi - - if ! is_crosscompile && ! tc-is-cross-compiler ; then - # Building fails on an non-supporting kernel - ebegin "Checking kernel version (${run_kv} >= ${want_kv})" - if ! eend_KV ${run_kv} ${want_kv} ; then - echo - eerror "You need a kernel of at least ${want_kv} for NPTL support!" - die "Kernel version too low!" - fi - fi - - ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})" - if ! eend_KV ${build_kv} ${want_kv} ; then - echo - eerror "You need linux-headers of at least ${want_kv} for NPTL support!" - die "linux-headers version too low!" - fi -} - -unpack_pkg() { - local a=${PN} - [[ -n ${SNAP_VER} ]] && a="${a}-${RELEASE_VER}" - [[ -n $1 ]] && a="${a}-$1" - if [[ -n ${SNAP_VER} ]] ; then - a="${a}-${SNAP_VER}" - else - if [[ -n $2 ]] ; then - a="${a}-$2" - else - a="${a}-${RELEASE_VER}" - fi - fi - if has ${a}.tar.xz ${A} ; then - unpacker ${a}.tar.xz - else - unpack ${a}.tar.bz2 - fi - [[ -n $1 ]] && { mv ${a} $1 || die ; } -} - -toolchain-glibc_src_unpack() { - # Check NPTL support _before_ we unpack things to save some time - want_nptl && check_nptl_support - - if [[ -n ${EGIT_REPO_URIS} ]] ; then - local i d - for ((i=0; i<${#EGIT_REPO_URIS[@]}; ++i)) ; do - EGIT_REPO_URI=${EGIT_REPO_URIS[$i]} - EGIT_SOURCEDIR=${EGIT_SOURCEDIRS[$i]} - git-2_src_unpack - done - else - unpack_pkg - fi - - cd "${S}" - touch locale/C-translit.h #185476 #218003 - [[ -n ${LT_VER} ]] && unpack_pkg linuxthreads ${LT_VER} - [[ -n ${PORTS_VER} ]] && unpack_pkg ports ${PORTS_VER} - [[ -n ${LIBIDN_VER} ]] && unpack_pkg libidn - - if [[ -n ${PATCH_VER} ]] ; then - cd "${WORKDIR}" - unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2 - # pull out all the addons - local d - for d in extra/*/configure ; do - d=${d%/configure} - [[ -d ${S}/${d} ]] && die "${d} already exists in \${S}" - mv "${d}" "${S}" || die "moving ${d} failed" - done - fi - - # XXX: We should do the branchupdate, before extracting the manpages and - # infopages else it does not help much (mtimes change if there is a change - # to them with branchupdate) - if [[ -n ${BRANCH_UPDATE} ]] ; then - cd "${S}" - epatch "${DISTDIR}"/glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2 - - # Snapshot date patch - einfo "Patching version to display snapshot date ..." - sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h - fi - - if [[ -n ${MANPAGE_VER} ]] ; then - cd "${WORKDIR}" - unpack glibc-manpages-${MANPAGE_VER}.tar.bz2 - fi - - if [[ -n ${INFOPAGE_VER} ]] ; then - cd "${S}" - unpack glibc-infopages-${INFOPAGE_VER}.tar.bz2 - fi - - # tag, glibc is it - cd "${S}" - [[ -e csu/Banner ]] && die "need new banner location" - [[ -n ${SNAP_VER} ]] && echo "Gentoo snapshot ${SNAP_VER}" >> csu/Banner - [[ -n ${BRANCH_UPDATE} ]] && echo "Gentoo branch ${BRANCH_UPDATE}" >> csu/Banner - if [[ -n ${PATCH_VER} ]] && ! use vanilla ; then - cd "${S}" - EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER} ..." \ - EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \ - EPATCH_SUFFIX="patch" \ - ARCH=$(tc-arch) \ - epatch "${WORKDIR}"/patches - echo "Gentoo patchset ${PATCH_VER}" >> csu/Banner - fi - - if just_headers ; then - if [[ -e ports/sysdeps/mips/preconfigure ]] ; then - # mips peeps like to screw with us. if building headers, - # we don't have a real compiler, so we can't let them - # insert -mabi on us. - sed -i '/CPPFLAGS=.*-mabi/s|.*|:|' ports/sysdeps/mips/preconfigure || die - find ports/sysdeps/mips/ -name Makefile -exec sed -i '/^CC.*-mabi=/s:-mabi=.*:-D_MIPS_SZPTR=32:' {} + - fi - fi - - epatch_user - - gnuconfig_update -} - -eblit-glibc-src_unpack() { - setup_env - - toolchain-glibc_src_unpack - - # Glibc is stupid sometimes, and doesn't realize that with a - # static C-Only gcc, -lgcc_eh doesn't exist. - # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00100.html - # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html - # But! Finally fixed in recent versions: - # http://sourceware.org/ml/libc-alpha/2012-05/msg01865.html - if ! version_is_at_least 2.16 ; then - echo 'int main(){}' > "${T}"/gcc_eh_test.c - if ! $(tc-getCC ${CTARGET}) "${T}"/gcc_eh_test.c -lgcc_eh 2>/dev/null ; then - sed -i -e 's:-lgcc_eh::' Makeconfig || die "sed gcc_eh" - fi - fi - - cd "${WORKDIR}" - find . -type f '(' -size 0 -o -name "*.orig" ')' -exec rm -f {} \; - find . -name configure -exec touch {} \; - - # Fix permissions on some of the scripts - chmod u+x "${S}"/scripts/*.sh -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/local/glibc-2.14-file-mangle.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/local/glibc-2.14-file-mangle.patch deleted file mode 100644 index a78c154b2e..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/local/glibc-2.14-file-mangle.patch +++ /dev/null @@ -1,514 +0,0 @@ -Description: use PTR_MANGLE/PTR_DEMANGLE for FILE vtables. This adds inline - functions to run the PTR_MANGLE at vtable assignment time and PTR_DEMANGLE - at vtable dereference time so that the FILE structure's stored vtable - pointer is not in the clear on the heap. To make sure nothing accidentally - uses _IO_JUMPS or _IO_WIDE_JUMPS directly, the macros have been renamed to - include the _RAW suffix. -Author: Kees Cook - -diff -uNrp glibc-2.11.1~/debug/obprintf_chk.c glibc-2.11.1/debug/obprintf_chk.c ---- glibc-2.11.1~/debug/obprintf_chk.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/debug/obprintf_chk.c 2012-01-05 12:08:38.135675971 -0800 -@@ -56,7 +56,7 @@ __obstack_vprintf_chk (struct obstack *o - #endif - - _IO_no_init (&new_f.ofile.file.file, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&new_f.ofile.file) = &_IO_obstack_jumps; -+ _IO_JUMPS_SET (&new_f.ofile.file, &_IO_obstack_jumps); - room = obstack_room (obstack); - size = obstack_object_size (obstack) + room; - if (size == 0) -diff -uNrp glibc-2.11.1~/debug/vasprintf_chk.c glibc-2.11.1/debug/vasprintf_chk.c ---- glibc-2.11.1~/debug/vasprintf_chk.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/debug/vasprintf_chk.c 2012-01-05 12:08:38.135675971 -0800 -@@ -54,7 +54,7 @@ __vasprintf_chk (char **result_ptr, int - sf._sbf._f._lock = NULL; - #endif - _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&sf._sbf) = &_IO_str_jumps; -+ _IO_JUMPS_SET (&sf._sbf, &_IO_str_jumps); - _IO_str_init_static_internal (&sf, string, init_string_size, string); - sf._sbf._f._flags &= ~_IO_USER_BUF; - sf._s._allocate_buffer = (_IO_alloc_type) malloc; -diff -uNrp glibc-2.11.1~/debug/vdprintf_chk.c glibc-2.11.1/debug/vdprintf_chk.c ---- glibc-2.11.1~/debug/vdprintf_chk.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/debug/vdprintf_chk.c 2012-01-05 12:08:38.135675971 -0800 -@@ -40,7 +40,7 @@ __vdprintf_chk (int d, int flags, const - tmpfil.file._lock = NULL; - #endif - _IO_no_init (&tmpfil.file, _IO_USER_LOCK, 0, &wd, &_IO_wfile_jumps); -- _IO_JUMPS (&tmpfil) = &_IO_file_jumps; -+ _IO_JUMPS_SET (&tmpfil, &_IO_file_jumps); - INTUSE(_IO_file_init) (&tmpfil); - #if !_IO_UNIFIED_JUMPTABLES - tmpfil.vtable = NULL; -diff -uNrp glibc-2.11.1~/debug/vsnprintf_chk.c glibc-2.11.1/debug/vsnprintf_chk.c ---- glibc-2.11.1~/debug/vsnprintf_chk.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/debug/vsnprintf_chk.c 2012-01-05 12:08:38.135675971 -0800 -@@ -53,7 +53,7 @@ ___vsnprintf_chk (char *s, size_t maxlen - } - - _IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&sf.f._sbf) = &_IO_strn_jumps; -+ _IO_JUMPS_SET (&sf.f._sbf, &_IO_strn_jumps); - s[0] = '\0'; - - /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n -diff -uNrp glibc-2.11.1~/debug/vsprintf_chk.c glibc-2.11.1/debug/vsprintf_chk.c ---- glibc-2.11.1~/debug/vsprintf_chk.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/debug/vsprintf_chk.c 2012-01-05 12:08:38.135675971 -0800 -@@ -75,7 +75,7 @@ ___vsprintf_chk (char *s, int flags, siz - __chk_fail (); - - _IO_no_init (&f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&f._sbf) = &_IO_str_chk_jumps; -+ _IO_JUMPS_SET (&f._sbf, &_IO_str_chk_jumps); - s[0] = '\0'; - _IO_str_init_static_internal (&f, s, slen - 1, s); - -diff -uNrp glibc-2.11.1~/libio/fileops.c glibc-2.11.1/libio/fileops.c ---- glibc-2.11.1~/libio/fileops.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/fileops.c 2012-01-05 12:08:38.139676023 -0800 -@@ -464,8 +464,8 @@ _IO_file_setbuf_mmap (fp, p, len) - _IO_FILE *result; - - /* Change the function table. */ -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps; -- fp->_wide_data->_wide_vtable = &_IO_wfile_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_file_jumps); -+ _IO_WIDE_JUMPS_SET (fp, &_IO_wfile_jumps); - - /* And perform the normal operation. */ - result = _IO_new_file_setbuf (fp, p, len); -@@ -473,8 +473,8 @@ _IO_file_setbuf_mmap (fp, p, len) - /* If the call failed, restore to using mmap. */ - if (result == NULL) - { -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps_mmap; -- fp->_wide_data->_wide_vtable = &_IO_wfile_jumps_mmap; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_file_jumps_mmap); -+ _IO_WIDE_JUMPS_SET (fp, &_IO_wfile_jumps_mmap); - } - - return result; -@@ -713,10 +713,10 @@ mmap_remap_check (_IO_FILE *fp) - fp->_IO_buf_base = fp->_IO_buf_end = NULL; - _IO_setg (fp, NULL, NULL, NULL); - if (fp->_mode <= 0) -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_file_jumps); - else -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_wfile_jumps; -- fp->_wide_data->_wide_vtable = &_IO_wfile_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_wfile_jumps); -+ _IO_WIDE_JUMPS_SET (fp, &_IO_wfile_jumps); - - return 1; - } -@@ -793,10 +793,10 @@ decide_maybe_mmap (_IO_FILE *fp) - fp->_offset = st.st_size; - - if (fp->_mode <= 0) -- _IO_JUMPS ((struct _IO_FILE_plus *)fp) = &_IO_file_jumps_mmap; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *)fp, &_IO_file_jumps_mmap); - else -- _IO_JUMPS ((struct _IO_FILE_plus *)fp) = &_IO_wfile_jumps_mmap; -- fp->_wide_data->_wide_vtable = &_IO_wfile_jumps_mmap; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *)fp, &_IO_wfile_jumps_mmap); -+ _IO_WIDE_JUMPS_SET (fp, &_IO_wfile_jumps_mmap); - - return; - } -@@ -806,10 +806,10 @@ decide_maybe_mmap (_IO_FILE *fp) - /* We couldn't use mmap, so revert to the vanilla file operations. */ - - if (fp->_mode <= 0) -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_file_jumps); - else -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_wfile_jumps; -- fp->_wide_data->_wide_vtable = &_IO_wfile_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_wfile_jumps); -+ _IO_WIDE_JUMPS_SET (fp, &_IO_wfile_jumps); - } - - int -diff -uNrp glibc-2.11.1~/libio/freopen64.c glibc-2.11.1/libio/freopen64.c ---- glibc-2.11.1~/libio/freopen64.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/freopen64.c 2012-01-05 12:09:59.188744539 -0800 -@@ -51,9 +51,9 @@ freopen64 (filename, mode, fp) - ? fd_to_filename (fd) : filename); - fp->_flags2 |= _IO_FLAGS2_NOCLOSE; - INTUSE(_IO_file_close_it) (fp); -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_file_jumps); - if (_IO_vtable_offset (fp) == 0 && fp->_wide_data != NULL) -- fp->_wide_data->_wide_vtable = &_IO_wfile_jumps; -+ _IO_WIDE_JUMPS_SET (fp, &_IO_wfile_jumps); - result = INTUSE(_IO_file_fopen) (fp, gfilename, mode, 0); - fp->_flags2 &= ~_IO_FLAGS2_NOCLOSE; - if (result != NULL) -diff -uNrp glibc-2.11.1~/libio/freopen.c glibc-2.11.1/libio/freopen.c ---- glibc-2.11.1~/libio/freopen.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/freopen.c 2012-01-05 12:11:29.601936735 -0800 -@@ -59,16 +59,16 @@ freopen (filename, mode, fp) - to the old libio may be passed into shared C library and wind - up here. */ - _IO_old_file_close_it (fp); -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_old_file_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_old_file_jumps); - result = _IO_old_file_fopen (fp, gfilename, mode); - } - else - #endif - { - INTUSE(_IO_file_close_it) (fp); -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_file_jumps); - if (_IO_vtable_offset (fp) == 0 && fp->_wide_data != NULL) -- fp->_wide_data->_wide_vtable = &_IO_wfile_jumps; -+ _IO_WIDE_JUMPS_SET (fp, &_IO_wfile_jumps); - result = INTUSE(_IO_file_fopen) (fp, gfilename, mode, 1); - if (result != NULL) - result = __fopen_maybe_mmap (result); -diff -uNrp glibc-2.11.1~/libio/genops.c glibc-2.11.1/libio/genops.c ---- glibc-2.11.1~/libio/genops.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/genops.c 2012-01-05 12:08:38.139676023 -0800 -@@ -664,7 +664,7 @@ _IO_no_init (fp, flags, orientation, wd, - fp->_wide_data->_IO_backup_base = NULL; - fp->_wide_data->_IO_save_end = NULL; - -- fp->_wide_data->_wide_vtable = jmp; -+ _IO_WIDE_JUMPS_SET (fp, jmp); - } - #endif - fp->_freeres_list = NULL; -diff -uNrp glibc-2.11.1~/libio/iofdopen.c glibc-2.11.1/libio/iofdopen.c ---- glibc-2.11.1~/libio/iofdopen.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/iofdopen.c 2012-01-05 12:08:38.139676023 -0800 -@@ -154,11 +154,11 @@ _IO_new_fdopen (fd, mode) - ? &_IO_wfile_jumps_maybe_mmap : - #endif - &_IO_wfile_jumps); -- _IO_JUMPS (&new_f->fp) = -+ _IO_JUMPS_SET (&new_f->fp, - #ifdef _G_HAVE_MMAP - (use_mmap && (read_write & _IO_NO_WRITES)) ? &_IO_file_jumps_maybe_mmap : - #endif -- &_IO_file_jumps; -+ &_IO_file_jumps); - INTUSE(_IO_file_init) (&new_f->fp); - #if !_IO_UNIFIED_JUMPTABLES - new_f->fp.vtable = NULL; -diff -uNrp glibc-2.11.1~/libio/iofopen.c glibc-2.11.1/libio/iofopen.c ---- glibc-2.11.1~/libio/iofopen.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/iofopen.c 2012-01-05 12:08:38.139676023 -0800 -@@ -50,10 +50,10 @@ __fopen_maybe_mmap (fp) - vanilla file operations and reset the jump table accordingly. */ - - if (fp->_mode <= 0) -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps_maybe_mmap; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_file_jumps_maybe_mmap); - else -- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_wfile_jumps_maybe_mmap; -- fp->_wide_data->_wide_vtable = &_IO_wfile_jumps_maybe_mmap; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) fp, &_IO_wfile_jumps_maybe_mmap); -+ _IO_WIDE_JUMPS_SET (fp, &_IO_wfile_jumps_maybe_mmap); - } - #endif - return fp; -@@ -85,7 +85,7 @@ __fopen_internal (filename, mode, is32) - #else - _IO_no_init (&new_f->fp.file, 1, 0, NULL, NULL); - #endif -- _IO_JUMPS (&new_f->fp) = &_IO_file_jumps; -+ _IO_JUMPS_SET (&new_f->fp, &_IO_file_jumps); - INTUSE(_IO_file_init) (&new_f->fp); - #if !_IO_UNIFIED_JUMPTABLES - new_f->fp.vtable = NULL; -diff -uNrp glibc-2.11.1~/libio/iofopncook.c glibc-2.11.1/libio/iofopncook.c ---- glibc-2.11.1~/libio/iofopncook.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/iofopncook.c 2012-01-05 12:08:38.139676023 -0800 -@@ -147,7 +147,7 @@ _IO_cookie_init (struct _IO_cookie_file - void *cookie, _IO_cookie_io_functions_t io_functions) - { - INTUSE(_IO_init) (&cfile->__fp.file, 0); -- _IO_JUMPS (&cfile->__fp) = &_IO_cookie_jumps; -+ _IO_JUMPS_SET (&cfile->__fp, &_IO_cookie_jumps); - - cfile->__cookie = cookie; - cfile->__io_functions = io_functions; -@@ -272,7 +272,7 @@ _IO_old_fopencookie (cookie, mode, io_fu - - ret = _IO_fopencookie (cookie, mode, io_functions); - if (ret != NULL) -- _IO_JUMPS ((struct _IO_FILE_plus *) ret) = &_IO_old_cookie_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) ret, &_IO_old_cookie_jumps); - - return ret; - } -diff -uNrp glibc-2.11.1~/libio/iopopen.c glibc-2.11.1/libio/iopopen.c ---- glibc-2.11.1~/libio/iopopen.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/iopopen.c 2012-01-05 12:08:38.139676023 -0800 -@@ -304,7 +304,7 @@ _IO_new_popen (command, mode) - #endif - fp = &new_f->fpx.file.file; - INTUSE(_IO_init) (fp, 0); -- _IO_JUMPS (&new_f->fpx.file) = &_IO_proc_jumps; -+ _IO_JUMPS_SET (&new_f->fpx.file, &_IO_proc_jumps); - _IO_new_file_init (&new_f->fpx.file); - #if !_IO_UNIFIED_JUMPTABLES - new_f->fpx.file.vtable = NULL; -diff -uNrp glibc-2.11.1~/libio/iovdprintf.c glibc-2.11.1/libio/iovdprintf.c ---- glibc-2.11.1~/libio/iovdprintf.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/iovdprintf.c 2012-01-05 12:08:38.139676023 -0800 -@@ -43,7 +43,7 @@ _IO_vdprintf (d, format, arg) - tmpfil.file._lock = NULL; - #endif - _IO_no_init (&tmpfil.file, _IO_USER_LOCK, 0, &wd, &_IO_wfile_jumps); -- _IO_JUMPS (&tmpfil) = &_IO_file_jumps; -+ _IO_JUMPS_SET (&tmpfil, &_IO_file_jumps); - INTUSE(_IO_file_init) (&tmpfil); - #if !_IO_UNIFIED_JUMPTABLES - tmpfil.vtable = NULL; -diff -uNrp glibc-2.11.1~/libio/iovsprintf.c glibc-2.11.1/libio/iovsprintf.c ---- glibc-2.11.1~/libio/iovsprintf.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/iovsprintf.c 2012-01-05 12:08:38.139676023 -0800 -@@ -38,7 +38,7 @@ __IO_vsprintf (char *string, const char - sf._sbf._f._lock = NULL; - #endif - _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&sf._sbf) = &_IO_str_jumps; -+ _IO_JUMPS_SET (&sf._sbf, &_IO_str_jumps); - _IO_str_init_static_internal (&sf, string, -1, string); - ret = INTUSE(_IO_vfprintf) (&sf._sbf._f, format, args); - _IO_putc_unlocked ('\0', &sf._sbf._f); -diff -uNrp glibc-2.11.1~/libio/iovsscanf.c glibc-2.11.1/libio/iovsscanf.c ---- glibc-2.11.1~/libio/iovsscanf.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/iovsscanf.c 2012-01-05 12:08:38.139676023 -0800 -@@ -40,7 +40,7 @@ _IO_vsscanf (string, format, args) - sf._sbf._f._lock = NULL; - #endif - _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&sf._sbf) = &_IO_str_jumps; -+ _IO_JUMPS_SET (&sf._sbf, &_IO_str_jumps); - _IO_str_init_static_internal (&sf, (char*)string, 0, NULL); - ret = INTUSE(_IO_vfscanf) (&sf._sbf._f, format, args, NULL); - return ret; -diff -uNrp glibc-2.11.1~/libio/libioP.h glibc-2.11.1/libio/libioP.h ---- glibc-2.11.1~/libio/libioP.h 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/libioP.h 2012-01-05 12:13:24.243448752 -0800 -@@ -74,11 +74,11 @@ extern "C" { - * The _IO_FILE type is used to implement the FILE type in GNU libc, - * as well as the streambuf class in GNU iostreams for C++. - * These are all the same, just used differently. -- * An _IO_FILE (or FILE) object is allows followed by a pointer to -- * a jump table (of pointers to functions). The pointer is accessed -- * with the _IO_JUMPS macro. The jump table has a eccentric format, -- * so as to be compatible with the layout of a C++ virtual function table. -- * (as implemented by g++). When a pointer to a streambuf object is -+ * An _IO_FILE (or FILE) object is allows followed by a pointer to a jump -+ * table (of pointers to functions). The pointer is accessed with the -+ * _IO_JUMPS_SET and _IO_JUMPS_FUNC macros. The jump table has a eccentric -+ * format, so as to be compatible with the layout of a C++ virtual function -+ * table (as implemented by g++). When a pointer to a streambuf object is - * coerced to an (_IO_FILE*), then _IO_JUMPS on the result just - * happens to point to the virtual function table of the streambuf. - * Thus the _IO_JUMPS function table used for C stdio/libio does -@@ -105,20 +105,40 @@ extern "C" { - # define _IO_JUMPS_OFFSET 1 - #endif - --#define _IO_JUMPS(THIS) (THIS)->vtable --#define _IO_WIDE_JUMPS(THIS) ((struct _IO_FILE *) (THIS))->_wide_data->_wide_vtable -+static inline void -+__mangle_vtable(const struct _IO_jump_t **vtable, const struct _IO_jump_t *table) -+{ -+ struct _IO_jump_t *ptr; -+ ptr = (struct _IO_jump_t *)table; -+ PTR_MANGLE(ptr); -+ *vtable = ptr; -+} -+ -+#define _IO_JUMPS_RAW(THIS) (THIS)->vtable -+#define _IO_JUMPS_SET(THIS, TABLE) __mangle_vtable(&_IO_JUMPS_RAW(THIS), (TABLE)) -+#define _IO_WIDE_JUMPS_RAW(THIS) ((struct _IO_FILE *) (THIS))->_wide_data->_wide_vtable -+#define _IO_WIDE_JUMPS_SET(THIS, TABLE) __mangle_vtable(&_IO_WIDE_JUMPS_RAW(THIS), (TABLE)) - #define _IO_CHECK_WIDE(THIS) (((struct _IO_FILE *) (THIS))->_wide_data != NULL) - -+static inline const struct _IO_jump_t * -+__demangle_vtable(const struct _IO_jump_t *vtable) -+{ -+ struct _IO_jump_t *ptr; -+ ptr = (struct _IO_jump_t *)vtable; -+ PTR_DEMANGLE(ptr); -+ return (const struct _IO_jump_t *)ptr; -+} -+ - #if _IO_JUMPS_OFFSET --# define _IO_JUMPS_FUNC(THIS) \ -- (*(struct _IO_jump_t **) ((void *) &_IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) \ -- + (THIS)->_vtable_offset)) -+# define _IO_JUMPS_FUNC(THIS) __demangle_vtable (\ -+ (*(struct _IO_jump_t **) ((void *) &_IO_JUMPS_RAW ((struct _IO_FILE_plus *) (THIS)) \ -+ + (THIS)->_vtable_offset))) - # define _IO_vtable_offset(THIS) (THIS)->_vtable_offset - #else --# define _IO_JUMPS_FUNC(THIS) _IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) -+# define _IO_JUMPS_FUNC(THIS) __demangle_vtable (_IO_JUMPS_RAW ((struct _IO_FILE_plus *) (THIS))) - # define _IO_vtable_offset(THIS) 0 - #endif --#define _IO_WIDE_JUMPS_FUNC(THIS) _IO_WIDE_JUMPS(THIS) -+#define _IO_WIDE_JUMPS_FUNC(THIS) __demangle_vtable (_IO_WIDE_JUMPS_RAW(THIS)) - #ifdef _G_USING_THUNKS - # define JUMP_FIELD(TYPE, NAME) TYPE NAME - # define JUMP0(FUNC, THIS) (_IO_JUMPS_FUNC(THIS)->FUNC) (THIS) -diff -uNrp glibc-2.11.1~/libio/memstream.c glibc-2.11.1/libio/memstream.c ---- glibc-2.11.1~/libio/memstream.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/memstream.c 2012-01-05 12:08:38.139676023 -0800 -@@ -87,7 +87,7 @@ open_memstream (bufloc, sizeloc) - if (buf == NULL) - return NULL; - INTUSE(_IO_init) (&new_f->fp._sf._sbf._f, 0); -- _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp._sf._sbf) = &_IO_mem_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) &new_f->fp._sf._sbf, &_IO_mem_jumps); - _IO_str_init_static_internal (&new_f->fp._sf, buf, _IO_BUFSIZ, buf); - new_f->fp._sf._sbf._f._flags &= ~_IO_USER_BUF; - new_f->fp._sf._s._allocate_buffer = (_IO_alloc_type) malloc; -diff -uNrp glibc-2.11.1~/libio/obprintf.c glibc-2.11.1/libio/obprintf.c ---- glibc-2.11.1~/libio/obprintf.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/obprintf.c 2012-01-05 12:08:38.139676023 -0800 -@@ -136,7 +136,7 @@ _IO_obstack_vprintf (struct obstack *obs - #endif - - _IO_no_init (&new_f.ofile.file.file, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&new_f.ofile.file) = &_IO_obstack_jumps; -+ _IO_JUMPS_SET (&new_f.ofile.file, &_IO_obstack_jumps); - room = obstack_room (obstack); - size = obstack_object_size (obstack) + room; - if (size == 0) -diff -uNrp glibc-2.11.1~/libio/oldiofdopen.c glibc-2.11.1/libio/oldiofdopen.c ---- glibc-2.11.1~/libio/oldiofdopen.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/oldiofdopen.c 2012-01-05 12:08:38.139676023 -0800 -@@ -117,7 +117,7 @@ _IO_old_fdopen (fd, mode) - new_f->fp.file._file._lock = &new_f->lock; - #endif - _IO_old_init (&new_f->fp.file._file, 0); -- _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp) = &_IO_old_file_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) &new_f->fp, &_IO_old_file_jumps); - _IO_old_file_init ((struct _IO_FILE_plus *) &new_f->fp); - #if !_IO_UNIFIED_JUMPTABLES - new_f->fp.vtable = NULL; -diff -uNrp glibc-2.11.1~/libio/oldiofopen.c glibc-2.11.1/libio/oldiofopen.c ---- glibc-2.11.1~/libio/oldiofopen.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/oldiofopen.c 2012-01-05 12:08:38.139676023 -0800 -@@ -56,7 +56,7 @@ _IO_old_fopen (filename, mode) - new_f->fp.file._file._lock = &new_f->lock; - #endif - _IO_old_init (&new_f->fp.file._file, 0); -- _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp) = &_IO_old_file_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) &new_f->fp, &_IO_old_file_jumps); - _IO_old_file_init ((struct _IO_FILE_plus *) &new_f->fp); - #if !_IO_UNIFIED_JUMPTABLES - new_f->fp.vtable = NULL; -diff -uNrp glibc-2.11.1~/libio/oldiopopen.c glibc-2.11.1/libio/oldiopopen.c ---- glibc-2.11.1~/libio/oldiopopen.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/oldiopopen.c 2012-01-05 12:08:38.139676023 -0800 -@@ -225,7 +225,7 @@ _IO_old_popen (command, mode) - #endif - fp = &new_f->fpx.file.file._file; - _IO_old_init (fp, 0); -- _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fpx.file) = &_IO_old_proc_jumps; -+ _IO_JUMPS_SET ((struct _IO_FILE_plus *) &new_f->fpx.file, &_IO_old_proc_jumps); - _IO_old_file_init ((struct _IO_FILE_plus *) &new_f->fpx.file); - #if !_IO_UNIFIED_JUMPTABLES - new_f->fpx.file.vtable = NULL; -diff -uNrp glibc-2.11.1~/libio/vasprintf.c glibc-2.11.1/libio/vasprintf.c ---- glibc-2.11.1~/libio/vasprintf.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/vasprintf.c 2012-01-05 12:08:38.139676023 -0800 -@@ -56,7 +56,7 @@ _IO_vasprintf (result_ptr, format, args) - sf._sbf._f._lock = NULL; - #endif - _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&sf._sbf) = &_IO_str_jumps; -+ _IO_JUMPS_SET (&sf._sbf, &_IO_str_jumps); - _IO_str_init_static_internal (&sf, string, init_string_size, string); - sf._sbf._f._flags &= ~_IO_USER_BUF; - sf._s._allocate_buffer = (_IO_alloc_type) malloc; -diff -uNrp glibc-2.11.1~/libio/vsnprintf.c glibc-2.11.1/libio/vsnprintf.c ---- glibc-2.11.1~/libio/vsnprintf.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/libio/vsnprintf.c 2012-01-05 12:08:38.139676023 -0800 -@@ -114,7 +114,7 @@ _IO_vsnprintf (string, maxlen, format, a - } - - _IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&sf.f._sbf) = &_IO_strn_jumps; -+ _IO_JUMPS_SET (&sf.f._sbf, &_IO_strn_jumps); - string[0] = '\0'; - _IO_str_init_static_internal (&sf.f, string, maxlen - 1, string); - ret = INTUSE(_IO_vfprintf) (&sf.f._sbf._f, format, args); -diff -uNrp glibc-2.11.1~/misc/init-misc.c glibc-2.11.1/misc/init-misc.c ---- glibc-2.11.1~/misc/init-misc.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/misc/init-misc.c 2012-01-05 12:13:44.995722496 -0800 -@@ -17,7 +17,11 @@ - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -+#include "libioP.h" -+ - #include -+#include -+#include - #include - - char *__progname_full = (char *) ""; -@@ -38,4 +42,13 @@ __init_misc (int argc, char **argv, char - __progname = p + 1; - __progname_full = argv[0]; - } -+ -+ PTR_MANGLE (_IO_JUMPS_RAW ((struct _IO_FILE_plus *)stdin)); -+ PTR_MANGLE (_IO_WIDE_JUMPS_RAW (stdin)); -+ -+ PTR_MANGLE (_IO_JUMPS_RAW ((struct _IO_FILE_plus *)stdout)); -+ PTR_MANGLE (_IO_WIDE_JUMPS_RAW (stdout)); -+ -+ PTR_MANGLE (_IO_JUMPS_RAW ((struct _IO_FILE_plus *)stderr)); -+ PTR_MANGLE (_IO_WIDE_JUMPS_RAW (stderr)); - } -diff -uNrp glibc-2.11.1~/stdio-common/isoc99_vsscanf.c glibc-2.11.1/stdio-common/isoc99_vsscanf.c ---- glibc-2.11.1~/stdio-common/isoc99_vsscanf.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/stdio-common/isoc99_vsscanf.c 2012-01-05 12:08:38.139676023 -0800 -@@ -38,7 +38,7 @@ __isoc99_vsscanf (const char *string, co - sf._sbf._f._lock = NULL; - #endif - _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); -- _IO_JUMPS (&sf._sbf) = &_IO_str_jumps; -+ _IO_JUMPS_SET (&sf._sbf, &_IO_str_jumps); - _IO_str_init_static_internal (&sf, (char*)string, 0, NULL); - sf._sbf._f._flags2 |= _IO_FLAGS2_SCANF_STD; - ret = INTUSE(_IO_vfscanf) (&sf._sbf._f, format, args, NULL); -diff -uNrp glibc-2.11.1~/stdio-common/vfprintf.c glibc-2.11.1/stdio-common/vfprintf.c ---- glibc-2.11.1~/stdio-common/vfprintf.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/stdio-common/vfprintf.c 2012-01-05 12:08:38.139676023 -0800 -@@ -2224,7 +2224,7 @@ buffered_vfprintf (register _IO_FILE *s, - hp->_lock = NULL; - #endif - hp->_flags2 = s->_flags2; -- _IO_JUMPS (&helper._f) = (struct _IO_jump_t *) &_IO_helper_jumps; -+ _IO_JUMPS_SET (&helper._f, (struct _IO_jump_t *) &_IO_helper_jumps); - - /* Now print to helper instead. */ - #ifndef COMPILE_WPRINTF -diff -uNrp glibc-2.11.1~/stdlib/strfmon_l.c glibc-2.11.1/stdlib/strfmon_l.c ---- glibc-2.11.1~/stdlib/strfmon_l.c 2009-12-08 12:10:20.000000000 -0800 -+++ glibc-2.11.1/stdlib/strfmon_l.c 2012-01-05 12:08:38.143676076 -0800 -@@ -517,7 +517,7 @@ __vstrfmon_l (char *s, size_t maxsize, _ - f._sbf._f._lock = NULL; - #endif - INTUSE(_IO_init) (&f._sbf._f, 0); -- _IO_JUMPS (&f._sbf) = &_IO_str_jumps; -+ _IO_JUMPS_SET (&f._sbf, &_IO_str_jumps); - INTUSE(_IO_str_init_static) (&f, dest, - (s + maxsize) - dest, dest); - /* We clear the last available byte so we can find out whether diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/local/glibc-2.15-arm-memcpy.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/local/glibc-2.15-arm-memcpy.patch deleted file mode 100644 index 420d8c0fb4..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/local/glibc-2.15-arm-memcpy.patch +++ /dev/null @@ -1,370 +0,0 @@ ---- ports/sysdeps/arm/eabi/armv7/memcpy.S -+++ ports/sysdeps/arm/eabi/armv7/memcpy.S 2012-08-02 15:59:19.932220525 -0700 -@@ -0,0 +1,367 @@ -+/* -+This version of memcpy for arm is from the newlib. -+http://sourceware.org/newlib/ -+*/ -+#include -+ -+ .text -+ -+/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */ -+ -+ENTRY(memcpy) -+ -+ /* Assumes that n >= 0, and dst, src are valid pointers. -+ If there is at least 8 bytes to copy, use LDRD/STRD. -+ If src and dst are misaligned with different offsets, -+ first copy byte by byte until dst is aligned, -+ and then copy using LDRD/STRD and shift if needed. -+ When less than 8 left, copy a word and then byte by byte. */ -+ -+ /* Save registers (r0 holds the return value): -+ optimized push {r0, r4, r5, lr}. -+ To try and improve performance, stack layout changed, -+ i.e., not keeping the stack looking like users expect -+ (highest numbered register at highest address). */ -+ push {r0, lr} -+ strd r4, r5, [sp, #-8]! -+ -+ /* TODO: Add debug frame directives. -+ We don't need exception unwind directives, because the code below -+ does not throw any exceptions and does not call any other functions. -+ Generally, newlib functions like this lack debug information for -+ assembler source. */ -+ -+ /* Get copying of tiny blocks out of the way first. */ -+ /* Is there at least 4 bytes to copy? */ -+ subs r2, r2, #4 -+ blt copy_less_than_4 /* If n < 4. */ -+ -+ /* Check word alignment. */ -+ ands ip, r0, #3 /* ip = last 2 bits of dst. */ -+ bne dst_not_word_aligned /* If dst is not word-aligned. */ -+ -+ /* Get here if dst is word-aligned. */ -+ ands ip, r1, #3 /* ip = last 2 bits of src. */ -+ bne src_not_word_aligned /* If src is not word-aligned. */ -+word_aligned: -+ /* Get here if source and dst both are word-aligned. -+ The number of bytes remaining to copy is r2+4. */ -+ -+ /* Is there is at least 64 bytes to copy? */ -+ subs r2, r2, #60 -+ blt copy_less_than_64 /* If r2 + 4 < 64. */ -+ -+ /* First, align the destination buffer to 8-bytes, -+ to make sure double loads and stores don't cross cache line boundary, -+ as they are then more expensive even if the data is in the cache -+ (require two load/store issue cycles instead of one). -+ If only one of the buffers is not 8-bytes aligned, -+ then it's more important to align dst than src, -+ because there is more penalty for stores -+ than loads that cross cacheline boundary. -+ This check and realignment are only worth doing -+ if there is a lot to copy. */ -+ -+ /* Get here if dst is word aligned, -+ i.e., the 2 least significant bits are 0. -+ If dst is not 2w aligned (i.e., the 3rd bit is not set in dst), -+ then copy 1 word (4 bytes). */ -+ ands r3, r0, #4 -+ beq 11f /* If dst already two-word aligned. */ -+ ldr r3, [r1], #4 -+ str r3, [r0], #4 -+ subs r2, r2, #4 -+ blt copy_less_than_64 -+ -+11: -+ /* TODO: Align to cacheline (useful for PLD optimization). */ -+ -+ /* Every loop iteration copies 64 bytes. */ -+1: -+ .irp offset, #0, #8, #16, #24, #32, #40, #48, #56 -+ ldrd r4, r5, [r1, \offset] -+ strd r4, r5, [r0, \offset] -+ .endr -+ -+ add r0, r0, #64 -+ add r1, r1, #64 -+ subs r2, r2, #64 -+ bge 1b /* If there is more to copy. */ -+ -+copy_less_than_64: -+ -+ /* Get here if less than 64 bytes to copy, -64 <= r2 < 0. -+ Restore the count if there is more than 7 bytes to copy. */ -+ adds r2, r2, #56 -+ blt copy_less_than_8 -+ -+ /* Copy 8 bytes at a time. */ -+2: -+ ldrd r4, r5, [r1], #8 -+ strd r4, r5, [r0], #8 -+ subs r2, r2, #8 -+ bge 2b /* If there is more to copy. */ -+ -+copy_less_than_8: -+ -+ /* Get here if less than 8 bytes to copy, -8 <= r2 < 0. -+ Check if there is more to copy. */ -+ cmn r2, #8 -+ beq return /* If r2 + 8 == 0. */ -+ -+ /* Restore the count if there is more than 3 bytes to copy. */ -+ adds r2, r2, #4 -+ blt copy_less_than_4 -+ -+ /* Copy 4 bytes. */ -+ ldr r3, [r1], #4 -+ str r3, [r0], #4 -+ -+copy_less_than_4: -+ /* Get here if less than 4 bytes to copy, -4 <= r2 < 0. */ -+ -+ /* Restore the count, check if there is more to copy. */ -+ adds r2, r2, #4 -+ beq return /* If r2 == 0. */ -+ -+ /* Get here with r2 is in {1,2,3}={01,10,11}. */ -+ /* Logical shift left r2, insert 0s, update flags. */ -+ lsls r2, r2, #31 -+ -+ /* Copy byte by byte. -+ Condition ne means the last bit of r2 is 0. -+ Condition cs means the second to last bit of r2 is set, -+ i.e., r2 is 1 or 3. */ -+ ldrneb r3, [r1], #1 -+ ldrcsb r4, [r1], #1 -+ ldrcsb ip, [r1] -+ strneb r3, [r0], #1 -+ strcsb r4, [r0], #1 -+ strcsb ip, [r0] -+ -+ -+return: -+ /* Restore registers: optimized pop {r0, r4, r5, pc} */ -+ ldrd r4, r5, [sp], #8 -+ pop {r0, pc} /* This is the only return point of memcpy. */ -+ -+#ifndef __ARM_FEATURE_UNALIGNED -+ -+ /* The following assembly macro implements misaligned copy in software. -+ Assumes that dst is word aligned, src is at offset "pull" bits from -+ word, push = 32 - pull, and the number of bytes that remain to copy -+ is r2 + 4, r2 >= 0. */ -+ -+ /* In the code below, r2 is the number of bytes that remain to be -+ written. The number of bytes read is always larger, because we have -+ partial words in the shift queue. */ -+ -+ .macro miscopy pull push shiftleft shiftright -+ -+ /* Align src to the previous word boundary. */ -+ bic r1, r1, #3 -+ -+ /* Initialize the shift queue. */ -+ ldr r5, [r1], #4 /* Load a word from source. */ -+ -+ subs r2, r2, #4 -+ blt 6f /* Go to misaligned copy of less than 8 bytes. */ -+ -+ /* Get here if there is more than 8 bytes to copy. -+ The number of bytes to copy is r2+8, r2 >= 0. */ -+ -+ /* Save registers: push { r6, r7 }. -+ We need additional registers for LDRD and STRD, because in ARM state -+ the first destination register must be even and the second -+ consecutive. */ -+ strd r6, r7, [sp, #-8]! -+ -+ subs r2, r2, #56 -+ blt 4f /* Go to misaligned copy of less than 64 bytes. */ -+ -+3: -+ /* Get here if there is more than 64 bytes to copy. -+ The number of bytes to copy is r2+64, r2 >= 0. */ -+ -+ /* Copy 64 bytes in every iteration. -+ Use a partial word from the shift queue. */ -+ .irp offset, #0, #8, #16, #24, #32, #40, #48, #56 -+ mov r6, r5, \shiftleft #\pull -+ ldrd r4, r5, [r1, \offset] -+ orr r6, r6, r4, \shiftright #\push -+ mov r7, r4, \shiftleft #\pull -+ orr r7, r7, r5, \shiftright #\push -+ strd r6, r7, [r0, \offset] -+ .endr -+ -+ add r1, r1, #64 -+ add r0, r0, #64 -+ subs r2, r2, #64 -+ bge 3b -+ -+4: -+ /* Get here if there is less than 64 bytes to copy (-64 <= r2 < 0) -+ and they are misaligned. */ -+ -+ /* Restore the count if there is more than 7 bytes to copy. */ -+ adds r2, r2, #56 -+ -+ /* If less than 8 bytes to copy, -+ restore registers saved for this loop: optimized poplt { r6, r7 }. */ -+ itt lt -+ ldrltd r6, r7, [sp], #8 -+ blt 6f /* Go to misaligned copy of less than 8 bytes. */ -+ -+5: -+ /* Copy 8 bytes at a time. -+ Use a partial word from the shift queue. */ -+ mov r6, r5, \shiftleft #\pull -+ ldrd r4, r5, [r1], #8 -+ orr r6, r6, r4, \shiftright #\push -+ mov r7, r4, \shiftleft #\pull -+ orr r7, r7, r5, \shiftright #\push -+ strd r6, r7, [r0], #8 -+ -+ subs r2, r2, #8 -+ bge 5b /* If there is more to copy. */ -+ -+ /* Restore registers saved for this loop: optimized pop { r6, r7 }. */ -+ ldrd r6, r7, [sp], #8 -+ -+6: -+ /* Get here if there less than 8 bytes to copy (-8 <= r2 < 0) -+ and they are misaligned. */ -+ -+ /* Check if there is more to copy. */ -+ cmn r2, #8 -+ beq return -+ -+ /* Check if there is less than 4 bytes to copy. */ -+ cmn r2, #4 -+ -+ itt lt -+ /* Restore src offset from word-align. */ -+ sublt r1, r1, #(\push / 8) -+ blt copy_less_than_4 -+ -+ /* Use a partial word from the shift queue. */ -+ mov r3, r5, \shiftleft #\pull -+ /* Load a word from src, but without writeback -+ (this word is not fully written to dst). */ -+ ldr r5, [r1] -+ -+ /* Restore src offset from word-align. */ -+ add r1, r1, #(\pull / 8) -+ -+ /* Shift bytes to create one dst word and store it. */ -+ orr r3, r3, r5, \shiftright #\push -+ str r3, [r0], #4 -+ -+ /* Use single byte copying of the remaining bytes. */ -+ b copy_less_than_4 -+ -+ .endm -+ -+#endif /* not __ARM_FEATURE_UNALIGNED */ -+ -+dst_not_word_aligned: -+ -+ /* Get here when dst is not aligned and ip has the last 2 bits of dst, -+ i.e., ip is the offset of dst from word. -+ The number of bytes that remains to copy is r2 + 4, -+ i.e., there are at least 4 bytes to copy. -+ Write a partial word (0 to 3 bytes), such that dst becomes -+ word-aligned. */ -+ -+ /* If dst is at ip bytes offset from a word (with 0 < ip < 4), -+ then there are (4 - ip) bytes to fill up to align dst to the next -+ word. */ -+ rsb ip, ip, #4 /* ip = #4 - ip. */ -+ cmp ip, #2 -+ -+ /* Copy byte by byte with conditionals. */ -+ ldrgtb r3, [r1], #1 -+ ldrgeb r4, [r1], #1 -+ ldrb lr, [r1], #1 -+ strgtb r3, [r0], #1 -+ strgeb r4, [r0], #1 -+ subs r2, r2, ip -+ strb lr, [r0], #1 -+ /* Update the count. -+ ip holds the number of bytes we have just copied. */ -+ /*subs r2, r2, ip /* r2 = r2 - ip. */ -+ blt copy_less_than_4 /* If r2 < ip. */ -+ -+ /* Get here if there are more than 4 bytes to copy. -+ Check if src is aligned. If beforehand src and dst were not word -+ aligned but congruent (same offset), then now they are both -+ word-aligned, and we can copy the rest efficiently (without -+ shifting). */ -+ ands ip, r1, #3 /* ip = last 2 bits of src. */ -+ beq word_aligned /* If r1 is word-aligned. */ -+ -+src_not_word_aligned: -+ /* Get here when src is not word-aligned, but dst is word-aligned. -+ The number of bytes that remains to copy is r2+4. */ -+ -+#ifdef __ARM_FEATURE_UNALIGNED -+ /* Copy word by word using LDR when alignment can be done in hardware, -+ i.e., SCTLR.A is set, supporting unaligned access in LDR and STR. */ -+ subs r2, r2, #60 -+ blt 8f -+ -+7: -+ /* Copy 64 bytes in every loop iteration. */ -+ .irp offset, #0, #4, #8, #12, #16, #20, #24, #28, #32, #36, #40, #44, #48, #52, #56, #60 -+ ldr r3, [r1, \offset] -+ str r3, [r0, \offset] -+ .endr -+ -+ add r0, r0, #64 -+ add r1, r1, #64 -+ subs r2, r2, #64 -+ bge 7b -+ -+8: -+ /* Get here if less than 64 bytes to copy, -64 <= r2 < 0. -+ Check if there is more than 3 bytes to copy. */ -+ adds r2, r2, #60 -+ blt copy_less_than_4 -+ -+9: -+ /* Get here if there is less than 64 but at least 4 bytes to copy, -+ where the number of bytes to copy is r2+4. */ -+ ldr r3, [r1], #4 -+ str r3, [r0], #4 -+ subs r2, r2, #4 -+ bge 9b -+ -+ b copy_less_than_4 -+ -+#else /* not __ARM_FEATURE_UNALIGNED */ -+ -+ /* ip has last 2 bits of src, -+ i.e., ip is the offset of src from word, and ip > 0. -+ Compute shifts needed to copy from src to dst. */ -+ cmp ip, #2 -+ beq miscopy_16_16 /* If ip == 2. */ -+ bge miscopy_24_8 /* If ip == 3. */ -+ -+ /* Get here if ip == 1. */ -+ -+ /* Endian independent macros for shifting bytes within registers. */ -+ -+#ifndef __ARMEB__ -+miscopy_8_24: miscopy pull=8 push=24 shiftleft=lsr shiftright=lsl -+miscopy_16_16: miscopy pull=16 push=16 shiftleft=lsr shiftright=lsl -+miscopy_24_8: miscopy pull=24 push=8 shiftleft=lsr shiftright=lsl -+#else /* not __ARMEB__ */ -+miscopy_8_24: miscopy pull=8 push=24 shiftleft=lsl shiftright=lsr -+miscopy_16_16: miscopy pull=16 push=16 shiftleft=lsl shiftright=lsr -+miscopy_24_8: miscopy pull=24 push=8 shiftleft=lsl shiftright=lsr -+#endif /* not __ARMEB__ */ -+ -+#endif /* not __ARM_FEATURE_UNALIGNED */ -+ -+END(memcpy) -+libc_hidden_builtin_def (memcpy) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.15-r5.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.15-r5.ebuild deleted file mode 100644 index fb6d29cd54..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.15-r5.ebuild +++ /dev/null @@ -1,273 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.15-r2.ebuild,v 1.1 2012/05/18 05:04:44 vapier Exp $ - -inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib unpacker binutils-funcs - -DESCRIPTION="GNU libc6 (also called glibc2) C library" -HOMEPAGE="http://www.gnu.org/software/libc/libc.html" - -LICENSE="LGPL-2" -KEYWORDS="amd64 arm ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc x86" -RESTRICT="strip" # strip ourself #46186 -EMULTILIB_PKG="true" - -# Configuration variables -RELEASE_VER="" -BRANCH_UPDATE="" -SNAP_VER="" -case ${PV} in -9999*) - EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" ) - EGIT_SOURCEDIRS=( "${S}" "${S}/ports" ) - inherit git-2 - ;; -*_p*) - RELEASE_VER=${PV%_p*} - SNAP_VER=${PV#*_p} - ;; -*) - RELEASE_VER=${PV} - ;; -esac -MANPAGE_VER="" # pregenerated manpages -INFOPAGE_VER="" # pregenerated infopages -LIBIDN_VER="" # it's integrated into the main tarball now -PATCH_VER="22" # Gentoo patchset -PORTS_VER=${RELEASE_VER} # version of glibc ports addon -NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires - -IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only" -[[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_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 - -[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20} - -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" -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 ) - x86? ( >=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 - >=app-misc/pax-utils-0.1.10 - virtual/os-headers - !=sys-devel/patch-2.6.1 - selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-kernel/ps3-sources - selinux? ( sys-libs/libselinux ) - !sys-libs/nss-db" - -if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )" - [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers" -else - DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )" - RDEPEND="${RDEPEND} - vanilla? ( !sys-libs/timezone-data ) - !vanilla? ( sys-libs/timezone-data )" -fi - -SRC_URI=$( - upstream_uris() { - echo mirror://gnu/glibc/$1 ftp://sources.redhat.com/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$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} - } - - TARNAME=${PN} - if [[ -n ${SNAP_VER} ]] ; then - TARNAME="${PN}-${RELEASE_VER}" - [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER} - upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2 - elif [[ -z ${EGIT_REPO_URIS} ]] ; then - upstream_uris ${TARNAME}-${RELEASE_VER}.tar.xz - fi - [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2 - [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.xz - [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2 - [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_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] [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 [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 -# run the specified function if it is defined -eblit-run-maybe() { - [[ $(type -t "$@") == "function" ]] && "$@" -} - -# eblit-run [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_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 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() { - if [[ ${CTARGET} == x86_64* ]] && has x32 $(get_all_abis) ; then - GLIBC_PATCH_EXCLUDE+=" 0080_all_glibc-2.15-revert-x86_64-eagain-pthread_cond_wait.patch" - else - GLIBC_PATCH_EXCLUDE+=" 1200_all_glibc-${PV}-x32.patch" - fi -} - -eblit-src_unpack-post() { - cd "${S}" - epatch "${FILESDIR}"/local/glibc-2.14-file-mangle.patch - epatch "${FILESDIR}"/2.11/glibc-2.11-frecord-gcc-switches.patch - epatch "${FILESDIR}"/2.11/glibc-2.11-disable-memset-warning.patch - epatch "${FILESDIR}"/2.11/glibc-2.11-resolv-milliseconds.patch - epatch "${FILESDIR}"/local/glibc-2.15-arm-memcpy.patch - if use hardened ; then - cd "${S}" - einfo "Patching to get working PIE binaries on PIE (hardened) platforms" - 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 - epatch "${FILESDIR}"/2.11/glibc-2.11-tls-stack-addition.patch - - einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler" - cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \ - debug/stack_chk_fail.c || die - cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \ - debug/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" - sed -i \ - -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \ - debug/Makefile \ - || die "Failed to modify debug/Makefile for debug fortify 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 -} - -eblit-pkg_preinst-post() { - if [[ ${CTARGET} == arm* ]] ; then - # Backwards compat support for renaming hardfp ldsos #417287 - local oldso='/lib/ld-linux.so.3' - local nldso='/lib/ld-linux-armhf.so.3' - if [[ -e ${D}${nldso} ]] ; then - if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then - ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})." - ewarn "Please rebuild all packages using this old ldso as compat" - ewarn "support will be dropped in the future." - ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}" - fi - fi - fi -} - -maint_pkg_create() { - local base="/usr/local/src/gnu/glibc/glibc-${PV:0:1}_${PV:2:1}" - cd ${base} - local stamp=$(date +%Y%m%d) - local d - for d in libc ports ; do - #(cd ${d} && cvs up) - case ${d} in - libc) tarball="${P}";; - ports) tarball="${PN}-ports-${PV}";; - esac - rm -f ${tarball}* - ln -sf ${d} ${tarball} - tar hcf - ${tarball} --exclude-vcs | lzma > "${T}"/${tarball}.tar.lzma - du -b "${T}"/${tarball}.tar.lzma - done -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.16.0.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.16.0.ebuild deleted file mode 100644 index d842ab1f8f..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.16.0.ebuild +++ /dev/null @@ -1,227 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.16.0.ebuild,v 1.16 2012/11/18 09:32:24 vapier Exp $ - -inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib unpacker multiprocessing - -DESCRIPTION="GNU libc6 (also called glibc2) C library" -HOMEPAGE="http://www.gnu.org/software/libc/libc.html" - -LICENSE="LGPL-2" -KEYWORDS="" -RESTRICT="strip" # strip ourself #46186 -EMULTILIB_PKG="true" - -# Configuration variables -RELEASE_VER="" -BRANCH_UPDATE="" -SNAP_VER="" -case ${PV} in -9999*) - EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" ) - EGIT_SOURCEDIRS=( "${S}" "${S}/ports" ) - inherit git-2 - ;; -*_p*) - RELEASE_VER=${PV%_p*} - SNAP_VER=${PV#*_p} - ;; -*) - RELEASE_VER=${PV} - ;; -esac -MANPAGE_VER="" # pregenerated manpages -INFOPAGE_VER="" # pregenerated infopages -LIBIDN_VER="" # it's integrated into the main tarball now -PATCH_VER="8" # Gentoo patchset -PORTS_VER=${RELEASE_VER} # version of glibc ports addon -NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.16"} # min kernel version nptl requires - -IUSE="debug gd hardened multilib selinux systemtap profile vanilla crosscompile_opts_headers-only" -[[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_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-* ]] ; then - export CTARGET=${CATEGORY#cross-} - fi -fi - -[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.16/2.6.20} - -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 - ! [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 [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 -# run the specified function if it is defined -eblit-run-maybe() { - [[ $(type -t "$@") == "function" ]] && "$@" -} - -# eblit-run [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_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 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-post() { - if use hardened ; then - cd "${S}" - einfo "Patching to get working PIE binaries on PIE (hardened) platforms" - gcc-specs-pie && epatch "${FILESDIR}"/2.16/glibc-2.16-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 - - einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler" - cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \ - debug/stack_chk_fail.c || die - cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \ - debug/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" - sed -i \ - -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \ - debug/Makefile \ - || die "Failed to modify debug/Makefile for debug fortify 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 -} - -eblit-pkg_preinst-post() { - if [[ ${CTARGET} == arm* ]] ; then - # Backwards compat support for renaming hardfp ldsos #417287 - local oldso='/lib/ld-linux.so.3' - local nldso='/lib/ld-linux-armhf.so.3' - if [[ -e ${D}${nldso} ]] ; then - if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then - ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})." - ewarn "Please rebuild all packages using this old ldso as compat" - ewarn "support will be dropped in the future." - ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}" - fi - fi - fi -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-9999.ebuild deleted file mode 100644 index 6a6c26c541..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-9999.ebuild +++ /dev/null @@ -1,190 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-9999.ebuild,v 1.16 2012/11/02 18:25:11 vapier Exp $ - -inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib unpacker multiprocessing binutils-funcs - -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 ~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" "git://sourceware.org/git/glibc-ports.git" ) - EGIT_SOURCEDIRS=( "${S}" "${S}/ports" ) - inherit git-2 - ;; -*) - RELEASE_VER=${PV} - ;; -esac -PATCH_VER="" # Gentoo patchset -PORTS_VER=${RELEASE_VER} # version of glibc ports addon -NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires - -IUSE="debug gd hardened multilib selinux systemtap profile 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 - -[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20} - -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 - ! [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 [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 -# run the specified function if it is defined -eblit-run-maybe() { - [[ $(type -t "$@") == "function" ]] && "$@" -} - -# eblit-run [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_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 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-post() { - if use hardened ; then - cd "${S}" - einfo "Patching to get working PIE binaries on PIE (hardened) platforms" - 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 - - einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler" - cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \ - debug/stack_chk_fail.c || die - cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \ - debug/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" - sed -i \ - -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \ - debug/Makefile \ - || die "Failed to modify debug/Makefile for debug fortify 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 -}