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

Eugene Toder eltoder at gmail.com
Fri Sep 3 15:13:03 PDT 2010


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

On Fri, Sep 3, 2010 at 5:43 PM, Anton Korobeynikov
<anton at korobeynikov.info> wrote:
>> /[..]/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.
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list