This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: processor type defines: __PPC403__, __PPC750__ would be nice?


Peter Barada wrote:
> I'll make the assumption that you're using gcc-3.0.4 since that's what
> I have right in front of me.  YMMV for other versions.  Look in the
> installed ppc compiler specs file for "*cpp" and the following line is
> the 'expression' that is used to generate the definitions for the
> preprocessor.  you could add to that line(for the powerpc specs file):
> 
> %{mcpu=403: -D__ppc403__}%{mcpu=750: -D__ppc750__}
> ...
I figure I'll make that change via a patch to the file
config/rs6000/sysv4.h, whence the specs file comes.
That way I can contribute this back as a patch to the
mainline gcc3 source tree.

> This allows you to have code that looks like:
> 
> #if defined(__SH4__) ...
> #elif defined(__PPC403__) ...
> #elif defined(__PPC750__) ...
> #elif defined(__i586__) ...
> #else
> #error "chip specified is not one of sh4, ppc403, ppc750, or i586!"
> #endif
> 
> Of course the next time you upgrade your compiler you'll have to make
> the above change again and check the rs6000.h, sh.h, and i386.h to
> make sure the symbols are what you expect...

Right -- that's why I prefer making the change as a patch and
getting it into the main source tree.

Since we already have this for sh4 and for x86, it seems reasonable
to propose it for ppc, too.  Don't you think?
- Dan

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]