Can't compile GHC 6.8.2
marlowsd at gmail.com
Tue Nov 25 04:01:57 EST 2008
Barney Stratford wrote:
> There's good news and bad news. The good news is that the compilation of
> my shiny almost-new GHC is complete. The bad news is, it won't link.
> It's grumbling about
> has external relocation entries in non-writable section (__TEXT,__text)
> for symbols:
> Looking through the archives, it seems like this is an old favourite bug
> rearing its ugly head again. The suggested remedy of commenting out the
> line reading "SRC_HC_OPTS += -fvia-C" in the Makefile won't work, as
> that line isn't there anyway. The manpage for ld has an option
> "-read_only_relocs warning" that looks like it might suppress this
> problem, but I don't fully understand what it's doing.
> What would you suggest?
The workaround is almost certainly to build the RTS with -fasm. However,
I'd be really pleased if someone could get to the bottom of this, so that
we can fix the root cause. You can get a look at the .s file generated for
PrimOps by saying
$ cd rts
$ make PrimOps.s
(make sure you're still compiling via-C). Have a look at the references to
those symbols, do they look suspicious at all? Try compiling the same
module with -fasm, and compare the .s file with the via-C version. Also
you could try poking around in the .o file with objdump, and see what
relocation entries are being generated in both cases.
More information about the Glasgow-haskell-users