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?


Am Die, 2002-04-23 um 18.04 schrieb Dan Kegel:
> 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.
FWIW: Below is a similar patch I am currently working at for RTEMS (for
historical reasons RTEMS uses different defines and only supports a
subset of all -mcpu=XXX flags)

Ralf

diff -uNr ../gcc-3.0.4/gcc/config/rs6000/sysv4.h gcc-3.0.4/gcc/config/rs6000/sysv4.h
--- ../gcc-3.0.4/gcc/config/rs6000/sysv4.h	Sat Nov 10 00:00:31 2001
+++ gcc-3.0.4/gcc/config/rs6000/sysv4.h	Tue Apr 23 04:13:02 2002
@@ -1370,6 +1370,21 @@
 #define CPP_OS_NETBSD_SPEC "\
 -D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__"
 
+/* RTEMS support.  */
+
+#define CPP_OS_RTEMS_SPEC "\
+%{!mcpu*:  %{!Dppc*: %{!Dmpc*: -Dmpc750} } }\
+%{mcpu=403:  %{!Dppc*: %{!Dmpc*: -Dppc403}  } } \
+%{mcpu=505:  %{!Dppc*: %{!Dmpc*: -Dmpc505}  } } \
+%{mcpu=601:  %{!Dppc*: %{!Dmpc*: -Dppc601}  } } \
+%{mcpu=602:  %{!Dppc*: %{!Dmpc*: -Dppc602}  } } \
+%{mcpu=603:  %{!Dppc*: %{!Dmpc*: -Dppc603}  } } \
+%{mcpu=603e: %{!Dppc*: %{!Dmpc*: -Dppc603e} } } \
+%{mcpu=604:  %{!Dppc*: %{!Dmpc*: -Dmpc604}  } } \
+%{mcpu=750:  %{!Dppc*: %{!Dmpc*: -Dmpc750}  } } \
+%{mcpu=821:  %{!Dppc*: %{!Dmpc*: -Dmpc821}  } } \
+%{mcpu=860:  %{!Dppc*: %{!Dmpc*: -Dmpc860}  } }"
+
 /* Solaris support.  */
 /* For Solaris, Gcc automatically adds in one of the files
    /usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or
@@ -1526,6 +1541,7 @@
   { "cpp_os_netbsd",		CPP_OS_NETBSD_SPEC },			\
   { "cpp_os_solaris",		CPP_OS_SOLARIS_SPEC },			\
   { "cpp_os_vxworks",		CPP_OS_VXWORKS_SPEC },			\
+  { "cpp_os_rtems",		CPP_OS_RTEMS_SPEC },			\
   { "cpp_os_default",		CPP_OS_DEFAULT_SPEC },
 
 /* Define this macro as a C expression for the initializer of an

------
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]