This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Success with MinGW and AVR and LTO - almost
- From: Andrew Hutchinson <andrewhutchinson at cox dot net>
- To: GCC Development <gcc at gcc dot gnu dot org>, Denis Chertykov <chertykov at gmail dot com>, Anatoly Sokolov <aesok at post dot ru>, "Weddington, Eric" <Eric dot Weddington at atmel dot com>
- Date: Sun, 10 Jan 2010 09:05:28 -0500
- Subject: Success with MinGW and AVR and LTO - almost
I have just succeed in building last snapshot version 4.5.0 20100107 for
AVR target with working LTO on both LINUX and MinGW hosts!
As noted before #define LINKER_NAME has to be deleted from target avr.h
(I will raise patch for this)
I also built avr target for MINGW under MSYS and this has no obvious
issues for either build or use with normal (non-lto) compilation
However, LTO use failed completely.
LTO using libelf needs to handle files as BINARY with Windows. This
would seem to apply to any target on MinGW
I hacked fopen/open calls in lto.c and lto-elf.c to use O_BINARY and
"rb" and compilation with -flto was then successful!
I am not sure how this should be fixed properly.
Andy