Mercurial > hg > aboriginal
comparison sources/patches/gcc-core-fix52.patch @ 1830:2c312362813d draft
Workaround for building with gcc 5.2, from Konrad Eisele and Rich Felker.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 15 Dec 2015 20:45:48 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1829:c2e158a22d2b | 1830:2c312362813d |
---|---|
1 Newer gcc (5.2 and up) won't compile older gcc because they added an 'extension' | |
2 and made their code depnd on it, and then decided it had been a bad idea and | |
3 ripped it out again but older gcc goes "oh of course newer gcc will support | |
4 this forever". The <strike>Aristrocrats!</strike> FSF! | |
5 | |
6 diff -ruN gcc-core/gcc/toplev.c gcc-core.bak/gcc/toplev.c | |
7 --- gcc-core/gcc/toplev.c 2006-10-09 11:27:14.000000000 -0500 | |
8 +++ gcc-core.bak/gcc/toplev.c 2015-12-15 16:19:26.643494852 -0600 | |
9 @@ -531,7 +531,7 @@ | |
10 for floor_log2 and exact_log2; see toplev.h. That construct, however, | |
11 conflicts with the ISO C++ One Definition Rule. */ | |
12 | |
13 -#if GCC_VERSION < 3004 || !defined (__cplusplus) | |
14 +#if 0 | |
15 | |
16 /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X. | |
17 If X is 0, return -1. */ | |
18 diff -ruN gcc-core/gcc/toplev.h gcc-core.bak/gcc/toplev.h | |
19 --- gcc-core/gcc/toplev.h 2006-02-26 14:23:40.000000000 -0600 | |
20 +++ gcc-core.bak/gcc/toplev.h 2015-12-15 17:47:59.755637132 -0600 | |
21 @@ -151,12 +151,6 @@ | |
22 /* Return true iff flags are set as if -ffast-math. */ | |
23 extern bool fast_math_flags_set_p (void); | |
24 | |
25 -/* Return log2, or -1 if not exact. */ | |
26 -extern int exact_log2 (unsigned HOST_WIDE_INT); | |
27 - | |
28 -/* Return floor of log2, with -1 for zero. */ | |
29 -extern int floor_log2 (unsigned HOST_WIDE_INT); | |
30 - | |
31 /* Inline versions of the above for speed. */ | |
32 #if GCC_VERSION >= 3004 | |
33 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG | |
34 @@ -170,13 +164,13 @@ | |
35 # define CTZ_HWI __builtin_ctz | |
36 # endif | |
37 | |
38 -extern inline int | |
39 +static inline int | |
40 floor_log2 (unsigned HOST_WIDE_INT x) | |
41 { | |
42 return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1; | |
43 } | |
44 | |
45 -extern inline int | |
46 +static inline int | |
47 exact_log2 (unsigned HOST_WIDE_INT x) | |
48 { | |
49 return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1; |