diff -Nru ghc-8.0.2/debian/changelog ghc-8.0.2/debian/changelog --- ghc-8.0.2/debian/changelog 2017-06-25 16:38:02.000000000 +0000 +++ ghc-8.0.2/debian/changelog 2017-07-02 20:14:36.000000000 +0000 @@ -1,3 +1,29 @@ +ghc (8.0.2-5ubuntu3) artful; urgency=medium + + * Really try to use BFD on arm64 + + -- Gianfranco Costamagna Sun, 02 Jul 2017 22:14:36 +0200 + +ghc (8.0.2-5ubuntu2) artful; urgency=medium + + * Revert the previous upload, BFD is not really suitable + for arm* + + -- Gianfranco Costamagna Fri, 30 Jun 2017 09:00:47 +0200 + +ghc (8.0.2-5ubuntu1) artful; urgency=medium + + * Build using the BFD linker on arm64 to work around a gold ICE. + + -- Matthias Klose Thu, 29 Jun 2017 14:48:22 +0200 + +ghc (8.0.2-5) unstable; urgency=medium + + * Patch from James Clarke to fix powerpc breakage caused by + powerpcspe patch. + + -- Clint Adams Tue, 27 Jun 2017 07:50:03 -0400 + ghc (8.0.2-4) unstable; urgency=medium * Revert cross-compilation patch. diff -Nru ghc-8.0.2/debian/patches/bfd-linker-arm64.patch ghc-8.0.2/debian/patches/bfd-linker-arm64.patch --- ghc-8.0.2/debian/patches/bfd-linker-arm64.patch 1970-01-01 00:00:00.000000000 +0000 +++ ghc-8.0.2/debian/patches/bfd-linker-arm64.patch 2017-07-02 20:14:36.000000000 +0000 @@ -0,0 +1,26 @@ +Description: Use BFD on arm64, because the new binutils seems to be not able to link it anymore +Author: Gianfranco Costamagna + +Last-Update: 2017-07-02 + +--- ghc-8.0.2.orig/aclocal.m4 ++++ ghc-8.0.2/aclocal.m4 +@@ -594,7 +594,7 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], + # On aarch64/linux and aarch64/android, tell gcc to link using the + # gold linker. + # Forcing LD to be ld.gold is done in FIND_LD m4 macro. +- $3="$$3 -fuse-ld=gold -Wl,-z,noexecstack" ++ $3="$$3 -fuse-ld=bfd -Wl,-z,noexecstack" + $4="$$4 -z noexecstack" + ;; + +@@ -2043,8 +2043,7 @@ AC_DEFUN([FIND_LLVM_PROG],[ + AC_DEFUN([FIND_LD],[ + FP_ARG_WITH_PATH_GNU_PROG([LD], [ld], [ld]) + case $target in +- arm*linux* | \ +- aarch64*linux* ) ++ arm*linux*) + # Arm and Aarch64 requires use of the binutils ld.gold linker. + # This case should catch at least arm-unknown-linux-gnueabihf, + # arm-linux-androideabi, arm64-unknown-linux and diff -Nru ghc-8.0.2/debian/patches/series ghc-8.0.2/debian/patches/series --- ghc-8.0.2/debian/patches/series 2017-06-25 16:36:24.000000000 +0000 +++ ghc-8.0.2/debian/patches/series 2017-07-02 20:14:36.000000000 +0000 @@ -8,3 +8,4 @@ compiler-cmm-PprC-sparc-alignment.patch x32-use-native-x86_64-insn.patch osdecommitmemory-compat.patch +bfd-linker-arm64.patch diff -Nru ghc-8.0.2/debian/rules ghc-8.0.2/debian/rules --- ghc-8.0.2/debian/rules 2017-06-25 16:36:24.000000000 +0000 +++ ghc-8.0.2/debian/rules 2017-07-02 20:13:40.000000000 +0000 @@ -38,7 +38,7 @@ BUILD_HADDOCK_DOCS=YES DEB_HOOGLE_TXT_DIR = /usr/lib/ghc-doc/hoogle/ -ifneq (,$(findstring $(DEB_HOST_ARCH), powerpcspe x32)) +ifneq (,$(filter powerpcspe x32, $(DEB_HOST_ARCH))) EXTRA_CONFIGURE_FLAGS += --enable-unregisterised endif @@ -53,7 +53,7 @@ echo "HADDOCK_DOCS := YES" >> mk/build.mk echo "EXTRA_HADDOCK_OPTS += --mathjax=file:///usr/share/javascript/mathjax/MathJax.js" >> mk/build.mk echo "XSLTPROC_OPTS += --nonet" >> mk/build.mk -ifneq (,$(findstring $(DEB_HOST_ARCH), arm64 armel armhf)) +ifneq (,$(filter armel armhf, $(DEB_HOST_ARCH))) echo "SRC_HC_OPTS += -optl-B/usr/bin/ld.gold" >> mk/build.mk endif ifeq (armhf,$(DEB_HOST_ARCH)) @@ -62,13 +62,13 @@ ifeq (armel,$(DEB_HOST_ARCH)) patch -p1 < debian/patches/armel-revert-ghci-fixes.patch endif -ifneq (,$(findstring $(DEB_HOST_ARCH), mips mipsel)) +ifneq (,$(filter mips mipsel, $(DEB_HOST_ARCH))) echo "SRC_HC_OPTS += -optc--param -optcggc-min-expand=10" >> mk/build.mk endif ifeq (x32,$(DEB_HOST_ARCH)) echo "INTEGER_LIBRARY = integer-simple" >> mk/build.mk endif -ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter nostrip, $(DEB_BUILD_OPTIONS))) # echo "GhcStage1HcOpts += -DDEBUG" >> mk/build.mk # echo "GhcStage2HcOpts += -DDEBUG" >> mk/build.mk echo "SRC_HC_OPTS += -H32m -O0" >> mk/build.mk @@ -77,7 +77,7 @@ echo "SplitObjs = NO" >> mk/build.mk echo "STRIP = :" >> mk/build.mk endif -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter noopt, $(DEB_BUILD_OPTIONS))) echo "SRC_HC_OPTS += -H32m -O0" >> mk/build.mk echo "GhcHcOpts += -O0" >> mk/build.mk # This breaks the build - to be investigated: @@ -86,7 +86,7 @@ endif # We also want to build the threaded profiling-enabled debug runtime, # because it does no harm - echo 'GhcRTSWays += $$(if $$(findstring p, $$(GhcLibWays)),thr_debug_p,)' >> mk/build.mk + echo 'GhcRTSWays += $$(if $$(filter p, $$(GhcLibWays)),thr_debug_p,)' >> mk/build.mk # We can't do this with a configure flag in 6.8.1 as libdir is not # defined at the point at which we := it