1. 31 Mar, 2003 2 commits
    • simonmar's avatar
      [project @ 2003-03-31 14:02:32 by simonmar] · 9d431e08
      simonmar authored
      On 32-bit platforms, add a bunch of symbols from libgcc.a used to
      support 64-bit arithmetic.
      
      It looks like these symbols are defined in libc on some platforms but
      not others, but it shouldn't do any harm to include them in the list
      of symbols that the linker knows about even if they're also in libc.
      They were already included for some platforms (cygwin, mingw, and
      darwin), this commit just includes then whenever we're compiling with
      gcc on a 32-bit platform.
      9d431e08
    • simonmar's avatar
      [project @ 2003-03-31 12:35:21 by simonmar] · 1f927e8f
      simonmar authored
      Include NetBSD support
      
      Submitted by: Urban Boquist <boquist@crt.se>
      1f927e8f
  2. 25 Mar, 2003 1 commit
    • sof's avatar
      [project @ 2003-03-25 17:58:47 by sof] · 2548429c
      sof authored
      to ease replacement of the underlying allocator used by stgMallocBytes() and friends, provide (&use) RtsUtils.c:stgFree()
      2548429c
  3. 21 Feb, 2003 1 commit
    • sof's avatar
      [project @ 2003-02-21 05:34:12 by sof] · 5b4f5a6a
      sof authored
      Asynchronous / non-blocking I/O for Win32 platforms.
      
      This commit introduces a Concurrent Haskell friendly view of I/O on
      Win32 platforms. Through the use of a pool of worker Win32 threads, CH
      threads may issue asynchronous I/O requests without blocking the
      progress of other CH threads. The issuing CH thread is blocked until
      the request has been serviced though.
      
      GHC.Conc exports the primops that take care of issuing the
      asynchronous I/O requests, which the IO implementation now takes
      advantage of. By default, all Handles are non-blocking/asynchronous,
      but should performance become an issue, having a per-Handle flag for
      turning off non-blocking could easily be imagined&introduced.
      
      [Incidentally, this thread pool-based implementation could easily be
      extended to also allow Haskell code to delegate the execution of
      arbitrary pieces of (potentially blocking) external code to another OS
      thread. Given how relatively gnarly the locking story has turned out
      to be with the 'threaded' RTS, that may not be such a bad idea.]
      5b4f5a6a
  4. 10 Feb, 2003 2 commits
    • wolfgang's avatar
      [project @ 2003-02-10 23:35:03 by wolfgang] · 8115ed09
      wolfgang authored
      Mac OS X:
      add one more relocation type (PPC_RELOC_BR24)
      and add more C run-time library symbols to the symbol table
      (made more difficult by the fact that these symbols don't
      have an underscore prefix, while everything else on Mac OS X has)
      8115ed09
    • simonmar's avatar
      [project @ 2003-02-10 10:41:52 by simonmar] · 84370d93
      simonmar authored
      Add some missing symbols.
      
      Should fix several recent test breakages with GHCi.
      84370d93
  5. 29 Jan, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-01-29 09:54:31 by simonmar] · b1c5d8c6
      simonmar authored
      - re-instate setProgArgv, it is used in System.Environment (bah, could
        have sworn I grepped for it and found nothing...)
      
      - Remove init_stack symbol from the Linker's symbol table; this is
        now static.
      b1c5d8c6
  6. 28 Jan, 2003 1 commit
  7. 13 Jan, 2003 1 commit
  8. 27 Dec, 2002 1 commit
  9. 19 Dec, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-12-19 14:33:22 by simonmar] · 0d27d151
      simonmar authored
      Terrible hack to restore CAF handling behaviour in GHCi (it's
      currently broken).
      
      The story used to be this: in newCAF(), if the CAF is in dynamically
      loaded code, then we save the CAF's info ptr in a spare slot in the
      closure, and add the CAF to the caf_list.  The GC will retain
      everything on the caf_list.  At any point the CAFs can all be reverted
      by replacing their info pointers from the saved copies.
      
      CAFs need to be retained for GHCi because they might be required in a
      future execution; an optimisation would be to avoid retaining the CAFs
      if we're in "revert mode"; i.e. the CAFs are all going to be reverted
      after execution anyway.  Also, this only applies to CAFs in compiled
      code; CAFs in interpreted code are currently always retained.
      
      Anyway, the old story is harder now that I removed the code that
      checks whether a pointer is dynamically loaded or not (:-)).  Rather
      than re-instate that code, I created a new version of newCAF
      (newDynCAF), and arranged that the dynamic linker redirects any
      references to newCAF to point to newDynCAF instead.  The result is
      more efficient than before, and takes less code.
      0d27d151
  10. 11 Dec, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-12-11 15:36:20 by simonmar] · 0bffc410
      simonmar authored
      Merge the eval-apply-branch on to the HEAD
      ------------------------------------------
      
      This is a change to GHC's evaluation model in order to ultimately make
      GHC more portable and to reduce complexity in some areas.
      
      At some point we'll update the commentary to describe the new state of
      the RTS.  Pending that, the highlights of this change are:
      
        - No more Su.  The Su register is gone, update frames are one
          word smaller.
      
        - Slow-entry points and arg checks are gone.  Unknown function calls
          are handled by automatically-generated RTS entry points (AutoApply.hc,
          generated by the program in utils/genapply).
      
        - The stack layout is stricter: there are no "pending arguments" on
          the stack any more, the stack is always strictly a sequence of
          stack frames.
      
          This means that there's no need for LOOKS_LIKE_GHC_INFO() or
          LOOKS_LIKE_STATIC_CLOSURE() any more, and GHC doesn't need to know
          how to find the boundary between the text and data segments (BIG WIN!).
      
        - A couple of nasty hacks in the mangler caused by the neet to
          identify closure ptrs vs. info tables have gone away.
      
        - Info tables are a bit more complicated.  See InfoTables.h for the
          details.
      
        - As a side effect, GHCi can now deal with polymorphic seq.  Some bugs
          in GHCi which affected primitives and unboxed tuples are now
          fixed.
      
        - Binary sizes are reduced by about 7% on x86.  Performance is roughly
          similar, some programs get faster while some get slower.  I've seen
          GHCi perform worse on some examples, but haven't investigated
          further yet (GHCi performance *should* be about the same or better
          in theory).
      
        - Internally the code generator is rather better organised.  I've moved
          info-table generation from the NCG into the main codeGen where it is
          shared with the C back-end; info tables are now emitted as arrays
          of words in both back-ends.  The NCG is one step closer to being able
          to support profiling.
      
      This has all been fairly thoroughly tested, but no doubt I've messed
      up the commit in some way.
      0bffc410
  11. 23 Oct, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-10-23 08:52:26 by simonmar] · d12023f5
      simonmar authored
      Add atomicModifyIORefzh_fast symbol (should have been done with the
      rest of the atomicModifyIORef# commit, thanks to Manuel Chakravarty
      for pointing out the problem).
      d12023f5
  12. 12 Oct, 2002 1 commit
    • wolfgang's avatar
      [project @ 2002-10-12 23:12:08 by wolfgang] · 31442604
      wolfgang authored
      Make the Mac OS X build use the HaskellSupport.framework (a MacOS-style "framework" that includes the required libraries libgmp and dlcompat) if it is present. The HaskellSupport.framework is not yet in CVS, but is available from me.
      31442604
  13. 02 Oct, 2002 1 commit
  14. 13 Sep, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-09-13 15:02:25 by simonpj] · 9af77fa4
      simonpj authored
      --------------------------------------
      	Make Template Haskell into the HEAD
      	--------------------------------------
      
      This massive commit transfers to the HEAD all the stuff that
      Simon and Tim have been doing on Template Haskell.  The
      meta-haskell-branch is no more!
      
      WARNING: make sure that you
      
        * Update your links if you are using link trees.
          Some modules have been added, some have gone away.
      
        * Do 'make clean' in all library trees.
          The interface file format has changed, and you can
          get strange panics (sadly) if GHC tries to read old interface files:
          e.g.  ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
      	  Binary.get(TyClDecl): ForeignType
      
        * You need to recompile the rts too; Linker.c has changed
      
      
      However the libraries are almost unaltered; just a tiny change in
      Base, and to the exports in Prelude.
      
      
      NOTE: so far as TH itself is concerned, expression splices work
      fine, but declaration splices are not complete.
      
      
      		---------------
      		The main change
      		---------------
      
      The main structural change: renaming and typechecking have to be
      interleaved, because we can't rename stuff after a declaration splice
      until after we've typechecked the stuff before (and the splice
      itself).
      
      * Combine the renamer and typecheker monads into one
      	(TcRnMonad, TcRnTypes)
        These two replace TcMonad and RnMonad
      
      * Give them a single 'driver' (TcRnDriver).  This driver
        replaces TcModule.lhs and Rename.lhs
      
      * The haskell-src library package has a module
      	Language/Haskell/THSyntax
        which defines the Haskell data type seen by the TH programmer.
      
      * New modules:
      	hsSyn/Convert.hs 	converts THSyntax -> HsSyn
      	deSugar/DsMeta.hs 	converts HsSyn -> THSyntax
      
      * New module typecheck/TcSplice type-checks Template Haskell splices.
      
      		-------------
      		Linking stuff
      		-------------
      
      * ByteCodeLink has been split into
      	ByteCodeLink	(which links)
      	ByteCodeAsm	(which assembles)
      
      * New module ghci/ObjLink is the object-code linker.
      
      * compMan/CmLink is removed entirely (was out of place)
        Ditto CmTypes (which was tiny)
      
      * Linker.c initialises the linker when it is first used (no need to call
        initLinker any more).  Template Haskell makes it harder to know when
        and whether to initialise the linker.
      
      
      	-------------------------------------
      	Gathering the LIE in the type checker
      	-------------------------------------
      
      * Instead of explicitly gathering constraints in the LIE
      	tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE)
        we now dump the constraints into a mutable varabiable carried
        by the monad, so we get
      	tcExpr :: RenamedExpr -> TcM TypecheckedExpr
      
        Much less clutter in the code, and more efficient too.
        (Originally suggested by Mark Shields.)
      
      
      		-----------------
      		Remove "SysNames"
      		-----------------
      
      Because the renamer and the type checker were entirely separate,
      we had to carry some rather tiresome implicit binders (or "SysNames")
      along inside some of the HsDecl data structures.  They were both
      tiresome and fragile.
      
      Now that the typechecker and renamer are more intimately coupled,
      we can eliminate SysNames (well, mostly... default methods still
      carry something similar).
      
      		-------------
      		Clean up HsPat
      		-------------
      
      One big clean up is this: instead of having two HsPat types (InPat and
      OutPat), they are now combined into one.  This is more consistent with
      the way that HsExpr etc is handled; there are some 'Out' constructors
      for the type checker output.
      
      So:
      	HsPat.InPat	--> HsPat.Pat
      	HsPat.OutPat	--> HsPat.Pat
      	No 'pat' type parameter in HsExpr, HsBinds, etc
      
      	Constructor patterns are nicer now: they use
      		HsPat.HsConDetails
      	for the three cases of constructor patterns:
      		prefix, infix, and record-bindings
      
      	The *same* data type HsConDetails is used in the type
      	declaration of the data type (HsDecls.TyData)
      
      Lots of associated clean-up operations here and there.  Less code.
      Everything is wonderful.
      9af77fa4
  15. 05 Sep, 2002 1 commit
  16. 16 Aug, 2002 1 commit
  17. 18 Jul, 2002 1 commit
  18. 17 Jul, 2002 1 commit
  19. 08 Jul, 2002 1 commit
  20. 02 Jul, 2002 1 commit
  21. 15 Jun, 2002 1 commit
  22. 12 Jun, 2002 1 commit
    • wolfgang's avatar
      [project @ 2002-06-12 22:29:43 by wolfgang] · f55855f2
      wolfgang authored
      Initial support for GHCi on MacOS X.
      The code still has problems with global variables in compiled C code, but
      it _seems_ to work OK for GHC-compiled code. Many error checks are still
      missing.
      f55855f2
  23. 11 Jun, 2002 1 commit
  24. 10 Jun, 2002 1 commit
  25. 09 Jun, 2002 2 commits
  26. 04 Jun, 2002 1 commit
  27. 01 May, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-05-01 15:46:14 by simonmar] · 786db576
      simonmar authored
      Cleanup and overhaul the bogus dynamic library loading code in
      InteractiveUI.  Bugs fixed:
      
        - when linking in extra_libraries from a package,
          we now search library_paths in addition to the default
          dlopen() paths.
      
        - the path-searching machinery for dynamic libraries specified
          on the command line was broken, it didn't work unless the library
          was found on the first path in the list.
      786db576
  28. 23 Apr, 2002 1 commit
  29. 10 Apr, 2002 1 commit
    • stolz's avatar
      [project @ 2002-04-10 11:43:43 by stolz] · c1f3fad1
      stolz authored
      Two new scheduler-API primops:
      
      1) GHC.Conc.forkProcess/forkProcess# :: IO Int
         This is a low-level call to fork() to replace Posix.forkProcess().
         In a Concurrent Haskell setting, only the thread invoking forkProcess()
         is alive in the child process. Other threads will be GC'ed!
            This brings the RTS closer to pthreads, where a call to fork()
         doesn't clone any pthreads, either.
            The result is 0 for the child and the child's pid for the parent.
         The primop will barf() when used on mingw32, sorry.
      
      2) GHC.Conc.labelThread/forkProcess# :: String -> IO ()
         Useful for scheduler debugging: If the RTS is compiled with DEBUGging
         support, this primitive assigns a name to the current thread which
         will be used in debugging output (+RTS -D1). For larger applications,
         simply numbering threads is not sufficient.
           Notice: The Haskell side of this call is always available, but if
         you are not compiling with debugging support, the actual primop will
         turn into a no-op.
      c1f3fad1
  30. 01 Apr, 2002 1 commit
  31. 29 Mar, 2002 1 commit
    • krasimir's avatar
      [project @ 2002-03-29 20:46:50 by krasimir] · 57f83897
      krasimir authored
      Latest Win32 implementation allows dynamic loading only for *.dll libraries. This commit add checking for *.drv libraries (drivers). This allows loading of winspool.drv needed for ObjectIO
      57f83897
  32. 25 Mar, 2002 1 commit
  33. 12 Feb, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-02-12 15:17:13 by simonmar] · 2cc5b907
      simonmar authored
      Switch over to the new hierarchical libraries
      ---------------------------------------------
      
      This commit reorganises our libraries to use the new hierarchical
      module namespace extension.
      
      The basic story is this:
      
         - fptools/libraries contains the new hierarchical libraries.
           Everything in here is "clean", i.e. most deprecated stuff has
           been removed.
      
      	- fptools/libraries/base is the new base package
      	  (replacing "std") and contains roughly what was previously
      	  in std, lang, and concurrent, minus deprecated stuff.
      	  Things that are *not allowed* in libraries/base include:
      		Addr, ForeignObj, ByteArray, MutableByteArray,
      		_casm_, _ccall_, ``'', PrimIO
      
      	  For ByteArrays and MutableByteArrays we use UArray and
      	  STUArray/IOUArray respectively now.
      
      	  Modules previously called PrelFoo are now under
      	  fptools/libraries/GHC.  eg. PrelBase is now GHC.Base.
      
      	- fptools/libraries/haskell98 provides the Haskell 98 std.
      	  libraries (Char, IO, Numeric etc.) as a package.  This
      	  package is enabled by default.
      
      	- fptools/libraries/network is a rearranged version of
      	  the existing net package (the old package net is still
      	  available; see below).
      
      	- Other packages will migrate to fptools/libraries in
      	  due course.
      
           NB. you need to checkout fptools/libraries as well as
           fptools/hslibs now.  The nightly build scripts will need to be
           tweaked.
      
         - fptools/hslibs still contains (almost) the same stuff as before.
           Where libraries have moved into the new hierarchy, the hslibs
           version contains a "stub" that just re-exports the new version.
           The idea is that code will gradually migrate from fptools/hslibs
           into fptools/libraries as it gets cleaned up, and in a version or
           two we can remove the old packages altogether.
      
         - I've taken the opportunity to make some changes to the build
           system, ripping out the old hslibs Makefile stuff from
           mk/target.mk; the new package building Makefile code is in
           mk/package.mk (auto-included from mk/target.mk).
      
           The main improvement is that packages now register themselves at
           make boot time using ghc-pkg, and the monolithic package.conf
           in ghc/driver is gone.
      
           I've updated the standard packages but haven't tested win32,
           graphics, xlib, object-io, or OpenGL yet.  The Makefiles in
           these packages may need some further tweaks, and they'll need
           pkg.conf.in files added.
      
         - Unfortunately all this rearrangement meant I had to bump the
           interface-file version and create a bunch of .hi-boot-6 files :-(
      2cc5b907
  34. 04 Feb, 2002 1 commit
    • sewardj's avatar
      [project @ 2002-02-04 16:30:20 by sewardj] · c5ab8000
      sewardj authored
      Adding section descriptions, for ELF: don't record sections satisfying
      
         size == 0
         ||
         kind `notElem` [SECTIONKIND_CODE_OR_RODATA, SECTIONKIND_RWDATA]
      
      The latter condition is really an optimisation based on knowledge of
      what queries will be made of the table.  Still, seems to work, and
      reduces the number of sections in the list by about a factor of 3,
      so hopefully will improve GC performance in GHCi.
      
      If you get wierd GC problems in GHCi ... this may be to blame.
      c5ab8000
  35. 01 Feb, 2002 1 commit
  36. 29 Jan, 2002 2 commits
    • sof's avatar
      [project @ 2002-01-29 06:15:03 by sof] · a704ee9c
      sof authored
      Update comments re: reloc overflow. A careful re-read of the PE
      spec did prove useful; Sec 4.1 (last para) describes how overflow
      is handled.
      a704ee9c
    • sof's avatar
      [project @ 2002-01-29 02:41:21 by sof] · 9efa7107
      sof authored
      PEi386/COFF: handle relocation overflows, i.e., if a section is
      marked with the flag (MY)IMAGE_SCN_LNK_NRELOC_OVFL, then
      the first entry in the relocation table holds the 32-bit
      relocation count rather than 16-bit number in the section header.
      Apparently, a version of the MS PE spec exists that spells this
      out, but haven't been able to locate it (perhaps people on the
      'inside' could try to locate an up-to-date version...?) winnt.h
      is clear enough about it though (as is the GNU libbfd sources).
      
      This is the Right Way to compute the relocation count, but
      unfortunately libbfd / GNU ld is generating bogus output
      when the reloc field overflows (causing objdump/nm etc. to
      crash when trying to read the generated output!) Looking into it.
      
      Once this has been cleared up/fixed, the splitting up of HSstd.o
      (and HSwin32.o) should be a thing of the past. I've taken the
      liberty of disabling the suspiciously-large-reloc-section test
      already.
      9efa7107