[project @ 2005-10-27 01:39:40 by sof]
authorsof <unknown>
Thu, 27 Oct 2005 01:39:40 +0000 (01:39 +0000)
committersof <unknown>
Thu, 27 Oct 2005 01:39:40 +0000 (01:39 +0000)
[mingw/msys only]
Undo long-standing workaround for buggy GNU ld's on mingw/msys; i.e.,
the linker wasn't correctly generating relocatable object files when
the number of relocs exceeded 2^16. Worked around the issue by
hackily splitting up the GHCi object file for the larger packages
('base', 'ObjectIO' and 'win32') into a handful of object files,
each with a manageable number of relocs. Tiresome and error-prone
(but the hack has served us well!)

This commit imposes a restriction on the 'ld' you use to compile
up GHC with; it now has to be ld-2.15.x or later (something GHC
binary dists have shipped with since 6.2.2)

Makefile
package.conf.in

index 597ce30..61ce5f2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -97,11 +97,11 @@ endif
 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
 
 # Turn off standard rule which creates HSbase.o from LIBOBJS.
-DONT_WANT_STD_GHCI_LIB_RULE=YES
+#DONT_WANT_STD_GHCI_LIB_RULE=YES
 
 GHCI_LIBOBJS = $(HS_OBJS)
 
-INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
+INSTALL_LIBS += HSbase.o
 
 endif # OBJECT_FILEFORMAT = PEi
 
@@ -131,12 +131,3 @@ System/Posix/Types.o Foreign/C/Types.o: include/CTypes.h
 DIST_CLEAN_FILES += base.buildinfo config.cache config.status config.mk
 
 include $(TOP)/mk/target.mk
-
-ifeq "$(OBJECT_FILEFORMAT)" "PEi"
-HSbase.o : $(GHCI_LIBOBJS)
-       $(LD) -r $(LD_X) -o HSbase1.o $(filter     GHC/%, $(GHCI_LIBOBJS))
-       $(LD) -r $(LD_X) -o HSbase2.o $(filter     Text/%, $(GHCI_LIBOBJS))
-       $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS) $(STUBOBJS))
-       @touch HSbase.o
-endif # OBJECT_FILEFORMAT = PEi
-
index abe7791..e10a39a 100644 (file)
@@ -171,17 +171,7 @@ library-dirs:      LIB_DIR
                , LIB_DIR"/cbits"
 #endif
 
-#if !defined(mingw32_HOST_OS) && !defined(cygwin32_HOST_OS)
 hs-libraries:   "HSbase"
-#else
-/*
- This splitting is the subject of a totally 
- horrible hack, which glues HSbase{1,2,3}
- back into HSbaase for the purposes of static linking.
- See DriverState.getPackageLibraries for details.
-*/
-hs-libraries:  "HSbase1", "HSbase2", "HSbase3"
-#endif
 
 extra-libraries:  "HSbase_cbits"
 #if defined(mingw32_HOST_OS) || defined(__MINGW32__) || defined(_MSC_VER)