summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'hardened/toolchain/branches/pieworld/sys-libs/glibc/glibc-2.5.ebuild')
-rw-r--r--hardened/toolchain/branches/pieworld/sys-libs/glibc/glibc-2.5.ebuild14
1 files changed, 14 insertions, 0 deletions
diff --git a/hardened/toolchain/branches/pieworld/sys-libs/glibc/glibc-2.5.ebuild b/hardened/toolchain/branches/pieworld/sys-libs/glibc/glibc-2.5.ebuild
index a7c6623..de28388 100644
--- a/hardened/toolchain/branches/pieworld/sys-libs/glibc/glibc-2.5.ebuild
+++ b/hardened/toolchain/branches/pieworld/sys-libs/glibc/glibc-2.5.ebuild
@@ -1028,12 +1028,15 @@ RESTRICT="nostrip multilib-pkg-force"
# General: We need a new-enough binutils for as-needed
# arch: we need to make sure our binutils/gcc supports TLS
+# hardened: when built by a hardened gcc-4 compiler, need
+# binutils-2.17 to allow -fPIE with -static.
DEPEND=">=sys-devel/gcc-3.4.4
arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
ppc? ( >=sys-devel/gcc-4.1.0 )
ppc64? ( >=sys-devel/gcc-4.1.0 )
nptl? ( || ( >=sys-kernel/mips-headers-${NPTL_KERNEL_VERSION} >=sys-kernel/linux-headers-${NPTL_KERNEL_VERSION} ) )
>=sys-devel/binutils-2.15.94
+ hardened? ( >=sys-devel/binutils-2.17 )
|| ( >=sys-devel/gcc-config-1.3.12 app-admin/eselect-compiler )
>=app-misc/pax-utils-0.1.10
virtual/os-headers
@@ -1087,6 +1090,17 @@ pkg_setup() {
eerror "You do not have pax-utils installed."
die "install pax-utils"
fi
+
+ # Building glibc with the default-PIE compiler requires binutils-2.17. The
+ # dependency is brought in conditional on USE=hardened.
+ if gcc-specs-pie && ! use hardened; then
+ eerror "USE=hardened must be set to build glibc with a hardened compiler"
+ die "set USE=hardened (or gcc-config to gcc/vanilla)"
+ fi
+ if use hardened && ! version_is_at_least $(ld-version) "2.17"; then
+ eerror "Need binutils-2.17 or higher active to build glibc hardened"
+ die "install >=sys-devel/binutils-2.17 (or binutils-config to it)"
+ fi
}
src_unpack() {