[commit: ghc] ghc-7.2: An example of failure: (28c0075)
Ian Lynagh
igloo at earth.li
Tue Jul 19 18:27:36 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-7.2
http://hackage.haskell.org/trac/ghc/changeset/28c0075b6fd6df688487b19119ea6e40fa8b794b
>---------------------------------------------------------------
commit 28c0075b6fd6df688487b19119ea6e40fa8b794b
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date: Fri Jul 15 16:46:37 2011 +0100
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 at gentoo.org>
>---------------------------------------------------------------
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 3991ac4..18eba25 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",
More information about the Cvs-ghc
mailing list