1. 04 Sep, 2007 1 commit
  2. 03 Sep, 2007 1 commit
  3. 01 Sep, 2007 1 commit
  4. 21 Aug, 2007 1 commit
  5. 10 Aug, 2007 1 commit
    • Simon Marlow's avatar
      FIX #1271: create manifests, and embed them in executables on Windows · eb4352ab
      Simon Marlow authored
      We have 4 new flags:
      
        -fno-gen-manifest
           suppresses creation of foo.exe.manifest
      
        -fno-embed-manifest
           suppresses embedding of the manifest in the executable
      
        -pgmwindres
           specify a program to use instead of windres
      
        -optwindres
           extra options to pass to windres
      
      "windres" is now copied from mingw and included in a binary
      distribution.
      eb4352ab
  6. 21 Aug, 2007 1 commit
    • Simon Marlow's avatar
      FIX #1427, #1569: gcc 4.2.x needs -fno-toplevel-reorder · 2ebe8add
      Simon Marlow authored
      We now have various flags that need to be passed to gcc, but only if
      the local gcc version supports them.  So instead of wiring this
      knowledge into ghc when it is built, we now put these "extra gcc
      flags" into a text file in $libdir, extra-gcc-flags, which is created
      by configure.  It is also created by the configure script of a binary
      distribution, so a binary dist is independent of the gcc version used
      to build it.
      
      Hopefully I got the binary-dist stuff right, but binary dists aren't
      currently working so we'll need to come back and check this.
      2ebe8add
  7. 07 Aug, 2007 1 commit
  8. 03 Aug, 2007 1 commit
    • Simon Marlow's avatar
      FIX part of #1372, improvements to the recompilation checker · de21f53e
      Simon Marlow authored
      This patch adds a check that each imported module is listed in
      the dependencies from the previous interface.  It catches the
      following cases and forces recompilation:
         - an exposed package has been upgraded
         - we are compiling with different package flags
         - a home module that was shadowing a package module has been removed
         - a new home module has been added that shadows a package module
      
      I haven't yet added the package timestamping as described in #1372.
      de21f53e
  9. 01 Aug, 2007 1 commit
  10. 17 Jul, 2007 1 commit
  11. 19 Jul, 2007 1 commit
  12. 27 Jun, 2007 2 commits
  13. 10 May, 2007 1 commit
  14. 16 Apr, 2007 1 commit
  15. 11 Apr, 2007 1 commit
    • Simon Marlow's avatar
      Rationalise GhcMode, HscTarget and GhcLink · 3c22606b
      Simon Marlow authored
      This patch cleans up the GHC API, and adds some functionality: we can
      now compile to object code inside GHCi.
      
      Previously we had:
      
        data GhcMode
          = BatchCompile
          | Interactive
          | OneShot
          | JustTypecheck
          | MkDepend
        
        data HscTarget
          = HscC
          | HscAsm
          | HscJava
          | HscInterpreted
          | HscNothing
      
      There was redundancy here; if GhcMode is Interactive, then only
      HscInterpreted makes sense, and JustTypecheck required HscNothing.
      Now we have:
      
        data GhcMode
          = CompManager       -- ^ --make, GHCi, etc.
          | OneShot           -- ^ ghc -c Foo.hs
          | MkDepend          -- ^ ghc -M, see Finder for why we need this
      
      and HscTarget remains as before.
      
      Previously GhcLink looked like this:
      
        data GhcLink = NoLink | StaticLink
      
      Now we have:
      
        data GhcLink = NoLink | LinkBinary | LinkInMemory
      
      The idea being that you can have an HscTarget of HscAsm (for example)
      and still link in memory.
      
      There are two new flags:
      
        -fobject-code selects object code as the target (selects
                      either -fasm or -fvia-C, whichever is the default)
                      This can be usd with ':set' in GHCi, or on the command line.
      
        -fbyte-code   sets byte-code as the target.  Only works in GHCi.
                      One day maybe this could save the byte code in a file
                      when used outside GHCi.
      
        (names chosen for consistency with -fno-code).
      
      Changes to the GHC API: newSession no longer takes the GhcMode
      argument.  The GhcMode defaults to CompManager, which is usually what
      you want.  To do JustTypecheck now, just set hscTarget to HscNothing.
      3c22606b
  16. 08 Mar, 2007 1 commit
  17. 01 Mar, 2007 1 commit
  18. 15 Feb, 2007 1 commit
    • Simon Marlow's avatar
      When the pipeline just copies the file, prepend a LINE pragma · cf411c9a
      Simon Marlow authored
      For example, "ghc -E Foo.hs -o Foo.bar" just copies Foo.hs to
      Foo.bar.  This patch adds a LINE pragma to the beginning of Foo.bar so
      that further processing can track the location of the original file.
      
      The motiviation for this is bug #1044.  When generating Haddock docs,
      we preprocess the .hs to a .raw-hs, sometimes this doesn't involve any
      actual preprocessing and in those cases we lose track of the original
      filename.
      cf411c9a
  19. 15 Jan, 2007 1 commit
  20. 19 Oct, 2006 1 commit
  21. 11 Oct, 2006 1 commit
  22. 27 Jul, 2006 1 commit
  23. 27 Sep, 2006 1 commit
  24. 19 Sep, 2006 1 commit
    • Simon Marlow's avatar
      Packages cleanup, and allow new packages to be loaded with :set again · ee565d46
      Simon Marlow authored
      This cleans up the package subsystem a little.  There are some
      changes to the GHC API as a result.
      
        - GHC.init and GHC.initFromArgs are no longer necessary.
      
        - GHC.newSession takes the root of the GHC tree as an argument
          (previously passed to GHC.init).
      
        - You *must* do GHC.setSessionDynFlags after GHC.newSession,
          this is what loads the package database.
      
        - Several global vars removed from SysTools
      
        - The :set command in GHCi can now cause new packages to be loaded,
          or can hide/ignore existing packages.
      ee565d46
  25. 25 Aug, 2006 1 commit
    • rl@cse.unsw.edu.au's avatar
      Make sure GCC uses the Sparc V9 instruction set · 1777f480
      rl@cse.unsw.edu.au authored
      We only support Sparc V9 and better as V8 lacks an atomic CAS instruction
      which we need for SMP. This means that we have to pass -mcpu=v9 to GCC when
      compiling and assembling. Hardcoding the flag is hackish but seems to be
      our best bet at the moment. It can still be overridden by the user as GCC
      picks the best -mcpu flag regardless of the ordering.
      1777f480
  26. 09 Jul, 2006 1 commit
  27. 25 Jul, 2006 1 commit
    • Simon Marlow's avatar
      Generalise Package Support · 61d2625a
      Simon Marlow authored
      This patch pushes through one fundamental change: a module is now
      identified by the pair of its package and module name, whereas
      previously it was identified by its module name alone.  This means
      that now a program can contain multiple modules with the same name, as
      long as they belong to different packages.
      
      This is a language change - the Haskell report says nothing about
      packages, but it is now necessary to understand packages in order to
      understand GHC's module system.  For example, a type T from module M
      in package P is different from a type T from module M in package Q.
      Previously this wasn't an issue because there could only be a single
      module M in the program.
      
      The "module restriction" on combining packages has therefore been
      lifted, and a program can contain multiple versions of the same
      package.
      
      Note that none of the proposed syntax changes have yet been
      implemented, but the architecture is geared towards supporting import
      declarations qualified by package name, and that is probably the next
      step.
      
      It is now necessary to specify the package name when compiling a
      package, using the -package-name flag (which has been un-deprecated).
      Fortunately Cabal still uses -package-name.
      
      Certain packages are "wired in".  Currently the wired-in packages are:
      base, haskell98, template-haskell and rts, and are always referred to
      by these versionless names.  Other packages are referred to with full
      package IDs (eg. "network-1.0").  This is because the compiler needs
      to refer to entities in the wired-in packages, and we didn't want to
      bake the version of these packages into the comiler.  It's conceivable
      that someone might want to upgrade the base package independently of
      GHC.
      
      Internal changes:
      
        - There are two module-related types:
      
              ModuleName      just a FastString, the name of a module
              Module          a pair of a PackageId and ModuleName
      
          A mapping from ModuleName can be a UniqFM, but a mapping from Module
          must be a FiniteMap (we provide it as ModuleEnv).
      
        - The "HomeModules" type that was passed around the compiler is now
          gone, replaced in most cases by the current package name which is
          contained in DynFlags.  We can tell whether a Module comes from the
          current package by comparing its package name against the current
          package.
      
        - While I was here, I changed PrintUnqual to be a little more useful:
          it now returns the ModuleName that the identifier should be qualified
          with according to the current scope, rather than its original
          module.  Also, PrintUnqual tells whether to qualify module names with
          package names (currently unused).
      
      Docs to follow.
      61d2625a
  28. 11 Jun, 2006 1 commit
  29. 07 Apr, 2006 1 commit
    • Simon Marlow's avatar
      Reorganisation of the source tree · 0065d5ab
      Simon Marlow authored
      Most of the other users of the fptools build system have migrated to
      Cabal, and with the move to darcs we can now flatten the source tree
      without losing history, so here goes.
      
      The main change is that the ghc/ subdir is gone, and most of what it
      contained is now at the top level.  The build system now makes no
      pretense at being multi-project, it is just the GHC build system.
      
      No doubt this will break many things, and there will be a period of
      instability while we fix the dependencies.  A straightforward build
      should work, but I haven't yet fixed binary/source distributions.
      Changes to the Building Guide will follow, too.
      0065d5ab
  30. 06 Apr, 2006 1 commit
  31. 18 Mar, 2006 2 commits
    • David Himmelstrup's avatar
      -fno-code shouldn't be a mode. · 851154f0
      David Himmelstrup authored
      I've removed -fno-code from Main to make it work
      equally well with --make and -c.
      I've also allowed it not to write hi files unless
      -fwrite-iface is given.
      851154f0
    • David Himmelstrup's avatar
      -fno-code shouldn't be a mode. · 4a3042fc
      David Himmelstrup authored
      I've removed -fno-code from Main to make it work
      equally well with --make and -c.
      I've also allowed it not to write hi files unless
      -fwrite-iface is given.
      4a3042fc
  32. 12 Mar, 2006 1 commit
  33. 10 Mar, 2006 1 commit
    • David Himmelstrup's avatar
      Parse OPTIONS properly and cache the result. · d700953c
      David Himmelstrup authored
      Use the lexer to parse OPTIONS, LANGUAGE and INCLUDE pragmas.
      This gives us greater flexibility and far better error
      messages. However, I had to make a few quirks:
        * The token parser is written manually since Happy doesn't
          like lexer errors (we need to extract options before the
          buffer is passed through 'cpp'). Still better than
          manually parsing a String, though.
        * The StringBuffer API has been extended so files can be
          read in blocks.
      I also made a new field in ModSummary called ms_hspp_opts
      which stores the updated DynFlags. Oh, and I took the liberty
      of moving 'getImports' into HeaderInfo together with
      'getOptions'.
      d700953c
  34. 07 Mar, 2006 1 commit
    • David Himmelstrup's avatar
      More work thrown at HscMain. · d1545b69
      David Himmelstrup authored
      MkIface.writeIfaceFile doesn't check GhcMode anymore. All it does
      is what the name say: write an interface to disk.
      I've refactored HscMain so the logic is easier to manage. That means
      we can avoid running the simplifier when typechecking (: And best of
      all, HscMain doesn't use GhcMode at all, anymore!
      
      The new HscMain intro looks like this:
      
      It's the task of the compilation proper to compile Haskell, hs-boot and
      core files to either byte-code, hard-code (C, asm, Java, ect) or to
      nothing at all (the module is still parsed and type-checked. This
      feature is mostly used by IDE's and the likes).
      Compilation can happen in either 'one-shot', 'batch', 'nothing',
      or 'interactive' mode. 'One-shot' mode targets hard-code, 'batch' mode
      targets hard-code, 'nothing' mode targets nothing and 'interactive' mode
      targets byte-code.
      The modes are kept separate because of their different types and meanings.
      In 'one-shot' mode, we're only compiling a single file and can therefore
      discard the new ModIface and ModDetails. This is also the reason it only
      targets hard-code; compiling to byte-code or nothing doesn't make sense
      when we discard the result.
      'Batch' mode is like 'one-shot' except that we keep the resulting ModIface
      and ModDetails. 'Batch' mode doesn't target byte-code since that require
      us to return the newly compiled byte-code.
      'Nothing' mode has exactly the same type as 'batch' mode but they're still
      kept separate. This is because compiling to nothing is fairly special: We
      don't output any interface files, we don't run the simplifier and we don't
      generate any code.
      'Interactive' mode is similar to 'batch' mode except that we return the
      compiled byte-code together with the ModIface and ModDetails.
      d1545b69
  35. 04 Mar, 2006 3 commits
  36. 02 Mar, 2006 1 commit
    • Simon Marlow's avatar
      Make -split-objs work with --make · ec968a32
      Simon Marlow authored
      This turned out to be a lot easier than I thought.  Just moving a few
      bits of -split-objs support from the build system into the compiler
      was enough.  The only thing that Cabal needs to do in order to support
      -split-objs now is to pass the names of the split objects rather than
      the monolithic ones to 'ar'.
      ec968a32