ghc-6.6.1 for FreeBSD/amd64 binary distribution

Gregory Wright gwright at comcast.net
Wed May 30 17:56:31 EDT 2007


Hi Simon,

On May 30, 2007, at 4:05 PM, Simon Marlow wrote:

> Gregory Wright wrote:
>
>> I have put a binary distribution of ghc-6.6.1 for FreeBSD/amd64
>> at
>> http://www.haskell.org/ghc/dist/6.6.1/ghc-6.6.1-x86_64-unknown- 
>> freebsd.tar.bz2
>
> yay!  Ian will supply a link from the download page in due course,  
> I'm sure.
>
>

I still owe you some source patches to make the compiler build out of  
the
box.  If 6.6.1 is the end of the line, would you prefer that these be  
against HEAD?
Should I ask for push permission or just send these via the usual  
darcs send
route (now possible, since darcs builds on x86_64)?

> The x86-64 (or amd64 if you like) Linux port doesn't do relocation  
> of data references outside 2Gb.  It is the subject of this bug:
>
>   http://hackage.haskell.org/trac/ghc/ticket/781
>
> the underlying problem is that the relocatable reference is only 32  
> bits, because we're working in the small memory model, but the  
> address of the symbol might be outside the current 2Gb slice,  
> because it's in a shared library somewhere.  The system linker  
> solves this by relocating the data itself from the shared library  
> into the main program's 2Gb slice (I think), but we can't do this  
> in GHCi.
>

Hmm.  I would have thought that the absolute addresses of static data  
in the shared library would have been
resolved by the run time loader and written into the global offset  
table.  It seems that all of the
shared libraries on FreeBSD/amd64 are loaded at addresses above 2 GB,  
e.g., above 0x800000000.
Perhaps rtld allocates space below 2GB and fills in adjusts the GOT  
to point to the data in lower memory.
(There's not very much of it).  I'll have to think about this a while.

> Fortunately most code doesn't reference static data from shared  
> libraries, so we get away with it most of the time.
>

FreeBSD/amd64 seems to make a lot of references to static data.  When  
I edited the Linker
to ignore out of range relocations and print a message I got dozens  
while starting GHCi.

Best Wishes,
Greg



More information about the Glasgow-haskell-users mailing list