This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/56533] Linker problem on avr with lto and main function inside archive
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 05 Mar 2013 12:38:51 +0000
- Subject: [Bug target/56533] Linker problem on avr with lto and main function inside archive
- Auto-submitted: auto-generated
- References: <bug-56533-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56533
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-05 12:38:51 UTC ---
+ /usr/bin/avr-gcc -mmcu=atmega328p -Os -flto -fwhole-program realmain.o
main.a
please provide the console output produced when adding -v to the above
commandline. I suspect that you fall foul of using -fwhole-program without
making the whole program visible to gcc via -flto by means of not using
a compiler that can handle LTO of static archives.
In general, don't use -fwhole-program with -flto, -flto is smart enough
to discover things more intelligently.