1/* Definitions of target machine for GCC,
2   for ARM with targetting the VXWorks run time environment.
3   Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
4
5   Contributed by: Mike Stump <mrs@wrs.com>
6   Brought up to date by CodeSourcery, LLC.
7
8This file is part of GCC.
9
10GCC is free software; you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
12the Free Software Foundation; either version 2, or (at your option)
13any later version.
14
15GCC is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with GCC; see the file COPYING.  If not, write to
22the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23Boston, MA 02110-1301, USA.  */
24
25
26#define TARGET_OS_CPP_BUILTINS()		\
27  do {						\
28    builtin_define ("__vxworks");		\
29    if (TARGET_BIG_END)				\
30      builtin_define ("ARMEB");			\
31    else					\
32      builtin_define ("ARMEL");			\
33						\
34    if (arm_is_xscale)				\
35      builtin_define ("CPU=XSCALE");		\
36    else if (arm_arch5)				\
37      builtin_define ("CPU=ARMARCH5");		\
38    else if (arm_arch4)				\
39      {						\
40	if (thumb_code)				\
41	  builtin_define ("CPU=ARMARCH4_T");	\
42	else					\
43	  builtin_define ("CPU=ARMARCH4");	\
44      }						\
45  } while (0)
46
47#undef  CC1_SPEC
48#define CC1_SPEC							\
49"%{t4:        -mlittle-endian -march=armv4 ;			\
50   t4be:      -mbig-endian -march=armv4 ;			\
51   t4t:       -mthumb -mthumb-interwork -mlittle-endian -march=armv4t ;	\
52   t4tbe:     -mthumb -mthumb-interwork -mbig-endian -march=armv4t ;	\
53   t5:        -mlittle-endian -march=armv5 ;			\
54   t5be:      -mbig-endian -march=armv5 ;			\
55   t5t:       -mthumb -mthumb-interwork -mlittle-endian -march=armv5 ;	\
56   t5tbe:     -mthumb -mthumb-interwork -mbig-endian -march=armv5 ;	\
57   txscale:   -mlittle-endian -mcpu=xscale ;			\
58   txscalebe: -mbig-endian -mcpu=xscale ;			\
59            : -march=armv4}"
60
61/* The -Q options from svr4.h aren't understood and must be removed.  */
62#undef  ASM_SPEC
63#define ASM_SPEC \
64  "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
65
66/* VxWorks does all the library stuff itself.  */
67#undef  LIB_SPEC
68#define LIB_SPEC 	""
69
70/* VxWorks uses object files, not loadable images.  make linker just
71   combine objects.  */
72#undef  LINK_SPEC
73#define LINK_SPEC 	"-r"
74
75/* VxWorks provides the functionality of crt0.o and friends itself.  */
76#undef  STARTFILE_SPEC
77#define STARTFILE_SPEC 	""
78
79#undef  ENDFILE_SPEC
80#define ENDFILE_SPEC 	""
81
82#undef  TARGET_VERSION
83#define TARGET_VERSION	fputs (" (ARM/VxWorks)", stderr);
84
85/* There is no default multilib.  */
86#undef MULTILIB_DEFAULTS
87
88#undef  ASM_FILE_START
89#define ASM_FILE_START(STREAM) 						\
90  do 									\
91    {									\
92      fprintf (STREAM, "%s Generated by GCC %s for ARM/VxWorks\n",	\
93	       ASM_COMMENT_START, version_string);			\
94    }									\
95  while (0)
96