msys2 / MSYS2-packages

Package scripts for MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
1.29k stars 489 forks source link

gcc lto broken with -Wa,-mbig-obj (error: plugin needed to handle lto object) #2951

Open OliverSCE opened 2 years ago

OliverSCE commented 2 years ago

Not sure if this has been reported already.

gcc 11.2.0 and gcc 11.3.0 are both broken (again) using -flto in combination with -Wa,-mbig-obj. Apparently that's an issues which is not new to gcc, and might not be a msys2 related problem at all, but at least the versions 8.x.x - 11.1.0 did work.

Is there any chance to fix this?

Oliver

stevenclarke9 commented 2 years ago

Have you also passed the option to the linker with "-Wl,-flto". lto is a linker plugin.

OliverSCE commented 2 years ago

I tried all optimization flags combinations with the linker , although lto flags are not necessary for the linker since ages (gcc 4.9). Just to be clear, lto works fine without -Wa,-mbig-obj.

The issues is not new, google will find several similar cases over time. Its apparently not directly linked to a specific gcc version, but to specific distributions.

Oliver

OliverSCE commented 2 years ago

In the mean time gcc 12.1.0 and binutils 2.38-3 were released, but no change.

The bug is still present.

Oliver