summaryrefslogtreecommitdiff
path: root/debian/patches/0002-Finish-fixing-the-ia64-buffer-issue.patch
blob: 472a15868f74a272c361ea4a3dac2ba2760a4346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
From 028b2841cadc8abddfa1a8907b5b7b3ed31dbd0c Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Fri, 2 Jan 2009 06:53:39 +0100
Subject: [PATCH 2/5] Finish fixing the ia64 buffer issue.

Previous commits increased YY_READ_BUF_SIZE (where __ia64__ is defined) but
left YY_BUF_SIZE unchanged, so that didn't fix the problem in the end. In the
general case, the latter is twice the former. Therefore set it to the same
ratio in the ia64 case.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
---
 flex.skl | 8 ++++++++
 scan.c   | 8 ++++++++
 skel.c   | 8 ++++++++
 3 files changed, 24 insertions(+)

diff --git a/flex.skl b/flex.skl
index f878ff0..460cbf4 100644
--- a/flex.skl
+++ b/flex.skl
@@ -447,7 +447,15 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
diff --git a/scan.c b/scan.c
index 4bbbdcc..83bb6aa 100644
--- a/scan.c
+++ b/scan.c
@@ -141,7 +141,15 @@ typedef unsigned int flex_uint32_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 /* The state buf must be large enough to hold one state per character in the main buffer.
diff --git a/skel.c b/skel.c
index 6dc7644..128cdb3 100644
--- a/skel.c
+++ b/skel.c
@@ -514,7 +514,15 @@ const char *skel[] = {
   "",
   "/* Size of default input buffer. */",
   "#ifndef YY_BUF_SIZE",
+  "#ifdef __ia64__",
+  "/* On IA-64, the buffer size is 16k, not 8k.",
+  " * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.",
+  " * Ditto for the __ia64__ case accordingly.",
+  " */",
+  "#define YY_BUF_SIZE 32768",
+  "#else",
   "#define YY_BUF_SIZE 16384",
+  "#endif /* __ia64__ */",
   "#endif",
   "",
   "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
-- 
2.0.0.rc0