aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXake <xake@rymdraket.net>2009-05-24 10:31:40 +0200
committerXake <xake@rymdraket.net>2009-05-24 10:31:40 +0200
commit869f00db55d7cd7dd8c5e3cd873b12a350ae68e1 (patch)
tree9c270de27a06d2eb26a63391d529ab43f5167d65
parentPatches and minor cleaning (diff)
downloadhardened-dev-869f00db55d7cd7dd8c5e3cd873b12a350ae68e1.tar.gz
hardened-dev-869f00db55d7cd7dd8c5e3cd873b12a350ae68e1.tar.bz2
hardened-dev-869f00db55d7cd7dd8c5e3cd873b12a350ae68e1.zip
eclass updating. Should not break stuff.
following portage by using ecj from 4.3, but does not do their graphite-stuff due to bug.
-rw-r--r--eclass/flag-o-matic.eclass6
-rw-r--r--eclass/hardened-funcs.eclass2
-rw-r--r--eclass/toolchain-funcs.eclass7
-rw-r--r--eclass/toolchain.eclass129
4 files changed, 83 insertions, 61 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 62f39fcf..69778b96 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.132 2009/01/21 00:42:20 gengor Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.134 2009/04/05 08:22:29 grobian Exp $
# @ECLASS: flag-o-matic.eclass
# @MAINTAINER:
@@ -631,7 +631,7 @@ raw-ldflags() {
# @DESCRIPTION:
# DEPRECATED - Gets the flags needed for "NOW" binding
bindnow-flags() {
- ewarn "QA: stop using the bindnow-flags function ... simply drop it from your ebuild" >&2
+ ewarn "QA: stop using the bindnow-flags function ... simply drop it from your ebuild"
}
diff --git a/eclass/hardened-funcs.eclass b/eclass/hardened-funcs.eclass
index 7ebc59a7..85b1708d 100644
--- a/eclass/hardened-funcs.eclass
+++ b/eclass/hardened-funcs.eclass
@@ -41,7 +41,7 @@ _filter-hardened() {
-D_FORTIFY_SOURCE=2|-D_FORTIFY_SOURCE=1|-D_FORTIFY_SOURCE=0)
gcc-specs-fortify && _manage-hardened -U_FORTIFY_SOURCE ;;
-fno-strict-overflow)
- gcc-specs-strict && _manage-hardened -fstrict-overflow ;;
+ gcc-specs-nostrict && _manage-hardened -fstrict-overflow ;;
esac
done
}
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 939de48e..5c30add8 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -12,7 +12,7 @@
# ugly things like cross-compiling and multilib. All of this is done
# in such a way that you can rely on the function always returning
# something sane.
-inherit versionator
+
___ECLASS_RECUR_TOOLCHAIN_FUNCS="yes"
[[ -z ${___ECLASS_RECUR_MULTILIB} ]] && inherit multilib
@@ -295,7 +295,6 @@ gcc-minor-version() {
gcc-micro-version() {
gcc-fullversion "$@" | cut -f3 -d. | cut -f1 -d-
}
-tc_version_is_at_least() { version_is_at_least "$1" "${2:-${GCC_PV}}" ; }
# Returns the installation directory - internal toolchain
# function for use by _gcc-specs-exists (for flag-o-matic).
@@ -386,8 +385,8 @@ gcc-specs-fortify() {
directive=$(gcc-specs-directive cpp_unique_options)
return $([[ "${directive/\{!U_FORTIFY_SOURCE:}" != "${directive}" ]])
}
-# Returns true if gcc builds with the fno-strict-overflow
-gcc-specs-strict() {
+# Returns true if gcc builds with fno-strict-overflow
+gcc-specs-nostrict() {
local directive
directive=$(gcc-specs-directive cc1)
return $([[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]])
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 06b5f4e6..60f93059 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.395 2009/03/15 07:13:25 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.398 2009/05/07 23:56:12 halcy0n Exp $
#
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
@@ -294,7 +294,7 @@ get_gcc_src_uri() {
if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
tc_version_is_at_least "4.3" && \
GCC_SRC_URI="${GCC_SRC_URI}
- gcj? ( ftp://sourceware.org/pub/java/ecj-${GCC_BRANCH_VER}.jar )"
+ gcj? ( ftp://sourceware.org/pub/java/ecj-4.3.jar )"
fi
# Call get_gcc_src_uri_hardened in hardened-funcs to get
@@ -584,7 +584,7 @@ do_gcc_rename_java_bins() {
# 1) Move the man files if present (missing prior to gcc-3.4)
for manfile in rmic rmiregistry; do
[[ -f ${S}/gcc/doc/${manfile}.1 ]] || continue
- mv "${S}"/gcc/doc/${manfile}.1 "${S}"/gcc/doc/g${manfile}.1
+ mv "${S}"/gcc/doc/${manfile}.1 "${S}"/gcc/doc/g${manfile}.1
done
# 2) Fixup references in the docs if present (mission prior to gcc-3.4)
for jfile in gcc/doc/gcj.info gcc/doc/grmic.1 gcc/doc/grmiregistry.1 gcc/java/gcj.texi; do
@@ -671,7 +671,7 @@ gcc_src_unpack() {
# >= gcc-4.3 doesn't bundle ecj.jar, so copy it
if [[ ${GCCMAJOR}.${GCCMINOR} > 4.2 ]] &&
use gcj ; then
- cp -pPR "${DISTDIR}/ecj-${GCC_BRANCH_VER}.jar" "${S}/ecj.jar" || die
+ cp -pPR "${DISTDIR}/ecj-4.3.jar" "${S}/ecj.jar" || die
fi
# disable --as-needed from being compiled into gcc specs
@@ -837,6 +837,12 @@ gcc_do_configure() {
--mandir=${DATAPATH}/man \
--infodir=${DATAPATH}/info \
--with-gxx-include-dir=${STDCXX_INCDIR}"
+ # On Darwin we need libdir to be set in order to get correct install names
+ # for things like libobjc-gnu, libgcj and libfortran. If we enable it on
+ # non-Darwin we screw up the behaviour this eclass relies on. We in
+ # particular need this over --libdir for bug #255315.
+ [[ ${CHOST} == *-darwin* ]] && \
+ confgcc="${confgcc} --enable-version-specific-runtime-libs"
# All our cross-compile logic goes here ! woo !
confgcc="${confgcc} --host=${CHOST}"
@@ -940,6 +946,8 @@ gcc_do_configure() {
confgcc="${confgcc} --enable-clocale=gnu"
elif [[ ${CTARGET} == *-freebsd* ]]; then
confgcc="${confgcc} --enable-__cxa_atexit"
+ elif [[ ${CTARGET} == *-solaris* ]]; then
+ confgcc="${confgcc} --enable-__cxa_atexit"
fi
[[ ${GCCMAJOR}.${GCCMINOR} < 3.4 ]] && confgcc="${confgcc} --disable-libunwind-exceptions"
@@ -1045,7 +1053,7 @@ gcc_do_make() {
fi
pushd "${WORKDIR}"/build
-
+
emake \
LDFLAGS="${LDFLAGS}" \
STAGE1_CFLAGS="${STAGE1_CFLAGS}" \
@@ -1142,6 +1150,11 @@ gcc_do_filter_flags() {
3.4|4.*)
case $(tc-arch) in
x86|amd64) filter-flags '-mcpu=*';;
+ *-macos)
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25127
+ [[ ${GCC_BRANCH_VER} == 4.0 || ${GCC_BRANCH_VER} == 4.1 ]] && \
+ filter-flags '-mcpu=*' '-march=*' '-mtune=*'
+ ;;
esac
;;
esac
@@ -1265,11 +1278,10 @@ gcc-library_src_install() {
gcc-compiler_src_install() {
local x=
- cd "${WORKDIR}"/build
+ cd "${WORKDIR}"/build
# Do allow symlinks in private gcc include dir as this can break the build
find gcc/include*/ -type l -print0 | xargs rm -f
-
# Remove generated headers, as they can cause things to break
# (ncurses, openssl, etc).
for x in $(find gcc/include*/ -name '*.h') ; do
@@ -1301,8 +1313,9 @@ gcc-compiler_src_install() {
# Make sure we dont have stuff lying around that
# can nuke multiple versions of gcc
+
gcc_slot_java
-
+
# Move <cxxabi.h> to compiler-specific directories
[[ -f ${D}${STDCXX_INCDIR}/cxxabi.h ]] && \
mv -f "${D}"${STDCXX_INCDIR}/cxxabi.h "${D}"${LIBPATH}/include/
@@ -1404,42 +1417,45 @@ gcc-compiler_src_install() {
# and copy the minispecs
copy_minispecs_gcc_specs
}
+
gcc_slot_java() {
local x
-
+
# Move Java headers to compiler-specific dir
- for x in "${D}"${PREFIX}/include/gc*.h "${D}"${PREFIX}/include/j*.h ; do
- [[ -f ${x} ]] && mv -f "${x}" "${D}"${LIBPATH}/include/
- done
- for x in gcj gnu java javax org ; do
- if [[ -d ${D}${PREFIX}/include/${x} ]] ; then
- dodir /${LIBPATH}/include/${x}
- mv -f "${D}"${PREFIX}/include/${x}/* "${D}"${LIBPATH}/include/${x}/
- rm -rf "${D}"${PREFIX}/include/${x}
- fi
- done
- if [[ -d ${D}${PREFIX}/lib/security ]] || [[ -d ${D}${PREFIX}/$(get_libdir)/security ]] ; then
- dodir /${LIBPATH}/security
- mv -f "${D}"${PREFIX}/lib*/security/* "${D}"${LIBPATH}/security
- rm -rf "${D}"${PREFIX}/lib*/security
+ for x in "${D}"${PREFIX}/include/gc*.h "${D}"${PREFIX}/include/j*.h ; do
+ [[ -f ${x} ]] && mv -f "${x}" "${D}"${LIBPATH}/include/
+ done
+ for x in gcj gnu java javax org ; do
+ if [[ -d ${D}${PREFIX}/include/${x} ]] ; then
+ dodir /${LIBPATH}/include/${x}
+ mv -f "${D}"${PREFIX}/include/${x}/* "${D}"${LIBPATH}/include/${x}/
+ rm -rf "${D}"${PREFIX}/include/${x}
fi
+ done
+
+ if [[ -d ${D}${PREFIX}/lib/security ]] || [[ -d ${D}${PREFIX}/$(get_libdir)/security ]] ; then
+ dodir /${LIBPATH}/security
+ mv -f "${D}"${PREFIX}/lib*/security/* "${D}"${LIBPATH}/security
+ rm -rf "${D}"${PREFIX}/lib*/security
+ fi
- # Move libgcj.spec to compiler-specific directories
- [[ -f ${D}${PREFIX}/lib/libgcj.spec ]] && \
+ # Move libgcj.spec to compiler-specific directories
+ [[ -f ${D}${PREFIX}/lib/libgcj.spec ]] && \
mv -f "${D}"${PREFIX}/lib/libgcj.spec "${D}"${LIBPATH}/libgcj.spec
- # SLOT up libgcj.pc (and let gcc-config worry about links)
- local libgcj=$(find "${D}"${PREFIX}/lib/pkgconfig/ -name 'libgcj*.pc')
- if [[ -n ${libgcj} ]] ; then
- sed -i "/^libdir=/s:=.*:=${LIBPATH}:" "${libgcj}"
- mv "${libgcj}" "${D}"/usr/lib/pkgconfig/libgcj-${GCC_PV}.pc || die
- fi
+ # SLOT up libgcj.pc (and let gcc-config worry about links)
+ local libgcj=$(find "${D}"${PREFIX}/lib/pkgconfig/ -name 'libgcj*.pc')
+ if [[ -n ${libgcj} ]] ; then
+ sed -i "/^libdir=/s:=.*:=${LIBPATH}:" "${libgcj}"
+ mv "${libgcj}" "${D}"/usr/lib/pkgconfig/libgcj-${GCC_PV}.pc || die
+ fi
- # Rename jar because it could clash with Kaffe's jar if this gcc is
- # primary compiler (aka don't have the -<version> extension)
- cd "${D}"${BINPATH}
- [[ -f jar ]] && mv -f jar gcj-jar
+ # Rename jar because it could clash with Kaffe's jar if this gcc is
+ # primary compiler (aka don't have the -<version> extension)
+ cd "${D}"${BINPATH}
+ [[ -f jar ]] && mv -f jar gcj-jar
}
+
# Move around the libs to the right location. For some reason,
# when installing gcc, it dumps internal libraries into /usr/lib
# instead of the private gcc lib path
@@ -1486,7 +1502,7 @@ gcc_movelibs() {
done
find "${D}" -type d | xargs rmdir >& /dev/null
- fix_libtool_libdir_paths $(find "${D}"${LIBPATH} -name *.la)
+ fix_libtool_libdir_paths
}
#----<< src_* >>----
@@ -1504,7 +1520,7 @@ gcc_quick_unpack() {
export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}}
export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}}
export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}}
-
+
if [[ -n ${GCC_A_FAKEIT} ]] ; then
unpack ${GCC_A_FAKEIT}
elif [[ -n ${PRERELEASE} ]] ; then
@@ -1568,18 +1584,6 @@ exclude_gcc_patches() {
done
}
-do_gcc_HTB_patches() {
- if ! want_boundschecking || \
- (want_ssp && [[ ${HTB_EXCLUSIVE} == "true" ]])
- then
- do_gcc_stub htb
- return 0
- fi
-
- # modify the bounds checking patch with a regression patch
- epatch "${WORKDIR}/bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch"
- BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, HTB-${HTB_GCC_VER}-${HTB_VER}"
-}
do_gcc_USER_patches() {
local check base=${PORTAGE_CONFIGROOT}/etc/portage/patches
for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do
@@ -1595,6 +1599,20 @@ do_gcc_USER_patches() {
fi
done
}
+
+do_gcc_HTB_patches() {
+ if ! want_boundschecking || \
+ (want_ssp && [[ ${HTB_EXCLUSIVE} == "true" ]])
+ then
+ do_gcc_stub htb
+ return 0
+ fi
+
+ # modify the bounds checking patch with a regression patch
+ epatch "${WORKDIR}/bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch"
+ BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, HTB-${HTB_GCC_VER}-${HTB_VER}"
+}
+
should_we_gcc_config() {
# we always want to run gcc-config if we're bootstrapping, otherwise
# we might get stuck with the c-only stage1 compiler
@@ -1675,7 +1693,7 @@ do_gcc_config() {
gcc_version_patch() {
# gcc-4.3+ has configure flags (whoo!)
tc_version_is_at_least 4.3 && einfo "Building ${version_string} (${BRANDING_GCC_PKGVERSION})" && return 0
-
+
local version_string=${GCC_CONFIG_VER}
[[ -n ${BRANCH_UPDATE} ]] && version_string="${version_string} ${BRANCH_UPDATE}"
@@ -1691,7 +1709,7 @@ gcc_version_patch() {
fi
sed -i -e 's~gcc\.gnu\.org\/bugs\.html~bugs\.gentoo\.org\/~' \
"${S}"/gcc/version.c || die "Failed to change the bug URL"
-}
+}
# The purpose of this DISGUSTING gcc multilib hack is to allow 64bit libs
# to live in lib instead of lib64 where they belong, with 32bit libraries
@@ -1742,16 +1760,19 @@ disable_multilib_libjava() {
# on our own .la files need to be updated.
fix_libtool_libdir_paths() {
pushd "${D}" >/dev/null
+
local dir=${LIBPATH}
local allarchives=$(cd ./${dir}; echo *.la)
allarchives="\(${allarchives// /\\|}\)"
+
sed -i \
-e "/^libdir=/s:=.*:='${dir}':" \
./${dir}/*.la
- sed -i \
- -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" \
+ sed -i \
+ -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" \
$(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') \
./${dir}/*.la
+
popd >/dev/null
}
@@ -1760,6 +1781,8 @@ is_multilib() {
case ${CTARGET} in
mips64*|powerpc64*|s390x*|sparc*|x86_64*)
has_multilib_profile || use multilib ;;
+ *-*-solaris*) use multilib ;;
+ *-apple-darwin*) use multilib ;;
*) false ;;
esac
}