[Bug lto/65252] Link time optimization breaks use of filenames in linker scripts
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65252 Richard Biener rguenth at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC||hubicka at gcc dot gnu.org Resolution|--- |WONTFIX --- Comment #3 from Richard Biener rguenth at gcc dot gnu.org --- LTO doesn't know about linker scripts and their effects (see other related bugreports). For your case LTO partitioning might simply tear boot.o and early.o apart and put parts in differen LTRANS units. I don't see any way to fix this but to teach WPA to parse linker scripts and guide partitioning. That means basically a WONTFIX with the known workaround to compile boot.o and early.o without -flto. Another workaround that might work is to use -flto-partition=1to1 (but the filenames will still get wrong I think).
[Bug lto/65252] Link time optimization breaks use of filenames in linker scripts
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65252 Markus Trippelsdorf trippels at gcc dot gnu.org changed: What|Removed |Added CC||trippels at gcc dot gnu.org --- Comment #1 from Markus Trippelsdorf trippels at gcc dot gnu.org --- You could use -fno-lto when compiling early.cc.
[Bug lto/65252] Link time optimization breaks use of filenames in linker scripts
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65252 --- Comment #2 from Goswin von Brederlow goswin-v-b at web dot de --- As long as it's only one C/C++ file that works. But if one has multiple files then -fno-lto would optimize less. I was thinking of a more general case than mine.