I am attempting to use GCC 4.9.2 to cross compile an application from Linux (x86_64-pc-linux-gnu) for Windows (x86_64-w64-mingw32).
When building targets that link a
I'm able to reproduce this linking problem on Mingw32-gcc 4.9.2 under Win7 64-bit. However, I did get it to link successfully by adding -ffat-lto-objects
as a workaround:
g++ -flto -o foo.o -c foo.cpp
g++ -flto -ffat-lto-objects -o bar.o -c bar.cpp
ar rc bar.a bar.o
g++ -flto -o foo.exe foo.o bar.a