diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/gccxml/gcc-5.patch | 57 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/gccxml/package.py | 2 |
2 files changed, 59 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gccxml/gcc-5.patch b/var/spack/repos/builtin/packages/gccxml/gcc-5.patch new file mode 100644 index 0000000000..4348d10184 --- /dev/null +++ b/var/spack/repos/builtin/packages/gccxml/gcc-5.patch @@ -0,0 +1,57 @@ +--- a/GCC/gcc/toplev.c ++++ b/GCC/gcc/toplev.c +@@ -537,7 +537,7 @@ read_integral_parameter (const char *p, const char *pname, const int defval) + for floor_log2 and exact_log2; see toplev.h. That construct, however, + conflicts with the ISO C++ One Definition Rule. */ + +-#if GCC_VERSION < 3004 || !defined (__cplusplus) ++#if GCC_VERSION < 3004 + + /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X. + If X is 0, return -1. */ +@@ -589,7 +589,7 @@ exact_log2 (unsigned HOST_WIDE_INT x) + #endif + } + +-#endif /* GCC_VERSION < 3004 || !defined (__cplusplus) */ ++#endif /* GCC_VERSION < 3004 */ + + /* Handler for fatal signals, such as SIGSEGV. These are transformed + into ICE messages, which is much more user friendly. In case the +diff --git a/GCC/gcc/toplev.h b/GCC/gcc/toplev.h +index c935f7e..1edd5e5 100644 +--- a/GCC/gcc/toplev.h ++++ b/GCC/gcc/toplev.h +@@ -151,6 +151,7 @@ extern void decode_d_option (const char *); + /* Return true iff flags are set as if -ffast-math. */ + extern bool fast_math_flags_set_p (void); + ++#if GCC_VERSION < 3004 + /* Return log2, or -1 if not exact. */ + extern int exact_log2 (unsigned HOST_WIDE_INT); + +@@ -158,7 +159,7 @@ extern int exact_log2 (unsigned HOST_WIDE_INT); + extern int floor_log2 (unsigned HOST_WIDE_INT); + + /* Inline versions of the above for speed. */ +-#if GCC_VERSION >= 3004 ++#else /* GCC_VERSION >= 3004 */ + # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG + # define CLZ_HWI __builtin_clzl + # define CTZ_HWI __builtin_ctzl +@@ -170,13 +171,13 @@ extern int floor_log2 (unsigned HOST_WIDE_INT); + # define CTZ_HWI __builtin_ctz + # endif + +-extern inline int ++static inline int + floor_log2 (unsigned HOST_WIDE_INT x) + { + return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1; + } + +-extern inline int ++static inline int + exact_log2 (unsigned HOST_WIDE_INT x) + { + return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1; diff --git a/var/spack/repos/builtin/packages/gccxml/package.py b/var/spack/repos/builtin/packages/gccxml/package.py index d7f75f8631..fc54b3a91f 100644 --- a/var/spack/repos/builtin/packages/gccxml/package.py +++ b/var/spack/repos/builtin/packages/gccxml/package.py @@ -34,3 +34,5 @@ class Gccxml(CMakePackage): commit='3afa8ba5be6866e603dcabe80aff79856b558e24', preferred=True) patch('darwin-gcc.patch', when='%gcc platform=darwin') + # taken from https://github.com/gccxml/gccxml/issues/11#issuecomment-140334118 + patch('gcc-5.patch', when='%gcc@5:') |