On 12/12/2015 10:27 PM, John Paul Adrian Glaubitz wrote: > I just successfully built the first ghc Debian packages for sparc64 with the > help of bootstrapping ghc on amd64. In order to successfully build ghc on > sparc64, I had to add -optl-Wl,-no-relax to SRC_HC_OPTS as otherwise gcc > would pass "-r" and "--relax" to ld which is not allowed on sparc*.
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 Full build log here [1]. Thus, we have to make sure that ghc does not just set "-Wl,-no-relax" when building itself but also when building any other Haskell sources. Or, alternatively, we could try to convince the gcc/binutils developers to fix the behavior of gcc/binutils when "-Wl,-r" are set. Apparently, this could be interpreted as a bug in gcc which actually sets "-no-relax" when "-r" is passed but not when "-Wl,-r" is passed. qemu is affected by the same problem, see [2]. Anyone on the Debian sparc mailing list with an idea? Cheers, Adrian > [1] https://people.debian.org/~glaubitz/hscolour_1.23-3+sparc64_sparc64-20151213-0722 > [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807006 -- .''`. 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