runghc failing sometimes on Linux/ppc?

Christopher Lewis c at functionx.org
Sun Sep 20 18:00:31 EDT 2009


> On Sun, May 03, 2009 at 03:02:50PM +1000, Jens Petersen wrote:
> > 2009/5/2 Jens Petersen <petersen at haskell.org>:
> > > So I tried doing an unregisterised ppc build with:
> > >
> > > echo "GhcUnregisterised=YES" >> mk/build.mk
> > > echo "GhcWithNativeCodeGen=NO" >> mk/build.mk
> > > echo "SplitObjs=NO" >> mk/build.mk
> >
> > Are these the right build config settings?
>
> Yes.
>
> > > but this failed with:
> > :
> > > Linking dist-stage2/build/ghc/ghc ...
> > :
> > > (.text+0x20): relocation truncated to fit: R_PPC_REL24 against symbol
> > > `__libc_start_main@@GLIBC_2.0' defined in .glink section in
> > > /usr/lib/gcc/ppc64-redhat-linux/4.4.0/../../../../lib/crt1.o
> > > /usr/lib/gcc/ppc64-redhat-linux/4.4.0/crtbegin.o:(.fini+0x0):
> > > relocation truncated to fit: R_PPC_REL24 against `.text'
>
> Does using -mlongcall help? e.g.:
>
> SRC_CC_OPTS += -mlongcall
> SRC_HC_OPTS += -optc-mlongcall
>
> (you can probably get away with something rather more specific, but
> hopefully this will work).

I haven't seen a message confirming if the suggested solution worked,
but I am experiencing a similar problem---failure to link GHC due to
relocation truncation errors---on a different environment (Ubuntu,
PowerPC 32 bit).

I have tried the above workaround, but it did not solve my problem.
Furthermore, based on this
(http://osdir.com/ml/bug-binutils-gnu/2009-08/msg00068.html) binutils
thread (sorry, there is probably a better source to reference), it
appears this problem was not fixed until very recently.

Any additional information or suggested workarounds would be much appreciated.

{c}


More information about the Glasgow-haskell-users mailing list