diff options
author | Tamar Christina <tamar@zhox.com> | 2017-03-26 19:05:46 +0100 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2017-07-08 00:02:36 +0100 |
commit | bd4fdc6aa34a85268f3e9a2bd3f4142a97724ce4 (patch) | |
tree | 984a144a47f4045b226a1511442bb13fd3a8a3cb /rules | |
parent | 99adcc8804e91161b35ff1d0e5f718d18fcaa66a (diff) | |
download | haskell-bd4fdc6aa34a85268f3e9a2bd3f4142a97724ce4.tar.gz |
Implement split-sections support for windows.
Summary:
Initial implementation of split-section on Windows.
This also corrects section namings and uses the platform
convention of `$` instead of `.` to separate sections.
Implementation is based on @awson's patches to binutils.
Binutils requires some extra help when compiling the libraries
for GHCi usage. We drop the `-T` and use implicit scripts to amend
the linker scripts instead of replacing it.
Because of these very large GHCi object files, we need big-obj support,
which will be added by another patch.
Test Plan: ./validate
Reviewers: awson, austin, bgamari
Subscribers: dfeuer, rwbarton, thomie, snowleopard, #ghc_windows_task_force
GHC Trac Issues: #12913
Differential Revision: https://phabricator.haskell.org/D3383
Diffstat (limited to 'rules')
-rw-r--r-- | rules/build-package-way.mk | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index 77758567f8..3b4d1c926c 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -138,9 +138,15 @@ endif ifeq "$$($1_$2_SplitSections)" "YES" ifeq "$(LdIsGNULd)" "YES" +ifeq "$$(HostOS_CPP)" "mingw32" +$1_$2_LD_SCRIPT_CMD = +$1_$2_LD_SCRIPT = driver/utils/merge_sections_pe.ld +else +$1_$2_LD_SCRIPT_CMD = -T $1_$2_LD_SCRIPT = driver/utils/merge_sections.ld endif endif +endif # Build the GHCi library ifeq "$3" "v" @@ -152,7 +158,7 @@ BINDIST_LIBS += $$($1_$2_GHCI_LIB) endif endif $$($1_$2_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) $$($1_$2_LD_SCRIPT) - $$(call cmd,LD) $$(CONF_LD_LINKER_OPTS_STAGE$4) -r $$(if $$($1_$2_LD_SCRIPT),-T $$($1_$2_LD_SCRIPT)) -o $$@ $$(EXTRA_LD_LINKER_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) + $$(call cmd,LD) $$(CONF_LD_LINKER_OPTS_STAGE$4) -r $$(if $$($1_$2_LD_SCRIPT),$$($1_$2_LD_SCRIPT_CMD) $$($1_$2_LD_SCRIPT)) -o $$@ $$(EXTRA_LD_LINKER_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES" # Don't bother making ghci libs for bootstrapping packages |