summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac7
-rw-r--r--mk/config.mk.in1
-rw-r--r--rules/build-package-way.mk3
3 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e1b4db0d73..f7862ecfc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -336,6 +336,7 @@ then
CC="${mingwbin}gcc.exe"
LD="${mingwbin}ld.exe"
NM="${mingwbin}nm.exe"
+ OBJDUMP="${mingwbin}objdump.exe"
fp_prog_ar="${mingwbin}ar.exe"
if ! test -d inplace/perl ||
@@ -446,6 +447,12 @@ FP_ARG_WITH_PATH_GNU_PROG([NM], [nm], [nm])
NmCmd="$NM"
AC_SUBST([NmCmd])
+dnl ** Which objdump to use?
+dnl --------------------------------------------------------------
+FP_ARG_WITH_PATH_GNU_PROG([OBJDUMP], [objdump], [objdump])
+ObjdumpCmd="$OBJDUMP"
+AC_SUBST([ObjdumpCmd])
+
dnl ** Which LLVM llc to use?
dnl --------------------------------------------------------------
FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([LLC], [llc])
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 36b277b979..81298e4a93 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -714,6 +714,7 @@ DTRACE = @DtraceCmd@
LD = @LdCmd@
NM = @NmCmd@
+OBJDUMP = @ObjdumpCmd@
LLC = @LlcCmd@
OPT = @OptCmd@
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) \