--- gcl-2.6.7.ebuild.org 2008-09-25 23:00:56.000000000 +0200 +++ gcl-2.6.7.ebuild 2008-09-25 23:25:14.000000000 +0200 @@ -24,6 +24,32 @@ >=app-text/texi2html-1.64 >=sys-devel/autoconf-2.52" +pkg_setup() { + # pkg_setup stolen from axiom ebuild 200805 + # for 2.6.25 kernels and higher we need to have + # /proc/sys/kernel/randomize_va_space set to somthing other + # than 2, otherwise gcl fails to compile (see bug #186926). + local current_setting=$(/sbin/sysctl kernel.randomize_va_space 2>/dev/null | cut -d' ' -f3) + if [[ ${current_setting} == 2 ]]; then + echo + eerror "Your kernel has brk randomization enabled. This will" + eerror "cause gcl to fail to compile *and* run (see bug #186926)." + eerror "You can issue:" + eerror + eerror " /sbin/sysctl -w kernel.randomize_va_space=1" + eerror + eerror "as root to turn brk randomization off temporarily." + eerror "However, when not using gcl you may want to turn" + eerror "brk randomization back on via" + eerror + eerror " /sbin/sysctl -w kernel.randomize_va_space=2" + eerror + eerror "since it results in a less secure kernel." + die "Kernel brk randomization detected" + fi +} + + src_unpack() { unpack ${A} sed -e "s/gcl-doc/${PF}/g" "${S}"/info/makefile > "${T}"/makefile @@ -31,6 +57,7 @@ epatch "${FILESDIR}"/${PV}-fix-configure.in-gentoo.patch epatch "${FILESDIR}"/${P}-fix-configure.in-bfd.patch + cd "${S}" eautoconf || die }