[commit: ghc] master: Give hsc2hs different options in different stages; fixes #7705 (f1fcfff)
Ian Lynagh
igloo at earth.li
Sat Mar 2 15:43:36 CET 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/f1fcfff5109507d065b4d317ef6b2fee16cc7fd4
>---------------------------------------------------------------
commit f1fcfff5109507d065b4d317ef6b2fee16cc7fd4
Author: Ian Lynagh <ian at well-typed.com>
Date: Sat Mar 2 12:22:20 2013 +0000
Give hsc2hs different options in different stages; fixes #7705
Based on patch from Stephen Blackheath.
>---------------------------------------------------------------
mk/config.mk.in | 14 ++++++++++++--
rules/distdir-opts.mk | 5 +++--
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/mk/config.mk.in b/mk/config.mk.in
index e61c267..88c6a35 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -587,10 +587,20 @@ endif
ifneq "$(Windows_Host)" "YES"
SRC_HSC2HS_OPTS += --cross-safe
endif
-SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS) $(CONF_CC_OPTS_STAGE0)))
SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
+
+define set_stage_HSC2HS_OPTS
+# $1 = stage
+SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --cflag=,$$(filter-out -O,$$(SRC_CC_OPTS) $$(CONF_CC_OPTS_STAGE$1)))
+SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --cflag=,$$(CONF_CPP_OPTS_STAGE$1))
+SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --lflag=,$$(CONF_GCC_LINKER_OPTS_STAGE$1))
+endef
+$(eval $(call set_stage_HSC2HS_OPTS,0))
+$(eval $(call set_stage_HSC2HS_OPTS,1))
+$(eval $(call set_stage_HSC2HS_OPTS,2))
ifeq "$(CrossCompiling)" "YES"
-SRC_HSC2HS_OPTS += --cross-compile
+SRC_HSC2HS_OPTS_STAGE1 += --cross-compile
+SRC_HSC2HS_OPTS_STAGE2 += --cross-compile
endif
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
diff --git a/rules/distdir-opts.mk b/rules/distdir-opts.mk
index 748e27e..50cc05e 100644
--- a/rules/distdir-opts.mk
+++ b/rules/distdir-opts.mk
@@ -79,10 +79,11 @@ $1_$2_HSC2HS_LD_OPTS:=$$(shell for i in $$($1_$2_DIST_LD_OPTS); do echo \'--lfla
endif
$1_$2_ALL_HSC2HS_OPTS = \
- --cc=$$(WhatGccIsCalled) \
- --ld=$$(WhatGccIsCalled) \
+ --cc=$$(CC_STAGE$3) \
+ --ld=$$(CC_STAGE$3) \
$$(CONF_HSC2HS_OPTS) \
$$(SRC_HSC2HS_OPTS) \
+ $$(SRC_HSC2HS_OPTS_STAGE$3) \
--cflag=-D__GLASGOW_HASKELL__=$$(if $$(filter 0,$3),$$(GhcCanonVersion),$$(ProjectVersionInt)) \
--cflag=-D$$(HostArch_CPP)_HOST_ARCH=1 \
--cflag=-D$$(HostOS_CPP)_HOST_OS=1 \
More information about the ghc-commits
mailing list