diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2011-07-15 16:46:37 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-07-15 16:46:37 +0100 |
commit | 3b322660f82d0c7c4f7d02523367ebd0e34c5287 (patch) | |
tree | 5a534b4652e5583d612ab1995e14cb64db66637d /compiler/main | |
parent | c4ab399e168ec91a3dafd580cac772c7ffb9727a (diff) | |
download | haskell-3b322660f82d0c7c4f7d02523367ebd0e34c5287.tar.gz |
An example of failure:
"inplace/bin/ghc-stage1" -H32m -O -package-name base-4.4.0.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build -ilibraries/base/dist-install/build/autogen -Ilibraries/base/dist-install/build -Ilibraries/base/dist-install/build/autogen -Ilibraries/base/include -optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include -optPlibraries/base/dist-install/build/autogen/cabal_macros.h -package ghc-prim-0.2.0.0 -package integer-gmp-0.3.0.0 -package rts-1.0 -split-objs -package-name base -XHaskell98 -XCPP -O2 -no-user-package-conf -rtsopts -odir libraries/base/dist-install/build -hidir libraries/base/dist-install/build -stubdir libraries/base/dist-install/build -hisuf hi -osuf o -hcsuf hc -c libraries/base/./GHC/Int.hs -o libraries/base/dist-install/build/GHC/Int.o
/usr/lib/gcc/sparc-unknown-linux-gnu/4.5.2/../../../../sparc-unknown-linux-gnu/bin/ld: --relax and -r may not be used together
collect2: ld returned 1 exit status
make[1]: *** [libraries/base/dist-install/build/GHC/Int.o] Error 1
Or with '-v' param:
/usr/bin/gcc -fno-stack-protector -nostdlib -nodefaultlibs -Wl,-r -Wl,--build-id=none -Wl,-x -o libraries/base/dist-install/build/GHC/Int.o /tmp/ghc45126_0/ghc45126_0.ldscript
/usr/lib/gcc/sparc-unknown-linux-gnu/4.5.2/../../../../sparc-unknown-linux-gnu/bin/ld: --relax and -r may not be used together
On SPARC gcc-4.5.2 has -mrelax in it's default specs, so we explicitly pass --no-relax
for ld to make sure gcc's default does not affect us.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/DriverPipeline.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 3991ac4368..18eba25852 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1980,7 +1980,15 @@ joinObjectFiles dflags o_files output_fn = do let ld_r args = SysTools.runLink dflags ([ SysTools.Option "-nostdlib", SysTools.Option "-nodefaultlibs", - SysTools.Option "-Wl,-r", + SysTools.Option "-Wl,-r" + ] + -- gcc on sparc sets -Wl,--relax implicitly, but + -- -r and --relax are incompatible for ld, so + -- disable --relax explicitly. + ++ (if platformArch (targetPlatform dflags) == ArchSPARC + then [SysTools.Option "-Wl,-no-relax"] + else []) + ++ [ SysTools.Option ld_build_id, SysTools.Option ld_x_flag, SysTools.Option "-o", |