Cross-compiling LLVM with llvm-gcc produces a lot of warnings

Hi,

I'm cross compiling (BUILD=darwin, HOST=i386-mingw32) LLVM with
llvm-gcc (both from current mainline). Everything works fine,
except that I get a lot of warnings of the following type:

[..]/lib/gcc/i386-mingw32/4.2.1/../../../../i386-mingw32/bin/ld:
/[..]/build-llvm/Release/lib/libLLVMSupport.a(APInt.o): warning:
duplicate section
`.text$linkonce__ZN4llvm5APInt17getSignedMinValueEj' has
different size

/[..]/lib/gcc/i386-mingw32/4.2.1/../../../../i386-mingw32/bin/ld:
/[..]/build-llvm/Release/lib/libLLVMSupport.a(APInt.o): warning:
duplicate section
`.text$linkonce__ZN4llvm5APInt17getSignedMaxValueEj' has
different size

/[..]/lib/gcc/i386-mingw32/4.2.1/../../../../i386-mingw32/bin/ld:
/[..]/build-llvm/Release/lib/libLLVMSupport.a(APInt.o): warning:
duplicate section `.text$linkonce__ZN4llvm5APIntlSEj' has
different size

/[..]/lib/gcc/i386-mingw32/4.2.1/../../../../i386-mingw32/bin/ld:
/[..]/build-llvm/Release/lib/libLLVMSupport.a(APInt.o): warning:
duplicate section `.text$linkonce__ZNK4llvm5APIntngEv' has
different size

Is this normal/known?

/[..]/lib/gcc/i386-mingw32/4.2.1/../../../../i386-mingw32/bin/ld:
/[..]/build-llvm/Release/lib/libLLVMSupport.a(APInt.o): warning:
duplicate section `.text$linkonce__ZNK4llvm5APIntngEv' has
different size

Is this normal/known?

Yes, this is known problem. In fact it was here for ages, but
previously we just grabbed
one "instance" of linkonce function without checking whether other
copies are the same.
Starting from May we're also checking for the contents and thus this
warning appeared.

Two copies of the linkonce function in question are almost identical,
however, one has all
EH stuff and other - don't. I haven't looked yet who is responsible
for this problem, but my
current assumption that this is a frontend fault.

Same problem can be seen via just libstdc++ compilation on mingw32.

Btw, with optimizations multiple copies of linkonce function can
easily diverge. A trivial example is

// a.h
int foo(int x);

inline int bar(int x) { return foo(x); }

// a.cpp
#include "a.h"

int foo(int x) { return 1; }

// b.cpp
#include "a.h"

Out-of-line copies of bar() in a.cpp and b.cpp will be different,
because in a.cpp foo() is likely to get inlined.

Eugene