diff options
author | Ian Lynagh <igloo@earth.li> | 2012-06-29 01:33:17 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-06-29 12:02:08 +0100 |
commit | 5ddc841a547d2d37428280b04c071a1d4b83e10d (patch) | |
tree | 6154172433fafad4c2dcaf299a475159566149f7 /rules/build-package-way.mk | |
parent | 30b5ba9b86610f38da704d6b7426cd776e3fbbe4 (diff) | |
download | haskell-5ddc841a547d2d37428280b04c071a1d4b83e10d.tar.gz |
On Windows, detect if DLLs have too many symbols; trac #5987
The test isn't very pretty; it involves trawling through the
objdump -p output. I couldn't find an easier way, unfortuantely.
Diffstat (limited to 'rules/build-package-way.mk')
-rw-r--r-- | rules/build-package-way.mk | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index 9919d3b954..176dc9bd83 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -69,6 +69,9 @@ $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS) $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) \ -no-auto-link-packages \ -o $$@ +# Now check that the DLL doesn't have too many symbols. See trac #5987. + case `$$(OBJDUMP) -p $$@ | sed -n "1,/^.Ordinal\/Name Pointer/ D; p; /^$$$$/ q" | grep "\[ *0\]" | wc -l` in 1) echo DLL $$@ OK;; 0) echo No symbols in DLL $$@; exit 1;; [0-9]*) echo Too many symbols in DLL $$@; exit 1;; *) echo bad DLL $$@; exit 1;; esac + else $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS) $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_ALL_OBJS) \ |