[Pkg-haskell-commits] darcs: ghc: Closes: #731597: llvm-3.3 compatibility (patch from upstream)

Joachim Breitner mail at joachim-breitner.de
Sun Dec 8 19:06:12 UTC 2013


Sun Dec  8 17:17:59 UTC 2013  Joachim Breitner <mail at joachim-breitner.de>
  * Closes: #731597: llvm-3.3 compatibility (patch from upstream)

    M ./changelog +6
    A ./patches/llvm-3.3-compat
    M ./patches/series +1

Sun Dec  8 17:17:59 UTC 2013  Joachim Breitner <mail at joachim-breitner.de>
  * Closes: #731597: llvm-3.3 compatibility (patch from upstream)
diff -rN -u old-ghc/changelog new-ghc/changelog
--- old-ghc/changelog	2013-12-08 19:06:12.435660940 +0000
+++ new-ghc/changelog	2013-12-08 19:06:12.463660936 +0000
@@ -1,3 +1,9 @@
+ghc (7.6.3-6) UNRELEASED; urgency=medium
+
+  * Closes: #731597: llvm-3.3 compatibility (patch from upstream)
+
+ -- Joachim Breitner <nomeata at debian.org>  Sun, 08 Dec 2013 17:17:11 +0000
+
 ghc (7.6.3-5) unstable; urgency=low
 
   [ Gianfranco Costamagna ]
diff -rN -u old-ghc/patches/llvm-3.3-compat new-ghc/patches/llvm-3.3-compat
--- old-ghc/patches/llvm-3.3-compat	1970-01-01 00:00:00.000000000 +0000
+++ new-ghc/patches/llvm-3.3-compat	2013-12-08 19:06:12.451660938 +0000
@@ -0,0 +1,47 @@
+From: Geoffrey Mainland <gmainlan at microsoft.com>
+Date: Wed, 12 Jun 2013 13:31:49 +0000 (+0100)
+Subject: Avoid generating empty llvm.used definitions.
+X-Git-Url: http://git.haskell.org/ghc.git/commitdiff_plain/db9b63105a54
+
+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	2013-12-08 17:13:46.119975151 +0000
++++ ghc-7.6.3/compiler/llvmGen/LlvmCodeGen.hs	2013-12-08 17:13:46.119975151 +0000
+@@ -112,19 +112,19 @@
+       -> [[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 -rN -u old-ghc/patches/series new-ghc/patches/series
--- old-ghc/patches/series	2013-12-08 19:06:12.431660940 +0000
+++ new-ghc/patches/series	2013-12-08 19:06:12.451660938 +0000
@@ -5,3 +5,4 @@
 ARM-VFPv3D16
 no-missing-haddock-file-warning
 Handle-sign-bit-when-generating-veneer-for-ARM-Thumb.patch
+llvm-3.3-compat




More information about the Pkg-haskell-commits mailing list