Mikhail Glushenkov
2010-Sep-03 10:13 UTC
[LLVMdev] 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?
Anton Korobeynikov
2010-Sep-03 16:43 UTC
[LLVMdev] Cross-compiling LLVM with llvm-gcc produces a lot of warnings
> /[..]/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
Eugene Toder
2010-Sep-03 22:13 UTC
[LLVMdev] Cross-compiling LLVM with llvm-gcc produces a lot of warnings
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 >