On 12/13/2015 12:05 PM, John Paul Adrian Glaubitz wrote:
> Ok, this seems to be a bit more complicated as the linker settings have
> to be explicitly set in the ghc source code directly. I have tried
> building hscolour manually which initially works but eventually fails
> with:
> 
> Language/Haskell/HsColour.hs:94:55: Warning: Tab character
> [ 1 of 16] Compiling Language.Haskell.HsColour.General (
> Language/Haskell/HsColour/General.hs,
> dist-ghc/build/Language/Haskell/HsColour/General.p_o )
> /usr/bin/ld: --relax and -r may not be used together
> collect2: error: ld returned 1 exit status
> make: *** [build-ghc-stamp] Error 1
> /usr/share/cdbs/1/class/hlibrary.mk:147: recipe for target
> 'build-ghc-stamp' failed
> dpkg-buildpackage: error: debian/rules build-arch gave error exit status 2

Temporary workaround:

root@andi:/srv/disk1/chroots/unstable-sparc64-sbuild/usr/lib/ghc# diff
-u settings.orig settings
--- settings.orig       2015-12-12 15:18:11.000000000 +0100
+++ settings    2015-12-13 11:45:21.528000001 +0100
@@ -1,6 +1,6 @@
 [("GCC extra via C opts", " -fwrapv"),
  ("C compiler command", "/usr/bin/gcc"),
- ("C compiler flags", " -fno-stack-protector"),
+ ("C compiler flags", " -fno-stack-protector -Wl,-no-relax"),
  ("C compiler link flags", ""),
  ("Haskell CPP command","/usr/bin/gcc"),
  ("Haskell CPP flags","-E -undef -traditional "),
root@andi:/srv/disk1/chroots/unstable-sparc64-sbuild/usr/lib/ghc#

So, in case the patch from message #5 [1] in this bug report is
applied, please make sure to also patch the settings file for
ghc as above on sparc64 to make sure -Wl,-no-relax is always
used in ghc on sparc64.

I am about to file an upstream bug report in ghc so upstream can
develop a proper fix similar to the older fix for sparc [2].

Cheers,
Adrian

> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807777#5
> [2] https://ghc.haskell.org/trac/ghc/ticket/3791

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply via email to