Hi all,

I've seen no problems removing the -static flags (as discussed some time
ago). Also, on mips (and I presume mipsel, although I haven't been able
to try it yet) if I didn't pass the -mlong-calls option then gdb showed
that the call to mp_set_memory_functions in Storage.c landed in the
middle of Show.hc.

`-mlong-calls'
`-mno-long-calls'
     Do all calls with the `JALR' instruction, which requires loading
     up a function's address into a register before the call.  You need
     to use this switch, if you call outside of the current 512
     megabyte segment to functions that are not through pointers.

Patch is below, although I think mips already works with other OSes so
perhaps the -mlong-calls should be Linux-only?


Thanks
Ian


--- ghc-cvs-20040725.orig/mk/config.mk.in
+++ ghc-cvs-20040725/mk/config.mk.in
@@ -770,6 +770,10 @@
 SRC_CC_OPTS += -G0
 endif

+ifneq "$(mips_TARGET_ARCH)$(mipsel_TARGET_ARCH)" ""
+SRC_CC_OPTS += -mlong-calls
+endif
+
 # Solaris2 strikes again.
 unix_SRC_HSC2HS_OPTS += @unix_SRC_HSC2HS_OPTS@

--- ghc-cvs-20040725.orig/ghc/compiler/main/DriverFlags.hs
+++ ghc-cvs-20040725/ghc/compiler/main/DriverFlags.hs
@@ -549,7 +549,7 @@

 machdepCCOpts
    | prefixMatch "alpha"   cTARGETPLATFORM
-   = return ( ["-static", "-w", "-mieee"
+   = return ( ["-w", "-mieee"
 #ifdef HAVE_THREADED_RTS_SUPPORT
            , "-D_REENTRANT"
 #endif
@@ -561,7 +561,7 @@
    | prefixMatch "hppa"    cTARGETPLATFORM
         -- ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi!
         -- (very nice, but too bad the HP /usr/include files don't agree.)
-   = return ( ["-static", "-D_HPUX_SOURCE"], [] )
+   = return ( ["-D_HPUX_SOURCE"], [] )

    | prefixMatch "m68k"    cTARGETPLATFORM
       -- -fno-defer-pop : for the .hc files, we want all the pushing/
@@ -608,7 +608,7 @@
    = return ( [], ["-fomit-frame-pointer"] )

    | prefixMatch "mips"    cTARGETPLATFORM
-   = return ( ["-static"], [] )
+   = return ( ["-mlong-calls"], [] )

    | prefixMatch "sparc"    cTARGETPLATFORM
    = return ( [], ["-w"] )

_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to