1. 20 May, 2009 1 commit
  2. 19 Sep, 2008 1 commit
  3. 29 Jul, 2008 1 commit
  4. 08 Apr, 2008 1 commit
    • Simon Marlow's avatar
      Import libffi-3.0.4, and use it to provide FFI support in GHCi · e0fcf61d
      Simon Marlow authored
      This replaces the hand-rolled architecture-specific FFI support in
      GHCi with the standard libffi as used in GCJ, Python and other
      projects.  I've bundled the complete libffi-3.0.4 tarball in the
      source tree in the same way as we do for GMP, the difference being
      that we always build and install our own libffi regardless of whether
      there's one on the system (it's small, and we don't want
      dependency/versioning headaches).
      
      In particular this means that unregisterised builds will now have a
      fully working GHCi including FFI out of the box, provided libffi
      supports the platform.
      
      There is also code in the RTS to use libffi in place of
      rts/Adjustor.c, but it is currently not enabled if we already have
      support in Adjustor.c for the current platform.  We need to assess the
      performance impact before using libffi here too (in GHCi we don't care
      too much about performance).
      e0fcf61d
  5. 04 Jan, 2008 1 commit
  6. 03 Jan, 2008 1 commit
    • Simon Marlow's avatar
      Optionally use libffi to implement 'foreign import "wrapper"' (#793) · 5123ae93
      Simon Marlow authored
      To enable this, set UseLibFFI=YES in mk/build.mk.  
      
      The main advantage here is that this reduces the porting effort for
      new platforms: libffi works on more architectures than our current
      adjustor code, and it is probably more heavily tested.  We could
      potentially replace our existing code, but since it is probably faster
      than libffi (just a guess, I'll measure later) and is already working,
      it doesn't seem worthwhile.
      
      Right now, you must have libffi installed on your system.  I used the
      one supplied by Debian/Ubuntu.
      5123ae93
  7. 29 Oct, 2007 1 commit
  8. 16 Oct, 2007 1 commit
  9. 01 Jun, 2007 1 commit
  10. 01 Apr, 2007 1 commit
    • red5_2@hotmail.com's avatar
      fix adjustor generation on ia64 (test case ffi009) · b321da7d
      red5_2@hotmail.com authored
      Some fixes to adjustor functions.  The 8-byte address returned by the 
      allocator is adjusted to be aligned to 16-byte boundaries.  Fixed a typo 
      in inserting an immediate address into an instruction.
      
      This fixes the calls to 5-argument and 6-argument functions in ffi009.  
      Some functions still break.  I suspect it's related to passing arguments on 
      the stack.
      b321da7d
  11. 15 Nov, 2006 1 commit
  12. 24 Oct, 2006 1 commit
    • Simon Marlow's avatar
      Split GC.c, and move storage manager into sm/ directory · ab0e778c
      Simon Marlow authored
      In preparation for parallel GC, split up the monolithic GC.c file into
      smaller parts.  Also in this patch (and difficult to separate,
      unfortunatley):
        
        - Don't include Stable.h in Rts.h, instead just include it where
          necessary.
        
        - consistently use STATIC_INLINE in source files, and INLINE_HEADER
          in header files.  STATIC_INLINE is now turned off when DEBUG is on,
          to make debugging easier.
        
        - The GC no longer takes the get_roots function as an argument.
          We weren't making use of this generalisation.
      ab0e778c
  13. 30 May, 2006 1 commit
    • Simon Marlow's avatar
      replace stgMallocBytesRWX() with our own allocator · e3c55aeb
      Simon Marlow authored
      See bug #738
      
      Allocating executable memory is getting more difficult these days.  In
      particular, the default SELinux policy on Fedora Core 5 disallows
      making the heap (i.e. malloc()'d memory) executable, although it does
      apparently allow mmap()'ing anonymous executable memory by default.
      
      Previously, stgMallocBytesRWX() used malloc() underneath, and then
      tried to make the page holding the memory executable.  This was rather
      hacky and fails with Fedora Core 5.  
      
      This patch adds a mini-allocator for executable memory, based on the
      block allocator.  We grab page-sized blocks and make them executable,
      then allocate small objects from the page.  There's a simple free
      function, that will free whole pages back to the system when they are
      empty.
      e3c55aeb
  14. 24 May, 2006 1 commit
  15. 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
  16. 26 Oct, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-10-26 11:58:57 by simonmar] · 559295a0
      simonmar authored
      x86_64 fix: I was a bit sloppy before and assumed that the malloc()'d
      memory would be in the low 2Gb, so I could use 32-bit offset
      addressing.  It appears that this sometimes isn't the case, so do it
      properly and use 64-bit absolute addressing.
      559295a0
  17. 24 Sep, 2005 1 commit
  18. 12 Sep, 2005 1 commit
  19. 12 Jul, 2005 1 commit
  20. 09 Jul, 2005 1 commit
  21. 05 Jul, 2005 1 commit
    • dons's avatar
      [project @ 2005-07-05 04:55:30 by dons] · 76f8c7b8
      dons authored
      Fix ffi on OpenBSD by dynamically allocating the obscure_ccall_ret_code.
      Also merge in SimonM's wrapper over inline asm patch.
      76f8c7b8
  22. 15 Mar, 2005 1 commit
  23. 14 Mar, 2005 1 commit
  24. 10 Mar, 2005 2 commits
  25. 28 Jan, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-01-28 12:55:17 by simonmar] · 153b9cb9
      simonmar authored
      Rationalise the BUILD,HOST,TARGET defines.
      
      Recall that:
      
        - build is the platform we're building on
        - host is the platform we're running on
        - target is the platform we're generating code for
      
      The change is that now we take these definitions as applying from the
      point of view of the particular source code being built, rather than
      the point of view of the whole build tree.
      
      For example, in RTS and library code, we were previously testing the
      TARGET platform.  But under the new rule, the platform on which this
      code is going to run is the HOST platform.  TARGET only makes sense in
      the compiler sources.
      
      In practical terms, this means that the values of BUILD, HOST & TARGET
      may vary depending on which part of the build tree we are in.
      
      Actual changes:
      
       - new file: includes/ghcplatform.h contains platform defines for
         the RTS and library code.
      
       - new file: includes/ghcautoconf.h contains the autoconf settings
         only (HAVE_BLAH).  This is so that we can get hold of these
         settings independently of the platform defines when necessary
         (eg. in GHC).
      
       - ghcconfig.h now #includes both ghcplatform.h and ghcautoconf.h.
      
       - MachRegs.h, which is included into both the compiler and the RTS,
         now has to cope with the fact that it might need to test either
         _TARGET_ or _HOST_ depending on the context.
      
       - the compiler's Makefile now generates
           stage{1,2,3}/ghc_boot_platform.h
         which contains platform defines for the compiler.  These differ
         depending on the stage, of course: in stage2, the HOST is the
         TARGET of stage1.  This was wrong before.
      
       - The compiler doesn't get platform info from Config.hs any more.
         Previously it did (sometimes), but unless we want to generate
         a new Config.hs for each stage we can't do this.
      
       - GHC now helpfully defines *_{BUILD,HOST}_{OS,ARCH} automatically
         in CPP'd Haskell source.
      
       - ghcplatform.h defines *_TARGET_* for backwards compatibility
         (ghcplatform.h is included by ghcconfig.h, which is included by
         config.h, so code which still #includes config.h will get the TARGET
         settings as before).
      
       - The Users's Guide is updated to mention *_HOST_* rather than
         *_TARGET_*.
      
       - coding-style.html in the commentary now contains a section on
         platform defines.  There are further doc updates to come.
      
      Thanks to Wolfgang Thaller for pointing me in the right direction.
      153b9cb9
  26. 20 Jan, 2005 1 commit
  27. 11 Jan, 2005 2 commits
  28. 10 Jan, 2005 1 commit
    • wolfgang's avatar
      [project @ 2005-01-10 18:44:38 by wolfgang] · 0aca2f00
      wolfgang authored
      Handle foreign import wrapper properly for MacOS X, powerpc64-linux and AIX.
      Only Mac OS X tested so far.
      Pass information about argument types from DsForeign to createAdjustor encoded
      as a string ('i' for integers, 'f' for floats, 'd' for doubles and 'l' for
      long [64bit] integers).
      0aca2f00
  29. 10 Nov, 2004 1 commit
  30. 14 Sep, 2004 1 commit
    • panne's avatar
      [project @ 2004-09-14 16:47:57 by panne] · 4b172561
      panne authored
      * Merged stgMalloc and execPage into a single function which handles
        even multiple pages correctly.
      
      * Enabled the use VirtualProtect on x86 WinDoze now. This could be
        necessary for processors which distinguish between READ and EXECUTE
        memory accesses, e.g. Itaniums IIRC.
      
      * Nuked pageMode and set page permissions always to READ/WRITE/EXECUTE,
        otherwise we could accidentally remove the WRITE permission.
      
      Only mildly tested on x86 Linux, but it might be worth merging into
      the STABLE branch when it turns out to work on x86 WinDoze and OpenBSD.
      SimonM?
      4b172561
  31. 13 Sep, 2004 1 commit
    • dons's avatar
      [project @ 2004-09-13 09:19:16 by dons] · 10a9b180
      dons authored
      malloc memory isn't executable by default on OpenBSD, so mprotect
      pages in execPage for that platform. Enables the FFI.
      
      Merge to stable
      10a9b180
  32. 03 Sep, 2004 1 commit
    • simonmar's avatar
      [project @ 2004-09-03 15:28:18 by simonmar] · 95ca6bff
      simonmar authored
      Cleanup: all (well, most) messages from the RTS now go through the
      functions in RtsUtils: barf(), debugBelch() and errorBelch().  The
      latter two were previously called belch() and prog_belch()
      respectively.  See the comments for the right usage of these message
      functions.
      
      One reason for doing this is so that we can avoid spurious uses of
      stdout/stderr by Haskell apps on platforms where we shouldn't be using
      them (eg. non-console apps on Windows).
      95ca6bff
  33. 22 Aug, 2004 4 commits
  34. 21 Aug, 2004 1 commit
  35. 28 Dec, 2003 1 commit
    • panne's avatar
      [project @ 2003-12-28 13:02:46 by panne] · e2c936e2
      panne authored
      Warning police + a little cleanup of #ifdefs relating to execPage. Added two
      TODOs on the way (an adjustor spanning two pages + calling initAdjustor at RTS
      startup). Note that execPage is still disabled (why?).
      e2c936e2