Success with cegcc on MacOS X 10.9

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Success with cegcc on MacOS X 10.9

krestenkrab
This post has NOT been accepted by the mailing list yet.
FYI, I successfully compiled both cegcc and mingw32ce (and support libraries) on a recent MacOSX (10.9.2) by just applying this small patch.  There's something with the LLVM-backed c compiler that is different so we get multiple definitions. I'm just posting this here so people can search for it, as I pressume that cegcc is not being actively maintained.

Kresten Krab Thorup

Index:Index: cegcc/src/gcc-4.4.0/gcc/toplev.h
===================================================================
--- cegcc/src/gcc-4.4.0/gcc/toplev.h (revision 1449)
+++ cegcc/src/gcc-4.4.0/gcc/toplev.h (working copy)
@@ -186,17 +186,9 @@
 #  define CTZ_HWI __builtin_ctz
 # endif
 
-extern inline int
-floor_log2 (unsigned HOST_WIDE_INT x)
-{
-  return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1;
-}
+extern int floor_log2 (unsigned HOST_WIDE_INT x);
 
-extern inline int
-exact_log2 (unsigned HOST_WIDE_INT x)
-{
-  return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;
-}
+extern int exact_log2 (unsigned HOST_WIDE_INT x);
 #endif /* GCC_VERSION >= 3004 */
 
 /* Functions used to get and set GCC's notion of in what directory