Mingw x64 Windows: plugin needed to process lto object

When I try to compile my project with 64-bit mingw (x86_64-5.1.0-posix-seh-rt_v4-rev0), I got messages:

BFD: my/project/dir/filename.cpp.obj: plugin needed to handle lto object 

for each source file. However, when I compile with 32-bit mingw (i686-5.1.0-posix-dwarf-rt_v4-rev0), everything is fine.

My flags:

 CXX_FLAGS "-fno-exceptions -fno-rtti -std=c++14 -O3 -fstrict-aliasing -flto -fomit-frame-pointer -march=native -ffast-math -funroll-loops" LINKER_FLAGS "-O1 -s" 

I tried adding -fuse-linker-plugin and -fno-use-linker-plugin, but that didn't help. My OS is 64-bit Windows 10. I use CLion and CMake if that matters, although it shouldn't. How can i fix this?

+8
c ++ windows mingw linker-errors lto
source share
1 answer

Place the LTO plugin in the bfd-plugins directory:

 mkdir mingw64\lib\bfd-plugins cp mingw64\libexec\gcc\x86_64-w64-mingw32\5.1.0\liblto_plugin-0.dll mingw64\lib\bfd-plugins\liblto_plugin-0.dll 
+8
source share

All Articles