From: PHO Date: Sun, 4 Mar 2012 03:46:05 +0000 (+0900) Subject: Perform dead-code elimination only on NetBSD/i386 as it makes ld(1) take too much... X-Git-Tag: GHC-7.4.1~2^2~1 X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=pkgsrc-ghc.git;a=commitdiff_plain;h=733c1f4b67e98ad825b20943e350a73bbcc4a90d Perform dead-code elimination only on NetBSD/i386 as it makes ld(1) take too much CPU time and memory. --- diff --git a/Makefile b/Makefile index 421ee4a..fed43ba 100644 --- a/Makefile +++ b/Makefile @@ -137,7 +137,21 @@ ${WRKDIR}/stamp-extract-hc: ${WRKDIR}/stamp-configure-hc-boot ${WRKDIR}/stamp-rewrite-hc-paths: ${WRKDIR}/stamp-extract-hc ${RUN} cd ${WRKDIR}/bootstrap/${DISTNAME} && \ ${PHASE_MSG} "Rewriting source paths in bootstrapping compiler for ${PKGNAME}" && \ - ${SED} -e "s#\\[\\[PREFIX\\]\\]#${PREFIX}#g" ${BOOTSTRAP_BUILD_MK} > mk/build.mk && \ + ${SED} -e "s#\\[\\[PREFIX\\]\\]#${PREFIX}#g" ${BOOTSTRAP_BUILD_MK} > mk/build.mk +.if ${MACHINE_ARCH} == "i386" && ${OPSYS} == "NetBSD" +# Unregisterised stage0 compiler gets too large (.text section being +# over 64 MiB) without dead-code elimination, exceeding NetBSD/i386's +# kernel default limitation. +# Note that stage1 currently doesn't bloat that much (about 42.6 +# MiB), but when it does we have to append +# CONF_CC_OPTS_STAGE1="-fdata..." and +# CONF_GCC_LINKER_OPTS_STAGE1="-Wl,--gc-sections" to CONFIGURE_ENV as +# well. I guess that's a matter of time :( + ${RUN} cd ${WRKDIR}/bootstrap/${DISTNAME} && \ + ${ECHO} "EXTRA_CC_OPTS += -fdata-sections -ffunction-sections" >> mk/build.mk && \ + ${ECHO} "EXTRA_CC_OPTS += -Wl,--gc-sections" >> mk/build.mk +.endif + ${RUN} cd ${WRKDIR}/bootstrap/${DISTNAME} && \ for c in libraries/*/configure; do \ (cd `${DIRNAME} $$c` && ${SETENV} ${CONFIGURE_ENV} ${SH} configure ${CONFIGURE_ARGS}); \ done && \ diff --git a/files/bootstrap-bsd.mk b/files/bootstrap-bsd.mk index fdf7056..aa46508 100644 --- a/files/bootstrap-bsd.mk +++ b/files/bootstrap-bsd.mk @@ -19,14 +19,3 @@ utils/ghc-pkg_dist-install_v_EXTRA_CC_OPTS += -L[[PREFIX]]/lib -lm -liconv -luti SRC_CC_OPTS += -I[[PREFIX]]/include INTEGER_LIBRARY = integer-simple - -# Unregisterised stage0 compiler gets too large (.text section being -# over 64 MiB) without dead-code elimination, exceeding NetBSD/i386's -# kernel default limitation. -# Note that stage1 currently doesn't bloat that much (about 42.6 -# MiB), but when it does we have to append -# CONF_CC_OPTS_STAGE1="-fdata..." and -# CONF_GCC_LINKER_OPTS_STAGE1="-Wl,--gc-sections" to CONFIGURE_ENV as -# well. I guess that's a matter of time :( -EXTRA_CC_OPTS += -fdata-sections -ffunction-sections -EXTRA_CC_OPTS += -Wl,--gc-sections