Bug#832824: haskell-src-exts: reporting a bug at GHC for linker error. build fail on mips64el

Florian Weimer fw at deneb.enyo.de
Sat Oct 1 14:06:15 UTC 2016


* Clint Adams:

> Can you explain what GHC might be doing wrong?  Did binutils get
> stricter about something?  What is R_MIPS_GOT_DISP?  Are the GOT
> constraints the same on mips64el as they are on mipsel?

I suppose so, because the instruction encoding is quite similar.

According to the binutils sources, R_MIPS_GOT_DISP has a 16-bit limit
on 64-bit MIPS.

The GCC documentation mentions this:

| '-mxgot'
| '-mno-xgot'
|      Lift (do not lift) the usual restrictions on the size of the global
|      offset table.
| 
|      GCC normally uses a single instruction to load values from the GOT.
|      While this is relatively efficient, it only works if the GOT is
|      smaller than about 64k.  Anything larger causes the linker to
|      report an error such as:
| 
|           relocation truncated to fit: R_MIPS_GOT16 foobar
| 
|      If this happens, you should recompile your code with '-mxgot'.
|      This works with very large GOTs, although the code is also less
|      efficient, since it takes three instructions to fetch the value of
|      a global symbol.

So passing -mxgot would be worth a try.  This seems to be similar to
the -fpic/-fPIC distinction.



More information about the Pkg-haskell-maintainers mailing list