Add CONFIG_CMDLINE to kernel.
[fedora-riscv.git] / stage2-riscv-gnu-toolchain / gcc-5-fix-compilation-with-gcc-6.patch
1 2016-02-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>\r
2 \r
3         Backported from mainline\r
4         2016-02-19  Jakub Jelinek  <jakub@redhat.com>\r
5                     Bernd Edlinger  <bernd.edlinger@hotmail.de>\r
6 \r
7         * Make-lang.in: Invoke gperf with -L C++.\r
8         * cfns.gperf: Remove prototypes for hash and libc_name_p\r
9         inlines.\r
10         * cfns.h: Regenerated.\r
11         * except.c (nothrow_libfn_p): Adjust.\r
12 \r
13 Index: gcc/cp/Make-lang.in\r
14 ===================================================================\r
15 --- gcc/cp/Make-lang.in (revision 233574)\r
16 +++ gcc/cp/Make-lang.in (working copy)\r
17 @@ -111,7 +111,7 @@ else\r
18  # deleting the $(srcdir)/cp/cfns.h file.\r
19  $(srcdir)/cp/cfns.h:\r
20  endif\r
21 -       gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \\r
22 +       gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \\r
23                 $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h\r
24  \r
25  #\f\r
26 Index: gcc/cp/cfns.gperf\r
27 ===================================================================\r
28 --- gcc/cp/cfns.gperf   (revision 233574)\r
29 +++ gcc/cp/cfns.gperf   (working copy)\r
30 @@ -1,3 +1,5 @@\r
31 +%language=C++\r
32 +%define class-name libc_name\r
33  %{\r
34  /* Copyright (C) 2000-2015 Free Software Foundation, Inc.\r
35  \r
36 @@ -16,14 +18,6 @@ for more details.\r
37  You should have received a copy of the GNU General Public License\r
38  along with GCC; see the file COPYING3.  If not see\r
39  <http://www.gnu.org/licenses/>.  */\r
40 -#ifdef __GNUC__\r
41 -__inline\r
42 -#endif\r
43 -static unsigned int hash (const char *, unsigned int);\r
44 -#ifdef __GNUC__\r
45 -__inline\r
46 -#endif\r
47 -const char * libc_name_p (const char *, unsigned int);\r
48  %}\r
49  %%\r
50  # The standard C library functions, for feeding to gperf; the result is used\r
51 Index: gcc/cp/cfns.h\r
52 ===================================================================\r
53 --- gcc/cp/cfns.h       (revision 233574)\r
54 +++ gcc/cp/cfns.h       (working copy)\r
55 @@ -1,5 +1,5 @@\r
56 -/* ANSI-C code produced by gperf version 3.0.3 */\r
57 -/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf  */\r
58 +/* C++ code produced by gperf version 3.0.4 */\r
59 +/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf  */\r
60  \r
61  #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \\r
62        && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \\r
63 @@ -28,7 +28,7 @@\r
64  #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."\r
65  #endif\r
66  \r
67 -#line 1 "cfns.gperf"\r
68 +#line 3 "cfns.gperf"\r
69  \r
70  /* Copyright (C) 2000-2015 Free Software Foundation, Inc.\r
71  \r
72 @@ -47,26 +47,19 @@ for more details.\r
73  You should have received a copy of the GNU General Public License\r
74  along with GCC; see the file COPYING3.  If not see\r
75  <http://www.gnu.org/licenses/>.  */\r
76 -#ifdef __GNUC__\r
77 -__inline\r
78 -#endif\r
79 -static unsigned int hash (const char *, unsigned int);\r
80 -#ifdef __GNUC__\r
81 -__inline\r
82 -#endif\r
83 -const char * libc_name_p (const char *, unsigned int);\r
84  /* maximum key range = 391, duplicates = 0 */\r
85  \r
86 -#ifdef __GNUC__\r
87 -__inline\r
88 -#else\r
89 -#ifdef __cplusplus\r
90 -inline\r
91 -#endif\r
92 -#endif\r
93 -static unsigned int\r
94 -hash (register const char *str, register unsigned int len)\r
95 +class libc_name\r
96  {\r
97 +private:\r
98 +  static inline unsigned int hash (const char *str, unsigned int len);\r
99 +public:\r
100 +  static const char *libc_name_p (const char *str, unsigned int len);\r
101 +};\r
102 +\r
103 +inline unsigned int\r
104 +libc_name::hash (register const char *str, register unsigned int len)\r
105 +{\r
106    static const unsigned short asso_values[] =\r
107      {\r
108        400, 400, 400, 400, 400, 400, 400, 400, 400, 400,\r
109 @@ -122,14 +115,8 @@ along with GCC; see the file COPYING3.  If not see\r
110    return hval + asso_values[(unsigned char)str[len - 1]];\r
111  }\r
112  \r
113 -#ifdef __GNUC__\r
114 -__inline\r
115 -#ifdef __GNUC_STDC_INLINE__\r
116 -__attribute__ ((__gnu_inline__))\r
117 -#endif\r
118 -#endif\r
119  const char *\r
120 -libc_name_p (register const char *str, register unsigned int len)\r
121 +libc_name::libc_name_p (register const char *str, register unsigned int len)\r
122  {\r
123    enum\r
124      {\r
125 Index: gcc/cp/except.c\r
126 ===================================================================\r
127 --- gcc/cp/except.c     (revision 233574)\r
128 +++ gcc/cp/except.c     (working copy)\r
129 @@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn)\r
130       unless the system headers are playing rename tricks, and if\r
131       they are, we don't want to be confused by them.  */\r
132    id = DECL_NAME (fn);\r
133 -  return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));\r
134 +  return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),\r
135 +                                  IDENTIFIER_LENGTH (id));\r
136  }\r
137  \r
138  /* Returns nonzero if an exception of type FROM will be caught by a\r