tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Building cross/avr-gcc with clang (was: clang support)

> It still doesn't build, but I will continue working on it.
I guess I'm giving up on this.
It chokes on some double definition of floor_log2 and exact_log2, which can be 
avoided with this patch:

--- gcc/toplev.h.orig   2010-12-27 16:31:23.000000000 +0100
+++ gcc/toplev.h        2010-12-27 16:59:47.000000000 +0100
@@ -186,17 +186,19 @@
 #  define CTZ_HWI __builtin_ctz
 # endif
+#ifdef __cplusplus
 extern 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
 exact_log2 (unsigned HOST_WIDE_INT x)
   return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;
+#endif /* __cplusplus */
 #endif /* GCC_VERSION >= 3004 */
 /* Functions used to get and set GCC's notion of in what directory

but then linking fails with

ld: duplicate symbol _floor_log2 in c-omp.o and tree-mudflap.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

because the toplev.h is included in both files.

So I tried to build with gcc and re-ran into pkg/43455, which is still 
Applying my six months old patch still solves the problem.

Home | Main Index | Thread Index | Old Index