[DHG_packages] 01/01: haskell-language-c: fix build on i386 with gcc-7

Gianfranco Costamagna locutusofborg at moszumanska.debian.org
Sun Sep 10 08:24:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

locutusofborg pushed a commit to branch master
in repository DHG_packages.

commit 8526ee1c857e166999f55c1284e73b8adb3404f3
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date:   Sun Sep 10 10:23:25 2017 +0200

    haskell-language-c: fix build on i386 with gcc-7
---
 p/haskell-language-c/debian/changelog              |   8 +
 .../2021974d7eb48d71a66b1d235287ab83ef1ee2a5.patch | 177 +++++++++++++++++++++
 p/haskell-language-c/debian/patches/series         |   1 +
 3 files changed, 186 insertions(+)

diff --git a/p/haskell-language-c/debian/changelog b/p/haskell-language-c/debian/changelog
index 8303fcb..3bbf279 100644
--- a/p/haskell-language-c/debian/changelog
+++ b/p/haskell-language-c/debian/changelog
@@ -1,3 +1,11 @@
+haskell-language-c (0.6.1-2) unstable; urgency=medium
+
+  * debian/patches/2021974d7eb48d71a66b1d235287ab83ef1ee2a5.patch:
+    - upstream fix for gcc-7 builds on i386 (Closes: #873069)
+      Thanks Adrian Bunk for the bug and patch!
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Sun, 10 Sep 2017 10:09:37 +0200
+
 haskell-language-c (0.6.1-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/p/haskell-language-c/debian/patches/2021974d7eb48d71a66b1d235287ab83ef1ee2a5.patch b/p/haskell-language-c/debian/patches/2021974d7eb48d71a66b1d235287ab83ef1ee2a5.patch
new file mode 100644
index 0000000..197d6d1
--- /dev/null
+++ b/p/haskell-language-c/debian/patches/2021974d7eb48d71a66b1d235287ab83ef1ee2a5.patch
@@ -0,0 +1,177 @@
+From 2021974d7eb48d71a66b1d235287ab83ef1ee2a5 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i at maskray.me>
+Date: Sun, 30 Jul 2017 23:34:20 -0700
+Subject: [PATCH] Add `__float128` (#33)
+
+* Add __float128
+
+`stddef.h` shipped by GCC 7.1.0 [1] adds when `__i386__` is defined.  This change breaks a lot packages depending on c2hs (which in turn depends on language-c).
+
+[1]: https://github.com/gcc-mirror/gcc/commit/9b5c49ef97e63cc63f1ffa13baf771368105ebe2
+
+* Update `__float128` tests in parse_dg
+---
+ README                                 |  3 +--
+ src/Language/C/Parser/Lexer.x          |  6 ++++--
+ src/Language/C/Parser/Parser.y         |  2 ++
+ src/Language/C/Parser/Tokens.hs        |  3 +++
+ src/Language/C/Pretty.hs               |  1 +
+ src/Language/C/Syntax/AST.hs           |  5 +++++
+ test/harness/parse_dg/expect_fail.txt  | 17 -----------------
+ test/harness/parse_dg/expect_parse.txt | 17 +++++++++++++++++
+ 8 files changed, 33 insertions(+), 21 deletions(-)
+
+diff --git a/README b/README
+index 9ea1084..2a4bf71 100644
+--- a/README
++++ b/README
+@@ -33,7 +33,6 @@ Currently unsupported C11 constructs:
+ 
+ Currently unsupported GNU C extensions:
+  - __auto_type
+- - __float128
+  - __builtin_offsetof
+    char a[__builtin_offsetof (struct S, sa->f)
+  - _Decimal32
+@@ -54,4 +53,4 @@ A couple of small examples are available in /examples
+ A couple of regression tests can be run via
+ > cd test/harness; make
+ 
+-For more tests, see test/README.
+\ No newline at end of file
++For more tests, see test/README.
+diff --git a/src/Language/C/Parser/Lexer.x b/src/Language/C/Parser/Lexer.x
+index c176b01..bb18f89 100644
+--- a/src/Language/C/Parser/Lexer.x
++++ b/src/Language/C/Parser/Lexer.x
+@@ -119,7 +119,8 @@ $infname  = . # [ \\ \" ]             -- valid character in a filename
+ @hexmant   = @hexdigits?\. at hexdigits|@hexdigits\.
+ @binexp    = [pP][\+\-]?@digits
+ 
+- at floatsuffix    = [fFlL]
++-- Suffixes `qQwW` are GNU floating type extensions: <https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html>
++ at floatsuffix    = [fFlLqQwW]
+ @floatgnusuffix = @floatsuffix at gnusuffix?|@gnusuffix at floatsuffix?
+ 
+ -- clang version literals with a major.minor.rev
+@@ -297,7 +298,7 @@ label __label__
+ (CTokGnuC GnuCOffsetof) __builtin_offsetof
+ (CTokGnuC GnuCTyCompat) __builtin_types_compatible_p
+ -}
+--- Tokens: _Alignas _Alignof __alignof alignof __alignof__ __asm asm __asm__ _Atomic auto break _Bool case char __const const __const__ continue _Complex __complex__ default do double else enum extern float for _Generic goto if __inline inline __inline__ int __int128 long _Noreturn  _Nullable __nullable _Nonnull __nonnull register __restrict restrict __restrict__ return short __signed signed __signed__ sizeof static _Static_assert struct switch typedef __typeof typeof __typeof__ __threa [...]
++-- Tokens: _Alignas _Alignof __alignof alignof __alignof__ __asm asm __asm__ _Atomic auto break _Bool case char __const const __const__ continue _Complex __complex__ default do double else enum extern float __float128 for _Generic goto if __inline inline __inline__ int __int128 long _Noreturn  _Nullable __nullable _Nonnull __nonnull register __restrict restrict __restrict__ return short __signed signed __signed__ sizeof static _Static_assert struct switch typedef __typeof typeof __typeo [...]
+ idkwtok ('_' : 'A' : 'l' : 'i' : 'g' : 'n' : 'a' : 's' : []) = tok 8 CTokAlignas
+ idkwtok ('_' : 'A' : 'l' : 'i' : 'g' : 'n' : 'o' : 'f' : []) = tok 8 CTokAlignof
+ idkwtok ('_' : 'A' : 't' : 'o' : 'm' : 'i' : 'c' : []) = tok 7 CTokAtomic
+@@ -337,6 +338,7 @@ idkwtok ('e' : 'n' : 'u' : 'm' : []) = tok 4 CTokEnum
+ idkwtok ('_' : '_' : 'e' : 'x' : 't' : 'e' : 'n' : 's' : 'i' : 'o' : 'n' : '_' : '_' : []) = tok 13 (CTokGnuC GnuCExtTok)
+ idkwtok ('e' : 'x' : 't' : 'e' : 'r' : 'n' : []) = tok 6 CTokExtern
+ idkwtok ('f' : 'l' : 'o' : 'a' : 't' : []) = tok 5 CTokFloat
++idkwtok ('_' : '_' : 'f' : 'l' : 'o' : 'a' : 't' : '1' : '2' : '8' : []) = tok 10 CTokFloat128
+ idkwtok ('f' : 'o' : 'r' : []) = tok 3 CTokFor
+ idkwtok ('g' : 'o' : 't' : 'o' : []) = tok 4 CTokGoto
+ idkwtok ('i' : 'f' : []) = tok 2 CTokIf
+diff --git a/src/Language/C/Parser/Parser.y b/src/Language/C/Parser/Parser.y
+index 895cda2..517892b 100644
+--- a/src/Language/C/Parser/Parser.y
++++ b/src/Language/C/Parser/Parser.y
+@@ -201,6 +201,7 @@ else		{ CTokElse	_ }
+ enum		{ CTokEnum	_ }
+ extern		{ CTokExtern	_ }
+ float		{ CTokFloat	_ }
++"__float128"	{ CTokFloat128	_ }
+ for		{ CTokFor	_ }
+ "_Generic"      { CTokGeneric   _ }
+ goto		{ CTokGoto	_ }
+@@ -872,6 +873,7 @@ basic_type_name
+   | "_Bool"			{% withNodeInfo $1 $ CBoolType }
+   | "_Complex"			{% withNodeInfo $1 $ CComplexType }
+   | "__int128"      {% withNodeInfo $1 $ CInt128Type }
++  | "__float128"      {% withNodeInfo $1 $ CFloat128Type }
+ 
+ 
+ -- A mixture of type qualifiers, storage class and basic type names in any
+diff --git a/src/Language/C/Parser/Tokens.hs b/src/Language/C/Parser/Tokens.hs
+index d40f605..ed778e3 100644
+--- a/src/Language/C/Parser/Tokens.hs
++++ b/src/Language/C/Parser/Tokens.hs
+@@ -92,6 +92,7 @@ data CToken = CTokLParen   !PosLength            -- `('
+             | CTokEnum     !PosLength            -- `enum'
+             | CTokExtern   !PosLength            -- `extern'
+             | CTokFloat    !PosLength            -- `float'
++            | CTokFloat128 !PosLength            -- `__float128'
+             | CTokFor      !PosLength            -- `for'
+             | CTokGeneric  !PosLength            -- `_Generic'
+             | CTokGoto     !PosLength            -- `goto'
+@@ -224,6 +225,7 @@ posLenOfTok (CTokElse     pos  ) = pos
+ posLenOfTok (CTokEnum     pos  ) = pos
+ posLenOfTok (CTokExtern   pos  ) = pos
+ posLenOfTok (CTokFloat    pos  ) = pos
++posLenOfTok (CTokFloat128 pos  ) = pos
+ posLenOfTok (CTokFor      pos  ) = pos
+ posLenOfTok (CTokGeneric  pos  ) = pos
+ posLenOfTok (CTokGoto     pos  ) = pos
+@@ -330,6 +332,7 @@ instance Show CToken where
+   showsPrec _ (CTokEnum     _  ) = showString "enum"
+   showsPrec _ (CTokExtern   _  ) = showString "extern"
+   showsPrec _ (CTokFloat    _  ) = showString "float"
++  showsPrec _ (CTokFloat128 _  ) = showString "__float128"
+   showsPrec _ (CTokFor      _  ) = showString "for"
+   showsPrec _ (CTokGeneric  _  ) = showString "_Generic"
+   showsPrec _ (CTokGoto     _  ) = showString "goto"
+diff --git a/src/Language/C/Pretty.hs b/src/Language/C/Pretty.hs
+index b7ce31e..aa32d5b 100644
+--- a/src/Language/C/Pretty.hs
++++ b/src/Language/C/Pretty.hs
+@@ -244,6 +244,7 @@ instance Pretty CTypeSpec where
+     pretty (CIntType _)         = text "int"
+     pretty (CLongType _)        = text "long"
+     pretty (CFloatType _)       = text "float"
++    pretty (CFloat128Type _)    = text "__float128"
+     pretty (CDoubleType _)      = text "double"
+     pretty (CSignedType _)      = text "signed"
+     pretty (CUnsigType _)       = text "unsigned"
+diff --git a/src/Language/C/Syntax/AST.hs b/src/Language/C/Syntax/AST.hs
+index 2fbe4c4..ce98cf3 100644
+--- a/src/Language/C/Syntax/AST.hs
++++ b/src/Language/C/Syntax/AST.hs
+@@ -434,6 +434,7 @@ data CTypeSpecifier a
+   | CIntType     a
+   | CLongType    a
+   | CFloatType   a
++  | CFloat128Type a
+   | CDoubleType  a
+   | CSignedType  a
+   | CUnsigType   a
+@@ -1028,6 +1029,7 @@ instance CNode t1 => CNode (CTypeSpecifier t1) where
+         nodeInfo (CIntType d) = nodeInfo d
+         nodeInfo (CLongType d) = nodeInfo d
+         nodeInfo (CFloatType d) = nodeInfo d
++        nodeInfo (CFloat128Type d) = nodeInfo d
+         nodeInfo (CDoubleType d) = nodeInfo d
+         nodeInfo (CSignedType d) = nodeInfo d
+         nodeInfo (CUnsigType d) = nodeInfo d
+@@ -1050,6 +1052,7 @@ instance Functor CTypeSpecifier where
+         fmap _f (CIntType a1) = CIntType (_f a1)
+         fmap _f (CLongType a1) = CLongType (_f a1)
+         fmap _f (CFloatType a1) = CFloatType (_f a1)
++        fmap _f (CFloat128Type a1) = CFloat128Type (_f a1)
+         fmap _f (CDoubleType a1) = CDoubleType (_f a1)
+         fmap _f (CSignedType a1) = CSignedType (_f a1)
+         fmap _f (CUnsigType a1) = CUnsigType (_f a1)
+@@ -1070,6 +1073,7 @@ instance Annotated CTypeSpecifier where
+         annotation (CIntType n) = n
+         annotation (CLongType n) = n
+         annotation (CFloatType n) = n
++        annotation (CFloat128Type n) = n
+         annotation (CDoubleType n) = n
+         annotation (CSignedType n) = n
+         annotation (CUnsigType n) = n
+@@ -1088,6 +1092,7 @@ instance Annotated CTypeSpecifier where
+         amap f (CIntType a_1) = CIntType (f a_1)
+         amap f (CLongType a_1) = CLongType (f a_1)
+         amap f (CFloatType a_1) = CFloatType (f a_1)
++        amap f (CFloat128Type a_1) = CFloat128Type (f a_1)
+         amap f (CDoubleType a_1) = CDoubleType (f a_1)
+         amap f (CSignedType a_1) = CSignedType (f a_1)
+         amap f (CUnsigType a_1) = CUnsigType (f a_1)
diff --git a/p/haskell-language-c/debian/patches/series b/p/haskell-language-c/debian/patches/series
new file mode 100644
index 0000000..9bd90cd
--- /dev/null
+++ b/p/haskell-language-c/debian/patches/series
@@ -0,0 +1 @@
+2021974d7eb48d71a66b1d235287ab83ef1ee2a5.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git



More information about the Pkg-haskell-commits mailing list