From 7e6bda15065525c31cab4631013a67e2d0e3b327 Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Wed, 23 Feb 2011 14:46:08 +0100 Subject: [PATCH] enable ghc build on sparcv9 Signed-off-by: Fabio M. Di Nitto --- ghc-fix-linking-on-sparc.patch | 13 +++++++++++++ ghc.spec | 17 ++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 ghc-fix-linking-on-sparc.patch diff --git a/ghc-fix-linking-on-sparc.patch b/ghc-fix-linking-on-sparc.patch new file mode 100644 index 0000000..323730a --- /dev/null +++ b/ghc-fix-linking-on-sparc.patch @@ -0,0 +1,13 @@ +diff -Nuard ghc-7.0.1.orig/compiler/main/DriverPipeline.hs ghc-7.0.1/compiler/main/DriverPipeline.hs +--- ghc-7.0.1.orig/compiler/main/DriverPipeline.hs 2010-11-12 19:10:03.000000000 +0100 ++++ ghc-7.0.1/compiler/main/DriverPipeline.hs 2011-02-22 11:08:26.079686994 +0100 +@@ -1211,6 +1211,9 @@ + let ld_r args = SysTools.runLink dflags ([ + SysTools.Option "-nostdlib", + SysTools.Option "-nodefaultlibs", ++#ifdef sparc_TARGET_ARCH ++ SysTools.Option "-Wl,--no-relax", ++#endif + SysTools.Option "-Wl,-r", + SysTools.Option ld_x_flag, + SysTools.Option "-o", diff --git a/ghc.spec b/ghc.spec index 58bb431..8d9c4f9 100644 --- a/ghc.spec +++ b/ghc.spec @@ -28,10 +28,10 @@ Name: ghc # NB make sure to rebuild ghc after a version bump to avoid ABI change problems Version: 7.0.1 # can't be reset - used by versioned library subpackages -Release: 10%{?dist} +Release: 11%{?dist} Summary: Glasgow Haskell Compilation system # fedora ghc has only been bootstrapped on the following archs: -ExclusiveArch: %{ix86} x86_64 ppc alpha +ExclusiveArch: %{ix86} x86_64 ppc alpha sparcv9 License: BSD Group: Development/Languages Source0: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2 @@ -48,7 +48,7 @@ Obsoletes: haddock < 2.4.2-3, ghc-haddock-devel < 2.4.2-3 Obsoletes: ghc-haddock-doc < 2.4.2-3 # introduced for f15 Obsoletes: ghc-libs < 7.0.1-3 -BuildRequires: ghc, ghc-rpm-macros >= 0.11.1 +BuildRequires: ghc, ghc-rpm-macros >= 0.11.10 BuildRequires: gmp-devel, libffi-devel BuildRequires: ghc-directory-devel, ghc-process-devel, ghc-pretty-devel, ghc-containers-devel, ghc-haskell98-devel, ghc-bytestring-devel # for internal terminfo @@ -72,6 +72,7 @@ Patch4: ghc-use-system-libffi.patch # add cabal configure option --enable-executable-dynamic # (see http://hackage.haskell.org/trac/hackage/ticket/600) Patch5: Cabal-option-executable-dynamic.patch +Patch6: ghc-fix-linking-on-sparc.patch %description GHC is a state-of-the-art programming suite for Haskell, a purely @@ -150,6 +151,8 @@ rm -r ghc-tarballs/libffi %patch5 -p1 -b .orig +%patch6 -p1 -b .sparclinking + %build cat > mk/build.mk << EOF GhcLibWays = v %{?with_prof:p} %{!?ghc_without_shared:dyn} @@ -351,6 +354,14 @@ fi %endif %changelog +* Wed Feb 23 2011 Fabio M. Di Nitto +- enable build on sparcv9 +- add ghc-fix-linking-on-sparc.patch to fix ld being called + at the same time with --relax and -r. The two options conflict + on sparc. +- bump BuildRequires on ghc-rpm-macros to >= 0.11.10 that guarantees + a correct build on secondary architectures. + * Sun Feb 13 2011 Jens Petersen - without_shared renamed to ghc_without_shared