1. 21 Apr, 2013 1 commit
  2. 09 Apr, 2013 1 commit
    • ian@well-typed.com's avatar
      Fix segfaults on SELinux machines; fixes #7629 · 27cf625a
      ian@well-typed.com authored
      Patch from wgmitchener.
      
      From the ticket:
      The two addresses (adjustorStub and code) contain the same memory
      (double-mapped), but one is writable while the other is executable.
      This is how libffi works around the SELinux restrictions. On
      non-SELinux systems the code and data addresses are probably the same.
      27cf625a
  3. 18 May, 2012 2 commits
  4. 17 May, 2012 1 commit
  5. 21 Mar, 2012 3 commits
  6. 20 Jul, 2011 1 commit
  7. 01 Jul, 2011 1 commit
  8. 29 Jun, 2011 1 commit
  9. 13 Jul, 2010 1 commit
  10. 19 Jun, 2010 2 commits
  11. 07 Aug, 2009 1 commit
  12. 03 Aug, 2009 1 commit
  13. 02 Aug, 2009 1 commit
    • Simon Marlow's avatar
      RTS tidyup sweep, first phase · a2a67cd5
      Simon Marlow authored
      The first phase of this tidyup is focussed on the header files, and in
      particular making sure we are exposinng publicly exactly what we need
      to, and no more.
      
       - Rts.h now includes everything that the RTS exposes publicly,
         rather than a random subset of it.
      
       - Most of the public header files have moved into subdirectories, and
         many of them have been renamed.  But clients should not need to
         include any of the other headers directly, just #include the main
         public headers: Rts.h, HsFFI.h, RtsAPI.h.
      
       - All the headers needed for via-C compilation have moved into the
         stg subdirectory, which is self-contained.  Most of the headers for
         the rest of the RTS APIs have moved into the rts subdirectory.
      
       - I left MachDeps.h where it is, because it is so widely used in
         Haskell code.
       
       - I left a deprecated stub for RtsFlags.h in place.  The flag
         structures are now exposed by Rts.h.
      
       - Various internal APIs are no longer exposed by public header files.
      
       - Various bits of dead code and declarations have been removed
      
       - More gcc warnings are turned on, and the RTS code is more
         warning-clean.
      
       - More source files #include "PosixSource.h", and hence only use
         standard POSIX (1003.1c-1995) interfaces.
      
      There is a lot more tidying up still to do, this is just the first
      pass.  I also intend to standardise the names for external RTS APIs
      (e.g use the rts_ prefix consistently), and declare the internal APIs
      as hidden for shared libraries.
      a2a67cd5
  14. 20 May, 2009 1 commit
  15. 19 Sep, 2008 1 commit
  16. 29 Jul, 2008 1 commit
  17. 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
  18. 04 Jan, 2008 1 commit
  19. 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
  20. 29 Oct, 2007 1 commit
  21. 16 Oct, 2007 1 commit
  22. 01 Jun, 2007 1 commit
  23. 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
  24. 15 Nov, 2006 1 commit
  25. 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
  26. 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
  27. 24 May, 2006 1 commit
  28. 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
  29. 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
  30. 24 Sep, 2005 1 commit
  31. 12 Sep, 2005 1 commit
  32. 12 Jul, 2005 1 commit
  33. 09 Jul, 2005 1 commit
  34. 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
  35. 15 Mar, 2005 1 commit
  36. 14 Mar, 2005 1 commit