Ticket #7705: ios-patch-4a-hsc2hs-correct-options-by-stage.patch

File ios-patch-4a-hsc2hs-correct-options-by-stage.patch, 1.9 KB (added by StephenBlackheath, 2 years ago)

iOS patch 4 rev a: correct options for hsc2hs by stage

  • mk/config.mk.in

    diff --git a/mk/config.mk.in b/mk/config.mk.in
    index fdc680f..740616f 100644
    a b endif 
    633633# The .hsc files aren't currently safe for cross-compilation on Windows:
    634634#     libraries\haskeline\.\System\Console\Haskeline\Backend\Win32.hsc:160
    635635#     directive "let" is not safe for cross-compilation
    636 ifneq "$(Windows)" "YES"
    637 SRC_HSC2HS_OPTS += --cross-safe
    638 endif
    639 SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS) $(CONF_CC_OPTS_STAGE0)))
    640 SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
    641 ifeq "$(CrossCompiling)" "YES"
    642 SRC_HSC2HS_OPTS += --cross-compile
    643 endif
     636set_hsc2hs_opts=\
     637      $(if $(filter $(Windows),NO),--cross-safe) \
     638      $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS) $(CONF_CC_OPTS_STAGE$1))) \
     639      $(addprefix --lflag=,$(CONF_GCC_LINKER_OPTS_STAGE$1)) \
     640      $(addprefix --cflag=,$(CONF_CPP_OPTS_STAGE$1)) \
     641      $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d)) \
     642      $(if $(filter $(CrossCompiling),YES),--cross-compile)
     643SRC_HSC2HS_OPTS_STAGE0=$(call set_hsc2hs_opts,0)
     644SRC_HSC2HS_OPTS_STAGE1=$(call set_hsc2hs_opts,1)
     645SRC_HSC2HS_OPTS_STAGE2=$(call set_hsc2hs_opts,2)
    644646
    645647ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
    646648WINDRES = $(INPLACE_MINGW)/bin/windres
  • rules/distdir-way-opts.mk

    diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
    index 4d27bbf..bcff573 100644
    a b $1_$2_$3_HSC2HS_LD_OPTS:=$$(shell for i in $$($1_$2_DIST_LD_OPTS); do echo \'--l 
    195195endif
    196196
    197197$1_$2_$3_ALL_HSC2HS_OPTS = \
    198  --cc=$$(WhatGccIsCalled) \
    199  --ld=$$(WhatGccIsCalled) \
     198 --cc=$$(CC_STAGE$4) \
     199 --ld=$$(CC_STAGE$4) \
    200200 $$(CONF_HSC2HS_OPTS) \
    201  $$(SRC_HSC2HS_OPTS) \
     201 $$(SRC_HSC2HS_OPTS_STAGE$4) \
    202202 $$(WAY_$3_HSC2HS_OPTS) \
    203203 --cflag=-D__GLASGOW_HASKELL__=$$(if $$(filter 0,$4),$$(GhcCanonVersion),$$(ProjectVersionInt)) \
    204204 --cflag=-D$$(HostArch_CPP)_HOST_ARCH=1 \