On 12/13/2015 07:04 PM, John Paul Adrian Glaubitz wrote: > On 12/13/2015 12:32 PM, John Paul Adrian Glaubitz wrote: >> 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]. > > Attaching a proposed fix which I have also posted upstream [1].
Oops, just saw there was a copy-and-paste error, attaching refreshed patch. I forgot to change ArchSPARC to ArchSPARC64 after copying the map section from sparc to sparc64. Sorry for the noise! Cheers, Adrian -- .''`. 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
Description: Add initial platform support for sparc64 This patch adds initial platform support for sparc64 by mapping sparc64 to "ArchSPARC64" instead of "ArchUnknown" in aclocal.m4. Additionally, it adds "ArchSPARC64" to the list of known platforms in compiler/utils/Platform.hs and patches compiler/main/DriverPipeline.hs to explicitly pass -no-relax to gcc. See upstream ticket #11211 and Debian bug #807777. . Index: ghc-7.10.3/aclocal.m4 =================================================================== --- ghc-7.10.3.orig/aclocal.m4 +++ ghc-7.10.3/aclocal.m4 @@ -193,6 +193,10 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V sparc) test -z "[$]2" || eval "[$]2=ArchSPARC" ;; + sparc64) + test -z "[$]2" || eval "[$]2=ArchSPARC64" + ;; + arm) GET_ARM_ISA() test -z "[$]2" || eval "[$]2=\"ArchARM {armISA = \$ARM_ISA, armISAExt = \$ARM_ISA_EXT, armABI = \$ARM_ABI}\"" @@ -209,7 +213,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V mipsel) test -z "[$]2" || eval "[$]2=ArchMipsel" ;; - hppa|hppa1_1|ia64|m68k|powerpc64le|rs6000|s390|s390x|sh4|sparc64|vax) + hppa|hppa1_1|ia64|m68k|powerpc64le|rs6000|s390|s390x|sh4|vax) test -z "[$]2" || eval "[$]2=ArchUnknown" ;; *) Index: ghc-7.10.3/compiler/main/DriverPipeline.hs =================================================================== --- ghc-7.10.3.orig/compiler/main/DriverPipeline.hs +++ ghc-7.10.3/compiler/main/DriverPipeline.hs @@ -2208,6 +2208,7 @@ joinObjectFiles dflags o_files output_fn -- -r and --relax are incompatible for ld, so -- disable --relax explicitly. ++ (if platformArch (targetPlatform dflags) == ArchSPARC + || platformArch (targetPlatform dflags) == ArchSPARC64 && ldIsGnuLd then [SysTools.Option "-Wl,-no-relax"] else []) Index: ghc-7.10.3/compiler/utils/Platform.hs =================================================================== --- ghc-7.10.3.orig/compiler/utils/Platform.hs +++ ghc-7.10.3/compiler/utils/Platform.hs @@ -48,6 +48,7 @@ data Arch | ArchPPC | ArchPPC_64 | ArchSPARC + | ArchSPARC64 | ArchARM { armISA :: ArmISA , armISAExt :: [ArmISAExt]