Fix the way we call strip on DLLs
authorIan Lynagh <igloo@earth.li>
Sun, 6 May 2012 18:39:41 +0000 (19:39 +0100)
committerIan Lynagh <igloo@earth.li>
Sun, 6 May 2012 18:39:41 +0000 (19:39 +0100)
On Win64, "install -s" calls a strip that doesn't understand 64bit
binaries. For some reason, this means the DLLs end up non-executable,
which means executables that use them just segfault.

ghc.mk
mk/config.mk.in

diff --git a/ghc.mk b/ghc.mk
index cbe3473..a8c8cee 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -799,7 +799,8 @@ install_libs: $(INSTALL_LIBS)
                    $(call INSTALL_DATA,$(INSTALL_OPTS),$$i,"$(DESTDIR)$(ghclibdir)"); \
                    $(RANLIB) $(DESTDIR)$(ghclibdir)/`basename $$i` ;; \
                  *.dll) \
-                   $(call INSTALL_PROGRAM,-s $(INSTALL_OPTS),$$i,"$(DESTDIR)$(ghclibdir)") ;; \
+                   $(call INSTALL_PROGRAM,$(INSTALL_OPTS),$$i,"$(DESTDIR)$(ghclibdir)") ; \
+                   $(STRIP_CMD) "$(DESTDIR)$(ghclibdir)"/$$i ;; \
                  *.so) \
                    $(call INSTALL_SHLIB,$(INSTALL_OPTS),$$i,"$(DESTDIR)$(ghclibdir)") ;; \
                  *.dylib) \
index fe0feb0..b998946 100644 (file)
@@ -768,7 +768,11 @@ endif
 #
 REAL_SHELL     = $(SHELL)
 
+ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
+STRIP_CMD      = $(TOP)/inplace/mingw/bin/x86_64-w64-mingw32-strip.exe
+else
 STRIP_CMD      = strip
+endif
 PATCH_CMD      = @PatchCmd@
 TAR_CMD        = @TarCmd@
 BZIP2_CMD      = bzip2