|
From: | Dave N6NZ |
Subject: | Re: [avr-gcc-list] Bug? gcc silently assumes mcu model when linking, creating bad executable |
Date: | Mon, 21 Apr 2008 12:37:30 -0700 |
User-agent: | Thunderbird 1.5 (X11/20051201) |
Weddington, Eric wrote:
As Weddington, Eric wrote:My guess is all this comes from a time when AVR-GCC was created, and there were maybe three or four different AVRs only, so it did make some sense for it to default to one of them (IIRC, it defaults to the AT90S8515).I thought it defaults to an architecture, avr2 to be exact.As the linker has to default to some crt*.o file, it effectively defaults to a particular device. But those days, the differences between an architecture and a particular device were probably neglicible...Then a GCC bug report should be filled out and set it to "enhancement" to give an error if -mmcu is not on the compile and link command line.
In the short term, wouldn't it be possible to let the default run time library be a bogus crt.o that is guaranteed to throw a linker error? Of course the challenge is coming up with a way to get the situation to produce a sensible diagnostic message. But just forcing the error should be a simple matter of simply leaving out a fundamental symbol. At least it would keep the linker from silently generating a bad file.
-dave
[Prev in Thread] | Current Thread | [Next in Thread] |