[Pkg-haskell-commits] darcs: haskell-conduit: Avoid relying on variadic declaration of C open, fixing build failure on architectures using the LLVM code generator.

Colin Watson cjwatson at debian.org
Mon May 27 11:14:17 UTC 2013


Mon May 27 11:14:01 UTC 2013  Colin Watson <cjwatson at debian.org>
  * Avoid relying on variadic declaration of C open, fixing build failure on architectures using the LLVM code generator.
  Ignore-this: bec0d991c0992a14809db657fb61857b

    M ./changelog +7
    A ./patches/avoid-variadic-open.patch
    A ./patches/series

Mon May 27 11:14:01 UTC 2013  Colin Watson <cjwatson at debian.org>
  * Avoid relying on variadic declaration of C open, fixing build failure on architectures using the LLVM code generator.
  Ignore-this: bec0d991c0992a14809db657fb61857b
diff -rN -u old-haskell-conduit//changelog new-haskell-conduit//changelog
--- old-haskell-conduit//changelog	2013-05-27 11:14:17.490373839 +0000
+++ new-haskell-conduit//changelog	2013-05-27 11:14:17.494358666 +0000
@@ -1,3 +1,10 @@
+haskell-conduit (1.0.5-2) UNRELEASED; urgency=low
+
+  * Avoid relying on variadic declaration of C open, fixing build failure on
+    architectures using the LLVM code generator.
+
+ -- Colin Watson <cjwatson at debian.org>  Mon, 27 May 2013 12:12:43 +0100
+
 haskell-conduit (1.0.5-1) unstable; urgency=low
 
   * New upstream version.
diff -rN -u old-haskell-conduit//patches/avoid-variadic-open.patch new-haskell-conduit//patches/avoid-variadic-open.patch
--- old-haskell-conduit//patches/avoid-variadic-open.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-conduit//patches/avoid-variadic-open.patch	2013-05-27 11:14:17.498373604 +0000
@@ -0,0 +1,43 @@
+Description: Avoid variadic open
+ GHC's LLVM backend doesn't properly handle multiple foreign imports of the
+ same C function with different argument counts; only a declaration for the
+ last one is emitted, and thus openRead fails to compile with "error: not
+ enough parameters specified for call".  Since the mode argument is ignored
+ if O_CREAT is not in the flags, it is safe to just pass it anyway.
+Author: Colin Watson <cjwatson at ubuntu.com>
+Forwarded: https://github.com/snoyberg/conduit/pull/99
+Last-Update: 2013-05-27
+
+Index: b/System/PosixFile.hsc
+===================================================================
+--- a/System/PosixFile.hsc
++++ b/System/PosixFile.hsc
+@@ -36,10 +36,7 @@
+     }
+ 
+ foreign import ccall "open"
+-    c_open :: CString -> Flag -> IO CInt
+-
+-foreign import ccall "open"
+-    c_open_mode :: CString -> Flag -> CInt -> IO CInt
++    c_open :: CString -> Flag -> CInt -> IO CInt
+ 
+ foreign import ccall "read"
+     c_read :: FD -> Ptr Word8 -> CInt -> IO CInt
+@@ -54,14 +51,14 @@
+ 
+ openRead :: FilePath -> IO FD
+ openRead fp = do
+-    h <- withCString fp $ \str -> c_open str oRdonly
++    h <- withCString fp $ \str -> c_open str oRdonly 438 -- == octal 666
+     if h < 0
+         then throwErrno $ "Could not open file: " ++ fp
+         else return $ FD h
+ 
+ openWrite :: FilePath -> IO FD
+ openWrite fp = do
+-    h <- withCString fp $ \str -> c_open_mode str (oWronly .|. oCreat) 438 -- == octal 666
++    h <- withCString fp $ \str -> c_open str (oWronly .|. oCreat) 438 -- == octal 666
+     if h < 0
+         then throwErrno $ "Could not open file: " ++ fp
+         else return $ FD h
diff -rN -u old-haskell-conduit//patches/series new-haskell-conduit//patches/series
--- old-haskell-conduit//patches/series	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-conduit//patches/series	2013-05-27 11:14:17.498373604 +0000
@@ -0,0 +1 @@
+avoid-variadic-open.patch





More information about the Pkg-haskell-commits mailing list