diff --git a/ghc-7.6.3-LlvmCodeGen-no-3.3-warning.patch b/ghc-7.6.3-LlvmCodeGen-no-3.3-warning.patch new file mode 100644 index 0000000..130b152 --- /dev/null +++ b/ghc-7.6.3-LlvmCodeGen-no-3.3-warning.patch @@ -0,0 +1,11 @@ +--- ghc-7.6.3/compiler/llvmGen/LlvmCodeGen/Base.hs~ 2013-04-19 06:22:46.000000000 +0900 ++++ ghc-7.6.3/compiler/llvmGen/LlvmCodeGen/Base.hs 2013-07-24 17:05:06.491900335 +0900 +@@ -151,7 +151,7 @@ + minSupportLlvmVersion = 28 + + maxSupportLlvmVersion :: LlvmVersion +-maxSupportLlvmVersion = 31 ++maxSupportLlvmVersion = 33 + + -- ---------------------------------------------------------------------------- + -- * Environment Handling diff --git a/ghc-avoid-empty-llvm-used-definitions.patch b/ghc-avoid-empty-llvm-used-definitions.patch new file mode 100644 index 0000000..18125fc --- /dev/null +++ b/ghc-avoid-empty-llvm-used-definitions.patch @@ -0,0 +1,45 @@ +git-author: Geoffrey Mainland (06/12/13 13:31:49) +git-committer: Geoffrey Mainland (06/12/13 13:31:49) +Message: + Avoid generating empty llvm.used definitions. + + LLVM 3.3rc3 complains when the llvm.used global is an empty array, so don't + define llvm.used at all when it would be empty. +-- + +Index: ghc-7.6.3/compiler/llvmGen/LlvmCodeGen.hs +=================================================================== +--- ghc-7.6.3.orig/compiler/llvmGen/LlvmCodeGen.hs ++++ ghc-7.6.3/compiler/llvmGen/LlvmCodeGen.hs +@@ -112,19 +112,19 @@ cmmProcLlvmGens :: DynFlags -> BufHandle + -> [[LlvmVar]] -- ^ info tables that need to be marked as 'used' + -> IO () + +-cmmProcLlvmGens _ _ _ _ [] _ [] +- = return () +- + cmmProcLlvmGens dflags h _ _ [] _ ivars +- = let ivars' = concat ivars +- cast x = LMBitc (LMStaticPointer (pVarLift x)) i8Ptr +- ty = (LMArray (length ivars') i8Ptr) +- usedArray = LMStaticArray (map cast ivars') ty +- lmUsed = (LMGlobalVar (fsLit "llvm.used") ty Appending +- (Just $ fsLit "llvm.metadata") Nothing False, Just usedArray) +- in Prt.bufLeftRender h $ {-# SCC "llvm_used_ppr" #-} +- withPprStyleDoc dflags (mkCodeStyle CStyle) $ +- pprLlvmData ([lmUsed], []) ++ | null ivars' = return () ++ | otherwise = Prt.bufLeftRender h $ ++ {-# SCC "llvm_used_ppr" #-} ++ withPprStyleDoc dflags (mkCodeStyle CStyle) $ ++ pprLlvmData ([lmUsed], []) ++ where ++ ivars' = concat ivars ++ cast x = LMBitc (LMStaticPointer (pVarLift x)) i8Ptr ++ ty = (LMArray (length ivars') i8Ptr) ++ usedArray = LMStaticArray (map cast ivars') ty ++ lmUsed = (LMGlobalVar (fsLit "llvm.used") ty Appending ++ (Just $ fsLit "llvm.metadata") Nothing False, Just usedArray) + + cmmProcLlvmGens dflags h us env ((CmmData _ _) : cmms) count ivars + = cmmProcLlvmGens dflags h us env cmms count ivars diff --git a/ghc.spec b/ghc.spec index 2f8d1f5..37e35f7 100644 --- a/ghc.spec +++ b/ghc.spec @@ -23,7 +23,7 @@ Url: http://haskell.org/ghc/dist/%{version}/%{name}-%{version}-src.ta Summary: The Glorious Glasgow Haskell Compiler License: BSD-3-Clause Group: Development/Languages/Other -ExclusiveArch: %{ix86} x86_64 +ExclusiveArch: %{ix86} x86_64 ppc BuildRequires: ghc-bytestring-devel BuildRequires: ghc-compiler >= 7.0 @@ -84,6 +84,10 @@ Patch: ghc-use-system-libffi.patch Patch1: ghc-suse-as-needed.patch # PATCH-FIX-UPSTREAM Cabal-fix-dynamic-exec-for-TH.patch peter.trommler@ohm-hochschule.de - Fedora patch 10 Patch2: Cabal-fix-dynamic-exec-for-TH.patch +# PATCH-FIX-UPSTREAM ghc-7.6.3-LlvmCodeGen-no-3.3-warning.patch peter.trommler@ohm-hochschule.de - Fedora patch 14: Silence warning about llvm 3.3 +Patch3: ghc-7.6.3-LlvmCodeGen-no-3.3-warning.patch +# PATCH-FIX-UPSTREAM ghc-avoid-empty-llvm-used-definitions.patch peter.trommler@ohm-hochschule.de - Backport of commit db9b63105a54, fixes Haskell trac #7996 +Patch4: ghc-avoid-empty-llvm-used-definitions.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -180,6 +184,8 @@ rm -r ghc-tarballs/{mingw,mingw64,perl} rm -r ghc-tarballs/libffi %patch1 -p1 -b .suse %patch2 -p1 -b .TH +%patch3 -p1 -b .llvm-version +%patch4 -p1 -b .llvm-empty %build # required for patch and patch1 @@ -195,7 +201,8 @@ HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO HSCOLOUR_SRCS = NO EOF -./configure --prefix=%{_builddir}/ghc-boot --with-system-libffi +./configure --prefix=%{_builddir}/ghc-boot --with-system-libffi \ + --with-gcc=%{_bindir}/gcc make %{?_smp_mflags} make install make clean