[GHC] #2063: Breackage on OpenBSD due to mmap remap

GHC trac at galois.com
Tue Sep 16 03:46:19 EDT 2008


#2063: Breackage on OpenBSD due to mmap remap
----------------------------+-----------------------------------------------
 Reporter:  dons            |          Owner:                  
     Type:  bug             |         Status:  new             
 Priority:  high            |      Milestone:  6.10.1          
Component:  Runtime System  |        Version:  6.8.2           
 Severity:  normal          |     Resolution:                  
 Keywords:  OpenBSD         |     Difficulty:  Moderate (1 day)
 Testcase:                  |   Architecture:  Multiple        
       Os:  OpenBSD         |  
----------------------------+-----------------------------------------------
Comment (by simonmar):

 I just made some changes in this area, although not a fix for *BSD this
 will make things slightly easier:

 {{{
 Mon Sep 15 15:59:24 BST 2008  Simon Marlow <marlowsd at gmail.com>
   * Stop using mremap() to allocate space for trampolines

   This was causing problems because sometimes mremap() moved the memory
   we had allocated from the low 2Gb to above the 2Gb boundary, causing
   some linkages to fail.  There's no MAP_32BIT flag to mremap().

   So now we just use mmap(MAP_ANON|MAP_32BIT) to allocated space for the
   trampolines.  People without MAP_32BIT (eg. *BSD) will still have to
   do something else here, such as allocating memory from a fixed
   address; so I've made it slightly easier for those guys, but there's
   still work to do (#2063).

   One solution (that Simon PJ is advocating) is to turn on -fPIC by
   default on x86-64.  This is a good solution as it removes the need for
   MAP_32BIT, but doesn't work with -fvia-C, so probably this is for
   later.
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2063#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list