Skip to content

x86_64: RTS linker depends on working MAP_32BIT

GHC head since the 6.8 split back in October, is broken on OpenBSD, due to changes in mmap use

Thu Oct 18 05:52:20 PDT 2007  Simon Marlow <simonmar <at> microsoft.com>

  * add PIC relocations for x86_64, and use a simpler hack in place of x86_64_high_symbol()

  This is Wolfgang Thaller's patch sent to cvs-ghc recently, with extra
  commentary by me.  It turns out that this patch is not just a cleanup,
  it is also necessary for GHCi to work on x86_64 with shared libraries,
  because previously lookupSymbol() was creating jump-table entries for
  all symbols looked up that resolved outside 2Gb, whereas Wolfgang's
  version only generates jump-table entries for 32-bit symbol references
  in object code that we load.

It appears to still be broken:

../compiler/ghc-inplace -optc-O -optc-L/usr/local/lib -optc-I/usr/local/include -optc-Wall -optc-W -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-I../includes -optc-I. -optc-Iparallel -optc-Ism -optc-DCOMPILING_RTS -optc-fomit-frame-pointer -optc-I../gmp/gmpbuild -optc-fno-strict-aliasing -H128m -O2 -L/usr/local/lib -I/usr/local/include -optc-O2 -I../includes -I. -Iparallel -Ism -DCOMPILING_RTS -package-name rts -static -I../gmp/gmpbuild -I. -#include HCIncludes.h -optc-fno-stack-protector -dcmm-lint   -optc-O0  -H128m -O2 -L/usr/local/lib -I/usr/local/include -optc-O2 -I../includes -I. -Iparallel -Ism -DCOMPILING_RTS -package-name rts -static -I../gmp/gmpbuild -I. -#include HCIncludes.h -optc-fno-stack-protector -dcmm-lint  -c Main.c -o Main.o

Linker.c:1599:10:
     #error ocAllocateSymbolExtras doesnt want USE_MMAP to be defined
Linker.c: In function `ocAllocateSymbolExtras':

Linker.c:1623:0:
     warning: implicit declaration of function `mremap'

Linker.c:1623:0:
     error: `MREMAP_MAYMOVE' undeclared (first use in this function)

Linker.c:1623:0:
     error: (Each undeclared identifier is reported only once

Linker.c:1623:0:  error: for each function it appears in.)

originally reported on the mailing list, http://thread.gmane.org/gmane.comp.lang.haskell.cvs.ghc/24330

Trac metadata
Trac field Value
Version 6.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC dons@galois.com
Operating system OpenBSD
Architecture Multiple
Edited by Simon Marlow
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information