What exact version of gcc are you guys using? Something from rawhide that I can just install?
I am using Fedora 34. I upgraded just to test this bug and it seems stable except that GNOME Shell extensions need an upgrade. However I haven't tried building all of QEMU, only the test case.
So far I have failed to compile with gcc master with --enable-lto. Lots of
missing symbols reported at link time. Therefore I've been unable to actually
test what I intended to test.
That said, I'm not hopeful that __attribute__((const)) will work. I have an
idea that early inlining will inline tiny function calls too soon, before the
attribute has a change to DTRT during CSE.
Yeah that's at least plausible.
Another workaround may be to avoid compiling exec-vary.c with -flto. I'm not
sure that my meson fu is up to that. Paolo?
You would have to define a static library.
Good point, I can give it a shot too just to see how rusty I am... That would be the best outcome, though we would have to check LLVM as well. If const doesn't work it would indeed be prudent to include Gavin's configure check.
Paolo