Re: Target options for gcc

David Brown <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers.coldfire
Organization WestControl a.s
Message-ID <[email protected]>
Greg Ungerer wrote:
> 
> Hi David,
> 
> David Brown wrote:
>> Greg Ungerer wrote:
>>> Hi Bob,
>>>
>>> Bob Brusa wrote:
>>>> On Tue, 08 Jan 2008 17:43:24 +0100, Seymour David 
>>>> <[email protected]> wrote:
>> <snip>
>>> Traditionally the uClinux kernel for the 5282 has used the -m5307
>>> switch - apparently its code instruction level timing tables in gcc
>>> are closer to that of the 5282 that the default -m5200 switch.
>>>
>>> But you can use -m5200 on any of the ColdFire family members.
>>>
>>>
>>>>> The manufacturer of the COBRA5285-Board I am using provided 
>>>>> examples. One
>>>>> of them uses the option -m5307 which is however nowhere documented.
>>>
>>> Looks like who ever merged the gcc changes that support those
>>> newer switches didn't update the manual. Even the latest 4.2.2
>>> doco doesn't list anything other than -m5200 (it does list the
>>> other new uClinux switches like -msep-data though...).
>>>
>>
>> If you use "m68k-elf-gcc -v --help", you'll see a list of all the 
>> command line switches for the gcc you are using.  In particular, if 
>> you get a recent build from CodeSourcery, there is direct support for 
>> a wide range of Coldfires - the switch you want is "-mcpu=5282".  In 
>> keeping with many other embedded gcc ports, CodeSourcery use the 
>> "-mcpu=" flag to make it easier to choose the exact instruction set 
>> and code generation options appropriate for different devices, as well 
>> as helping to get the correct linker file and libraries for the 
>> device.  Thus you should not specify "-m" options directly, but use 
>> the "-mcpu=" for your device.
>>
>> Since CodeSourcery work on their own branches of gcc, they can get 
>> changes into the code much faster than the standard FSF gcc tree, and 
>> thus their versions have newer features.  These all get merged back to 
>> the FSF (several of the official gcc lead developers work at 
>  >
>> CodeSourcery), but because changes must be tested clean on such a 
>> range of devices, it takes much longer - the "-mcpu=" flags will be in 
>> the FSF gcc at version 4.3, while CodeSourcery has them on 4.2-47.
>>
>>
>> Incidentally, the official gnu gcc docs for 4.1.1 *are* available on 
>> the gcc website - it's just that there is no direct link from the 
>> documentation page:
>>
>> http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/
> 
> Perhaps not recommended for use, but still no versions of the
> documentation list the -mxxxx options for the 5xx. Even though
> they extensively list the other 68xxx varients.
> 
> Regards
> Greg

The CodeSourcery documentation lists all the variants (I don't think 
they have it directly accessible on-line, but you'll get it along with 
the compiler downloads).  You can also see the list in the docs for the 
development version of gcc (i.e., 4.3):

http://gcc.gnu.org/onlinedocs/gcc/M680x0-Options.html#M680x0-Options


I didn't notice before that you are Greg of SnapGear and ucLinux fame. 
How well do CodeSourcery's compilers work with ucLinux?  I've only used 
them for stand-alone ColdFire development, but hope to test out ucLinux 
before too long.

mvh.,

David

---
[email protected]              Send a post to the list.
[email protected]        Join the list.
[email protected]    Join the list in digest mode.
[email protected]     Leave the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.