Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ghc/files/
Date: Sun, 10 Jun 2018 10:32:05
Message-Id: 1528626711.3e1ae2cc5e50abb42aa264893d64a05fcb4341a6.slyfox@gentoo
1 commit: 3e1ae2cc5e50abb42aa264893d64a05fcb4341a6
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 10 10:31:39 2018 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 10 10:31:51 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e1ae2cc
7
8 dev-lang/ghc: restore missing binutils-2.13 patch
9
10 Reported-by: Toralf Förster
11 Closes: https://bugs.gentoo.org/657712
12 Package-Manager: Portage-2.3.40, Repoman-2.3.9
13
14 dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch | 65 ++++++++++++++++++++++++
15 1 file changed, 65 insertions(+)
16
17 diff --git a/dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch b/dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch
18 new file mode 100644
19 index 00000000000..f02cb238c6b
20 --- /dev/null
21 +++ b/dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch
22 @@ -0,0 +1,65 @@
23 +From 358b508051333882d4099acca8f269e6fb2b7d65 Mon Sep 17 00:00:00 2001
24 +From: Bertram Felgenhauer <int-e@×××.de>
25 +Date: Thu, 3 May 2018 18:03:53 +0300
26 +Subject: [PATCH] Compute DW_FORM_block length correctly; also fixes #15068
27 +
28 +Before this patch, the pprUnwindwExpr function computed the length of
29 +by the following assembly fragment:
30 +
31 + .uleb128 1f-.-1
32 + <expression data>
33 +1:
34 +
35 +That is, to compute the length, it takes the difference of the label 1
36 +and the address of the .uleb128 directive, and subtracts 1.
37 +
38 +In #15068 it was reported that `as` from binutils 4.30 has trouble with
39 +evaluating the `.` part of the expression. However, there is actually a
40 +problem with the expression, if the length of the data ever becomes
41 +larger than 128: In that case, the .uleb128 directive will emit more
42 +than 1 byte, and the computed length will be wrong.
43 +
44 +The present patch changes the assembly fragment to use two labels,
45 +which fixes both these problems.
46 +
47 + .uleb128 2f-1f
48 +1:
49 + <expression data>
50 +2:
51 +
52 +Test Plan: validate
53 +
54 +Reviewers: bgamari, osa1
55 +
56 +Reviewed By: bgamari
57 +
58 +Subscribers: thomie, carter
59 +
60 +GHC Trac Issues: #15068
61 +
62 +Differential Revision: https://phabricator.haskell.org/D4654
63 +---
64 + compiler/nativeGen/Dwarf/Types.hs | 6 ++++--
65 + 1 file changed, 4 insertions(+), 2 deletions(-)
66 +
67 +diff --git a/compiler/nativeGen/Dwarf/Types.hs b/compiler/nativeGen/Dwarf/Types.hs
68 +index 23a2c920e7..579ed0d256 100644
69 +--- a/compiler/nativeGen/Dwarf/Types.hs
70 ++++ b/compiler/nativeGen/Dwarf/Types.hs
71 +@@ -492,9 +492,11 @@ pprUnwindExpr spIsCFA expr
72 + pprE (UwPlus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_plus
73 + pprE (UwMinus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_minus
74 + pprE (UwTimes u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_mul
75 +- in text "\t.uleb128 1f-.-1" $$ -- DW_FORM_block length
76 ++ in text "\t.uleb128 2f-1f" $$ -- DW_FORM_block length
77 ++ -- computed as the difference of the following local labels 2: and 1:
78 ++ text "1:" $$
79 + pprE expr $$
80 +- text "1:"
81 ++ text "2:"
82 +
83 + -- | Generate code for re-setting the unwind information for a
84 + -- register to @undefined@
85 +--
86 +2.17.0
87 +