#3791: SplitObjs fails on sparc with GNU ld
-----------------------+----------------------------------------------------
Reporter: duncan | Owner:
Type: bug | Status: new
Priority: low | Milestone:
Component: Driver | Version: 6.12.1
Keywords: | Difficulty: Easy (less than 1 hour)
Os: Linux | Testcase:
Architecture: sparc | Failure: Building GHC failed
-----------------------+----------------------------------------------------
On Sparc, GNU ld reports the restriction that
{{{
ld: --relax and -r may not be used together
}}}
GHC call gcc with the flags
{{{
gcc -Wl,-r -Wl,-x -o Foo.o Foo_o_split/ld.script
}}}
thus instructing gcc to call ld with the -r flag.
It is gcc that supplies the `-relax` flag. According to `gcc -dumpspecs`
this is gcc's default if the `-mno-relax` or `-r` flags are not supplied.
Since ghc supplies gcc with `-Wl,-r` and not `-r`, then gcc does not omit
the `-relax` flag and thus the problem occurs.
The problem could be avoided by ghc using `-r` instead of `-Wl,-r`, or by
passing `-mno-relax`. The latter is probably preferable since `-mno-relax`
is an official gcc flag (which has no effect on arches where `-relax` does
nothing) whereas `-r` is a linker flag that gcc will pass through. Note
that `-mno-relax` is only needed when we're using `-r`, indeed allowing
gcc to use `-relax` for normal final links is an optimisation.
As a workaround users can build with `SplitObjs=NO` in `mk/build.mk`. It
may also work to set `SRC_HC_OPTS=-optl-mno-relax`.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3791>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs