--- a/sys-libs/glibc/glibc-2.20.ebuild +++ b/sys-libs/glibc/glibc-2.20.ebuild @@ -138,6 +138,23 @@ eblit-run-maybe eblit-$1-post } +pkg_pretend() { +# ABI-specific checks, but run only if the right target+destination conditions are met. + if [[ ${CATEGORY} != cross-* ]] + then + # In a cross-compile situation we cannot (easily) probe the kernel that glibc will be running on. Skip the check + use amd64 && use multilib && { + ebegin "Checking IA32 emulation is enabled" + echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c" + "${CC-${CHOST}-gcc}" ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32" + "${T}/check-ia32-emulation.elf32" + STAT=$? + rm -f "${T}/check-ia32-emulation.elf32" + eend $STAT + [ $STAT -eq 0 ] || die "CONFIG_IA32_EMULATION must be enabled in the kernel to compile glibc" + } + fi +} src_unpack() { eblit-run src_unpack ; } src_prepare() { eblit-run src_prepare ; } src_configure() { eblit-run src_configure ; }