From 9bb909bbcf280f137c7a379d05acf5bc21268e5b Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Thu, 21 Nov 2013 16:39:41 -0600 Subject: Temporarily lower unfolding threshold on Windows This is a very temporary, very unsatisfactory hack to fix #5987 (for now.) The included comments essentially say it all: we lower the unfolding threshold to minimize some amount of exported symbols from the GHC stage2 DLL. I unfortunately had to lower it quite substantially for the dynamic stage2 build to pass. As of this writing, the DLL split between ghc.dll and ghc-0.dll is something like 26,000 vs 63,000 exported symbols, respectively. So we're still quite in danger of tripping it, but I think we will be OK at this exact moment. Signed-off-by: Austin Seipp --- mk/config.mk.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mk/config.mk.in b/mk/config.mk.in index 20bb1ed4fe..780b3030f9 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -94,6 +94,20 @@ else TargetElf = YES endif +# Currently, on Windows, we artificially limit the unfolding creation +# threshold to minimize the number of exported symbols on Windows +# platforms in the stage2 DLL. This avoids a hard limit of 2^16 +# exported symbols in the windows dynamic linker. +# +# This is a pitifully low threshold (the default is 750,) but it +# reduced the symbol count by about ~7,000, bringing us back under the +# limit (for now.) +# +# See #5987 +ifeq "$(TargetOS_CPP)" "mingw32" +GhcStage2HcOpts += -funfolding-creation-threshold=300 +endif + # Some platforms don't support shared libraries NoSharedLibsPlatformList = arm-unknown-linux powerpc-unknown-linux -- cgit v1.2.1