1. 11 Oct, 2004 5 commits
  2. 09 Oct, 2004 1 commit
  3. 08 Oct, 2004 10 commits
  4. 07 Oct, 2004 4 commits
    • simonpj's avatar
      [project @ 2004-10-07 16:08:36 by simonpj] · e794c5cc
      simonpj authored
      Wibbles to hi-boot files and newtypes
      e794c5cc
    • wolfgang's avatar
      [project @ 2004-10-07 15:54:03 by wolfgang] · b4d045ae
      wolfgang authored
      Position Independent Code and Dynamic Linking Support, Part 1
      
      This commit allows generation of position independent code (PIC) that fully supports dynamic linking on Mac OS X and PowerPC Linux.
      Other platforms are not yet supported, and there is no support for actually linking or using dynamic libraries - so if you use the -fPIC or -dynamic code generation flags, you have to type your (platform-specific) linker command lines yourself.
      
      
      nativeGen/PositionIndependentCode.hs:
      New file. Look here for some more comments on how this works.
      
      cmm/CLabel.hs:
      Add support for DynamicLinkerLabels and PIC base labels - for use inside the NCG.
      needsCDecl: Case alternative labels now need C decls, see the codeGen/CgInfoTbls.hs below for details
      
      cmm/Cmm.hs:
      Add CmmPicBaseReg (used in NCG),
      and CmmLabelDiffOff (used in NCG and for offsets in info tables)
      
      cmm/CmmParse.y:
      support offsets in info tables
      
      cmm/PprC.hs:
      support CmmLabelDiffOff
      Case alternative labels now need C decls (see the codeGen/CgInfoTbls.hs for details), so we need to pprDataExterns for info tables.
      
      cmm/PprCmm.hs:
      support CmmLabelDiffOff
      
      codeGen/CgInfoTbls.hs:
      no longer store absolute addresses in info tables, instead, we store offsets.
      Also, for vectored return points, emit the alternatives _after_ the vector table. This is to work around a limitation in Apple's as, which refuses to handle label differences where one label is at the end of a section. Emitting alternatives after vector info tables makes sure this never happens in GHC generated code. Case alternatives now require prototypes in hc code, though (see changes in PprC.hs, CLabel.hs).
      
      main/CmdLineOpts.lhs:
      Add a new option, -fPIC.
      
      main/DriverFlags.hs:
      Pass the correct options for PIC to gcc, depending on the platform. Only for powerpc for now.
      
      nativeGen/AsmCodeGen.hs:
      Many changes...
      Mac OS X-specific management of import stubs is no longer, it's now part of a general mechanism to handle such things for all platforms that need it (Darwin [both ppc and x86], Linux on ppc, and some platforms we don't support).
      Move cmmToCmm into its own monad which can accumulate a list of imported symbols. Make it call cmmMakeDynamicReference at the right places.
      
      nativeGen/MachCodeGen.hs:
      nativeGen/MachInstrs.hs:
      nativeGen/MachRegs.lhs:
      nativeGen/PprMach.hs:
      nativeGen/RegAllocInfo.hs:
      Too many changes to enumerate here, PowerPC specific.
      
      nativeGen/NCGMonad.hs:
      NatM still tracks imported symbols, as more labels can be created during code generation (float literals, jump tables; on some platforms all data access has to go through the dynamic linking mechanism).
      
      driver/mangler/ghc-asm.lprl:
      Mangle absolute addresses in info tables to offsets.
      Correctly pass through GCC-generated PIC for Mac OS X and powerpc linux.
      
      includes/Cmm.h:
      includes/InfoTables.h:
      includes/Storage.h:
      includes/mkDerivedConstants.c:
      rts/GC.c:
      rts/GCCompact.c:
      rts/HeapStackCheck.cmm:
      rts/Printer.c:
      rts/RetainerProfile.c:
      rts/Sanity.c:
      Adapt to the fact that info tables now contain offsets.
      
      rts/Linker.c:
      Mac-specific: change machoInitSymbolsWithoutUnderscore to support PIC.
      b4d045ae
    • mthomas's avatar
      [project @ 2004-10-07 06:38:20 by mthomas] · a558bffd
      mthomas authored
      Check for shell scripts first - they don't exist on my Windows nightly build.
      a558bffd
    • dons's avatar
      [project @ 2004-10-07 03:19:51 by dons] · 82a610f1
      dons authored
      Need suffix.mk, otherwise .hc bootstrapping dies in ghc/compiler, with
      "No rule to make target Foo.o" error.
      82a610f1
  5. 06 Oct, 2004 2 commits
  6. 05 Oct, 2004 2 commits
  7. 04 Oct, 2004 7 commits
    • simonpj's avatar
      [project @ 2004-10-04 15:51:00 by simonpj] · f469905a
      simonpj authored
      ------------------------------------
      	Part-fix an awkward interaction
      	between case-of-case and GADTs
      	------------------------------------
      
      Consider
      	data T a where
      	  MkT :: a -> b -> T a
      
      	f = /\a. \(w::a).
      	   case (case ...) of
      		  MkT a' b (p::a') (q::b) -> [p,w]
      
      The danger is that we'll make a join point
      
      	j a' p = [p,w]
      
      and that's ill-typed, because (p::a') but (w::a).
      
      Solution so far: don't abstract over a', because the type refinement
      maps [a' -> a] .  Ultimately that won't work when real refinement goes on.
      
      Then we must abstract over any refined free variables.  Hmm.  Maybe we
      could just abstract over *all* free variables, thereby lambda-lifting
      the join point?   We should try this.
      f469905a
    • simonpj's avatar
      [project @ 2004-10-04 09:35:08 by simonpj] · 3b7d2756
      simonpj authored
      Sort decls in cycle for error message
      3b7d2756
    • simonpj's avatar
      [project @ 2004-10-04 09:28:00 by simonpj] · ae0b2a9e
      simonpj authored
      Better reporting of duplicate top-level defns
      ae0b2a9e
    • simonpj's avatar
      [project @ 2004-10-04 09:27:32 by simonpj] · 864388a3
      simonpj authored
      Make combineSrcSpans commutative
      864388a3
    • simonpj's avatar
      [project @ 2004-10-04 09:11:09 by simonpj] · a022fe50
      simonpj authored
      Improve error locations for binding conflicts
      a022fe50
    • dons's avatar
      [project @ 2004-10-04 05:54:04 by dons] · 870b2298
      dons authored
      Warning police. Move prototype of genericRaise into RtsExternal.h, so
      the libraries can see it.
      870b2298
    • wolfgang's avatar
      [project @ 2004-10-04 03:37:22 by wolfgang] · 004ecb39
      wolfgang authored
      Mac OS X:
      Make the Linker deal properly with object files that lack a symbol table or
      a dynamic symbol table.
      Objects that don't import any symbols don't get a dynamic symbol table,
      which caused GHCi to crash.
      
      MERGE TO STABLE
      004ecb39
  8. 03 Oct, 2004 7 commits
    • panne's avatar
      [project @ 2004-10-03 17:13:34 by panne] · 97417a39
      panne authored
      Warning police (added missing #include)
      97417a39
    • panne's avatar
      [project @ 2004-10-03 16:50:53 by panne] · 66dda5a5
      panne authored
      Warning police (bring 'raise' into scope)
      66dda5a5
    • panne's avatar
      [project @ 2004-10-03 16:50:01 by panne] · ca068e74
      panne authored
      Synched with latest GHC #include changes: Add '.' to the #include path manually.
      ca068e74
    • panne's avatar
      [project @ 2004-10-03 16:37:42 by panne] · 6f44f99a
      panne authored
      Warning police
      6f44f99a
    • panne's avatar
      [project @ 2004-10-03 16:28:02 by panne] · b89ad0e9
      panne authored
      Improved #include path handling:
      
      * Don't use '-I-', it breaks a lot of system headers, e.g.
      
           #include <GL/glut.h>
      
        fails (when using freeglut), because /usr/include/GL/glut.h contains
      
           #include "freeglut_std.h"
      
        but /usr/include/GL/freeglut_std.h will not be found. It is a bit
        debatable if the header is broken and should use
      
           #include "GL/freeglut_std.h"
      
        instead. Anyway, a grep through the SuSE 9.1 system headers shows that
        there seems to be no real common practice, so let's play safe and don't
        use '-I-'.
      
      * Don't use '-I .', #include stub headers "locally" instead, e.g. use
      
           #include "Concurrent_stub.h"
      
        instead of
      
           #include "Control/Concurrent_stub.h"
      
        Note that "Control" is still in the #include path, because the *.hc file
        is normally in /tmp and the stub header is in the directory where *.hs
        is. We could remove this path element, too, if the stub header would be
        copied to the directory of the *.hc file during compilation. SimonM?
      b89ad0e9
    • ross's avatar
      [project @ 2004-10-03 16:17:08 by ross] · df87e59e
      ross authored
      spelling
      df87e59e
    • dons's avatar
      [project @ 2004-10-03 02:04:29 by dons] · c61f8941
      dons authored
      Make sure genericRaise symbol is defined on all platforms, so Linker.c
      won't complain, even if they don't actually use it.
      c61f8941
  9. 02 Oct, 2004 2 commits
    • wolfgang's avatar
      [project @ 2004-10-02 15:12:48 by wolfgang] · 65fd4516
      wolfgang authored
      Deal with Apple's broken cpp 3.3 (you know, the one that inserts useless
      #pragma lines into it's output) by filtering it's output through
      grep -v.
      This shouldn't be a problem for other platforms, and it's much simpler
      than to make the parsers for ghc-pkg, genprimopcode and happy ignore
      those lines.
      
      MERGE TO STABLE
      65fd4516
    • dons's avatar
      [project @ 2004-10-02 07:32:25 by dons] · 20d697a1
      dons authored
      When linking against libpthreads, raise(3) can behave strangely on
      some platforms (OpenBSD at least, maybe other BSDs, not Linux). So use
      pthread_kill() to generate signals when running the threaded rts,
      instead of raise(), when System.Posix.Signals.raiseSignal is called.
      
      raiseSignal will call genericRaise, in the rts, which knows which
      function to use.
      20d697a1