FSF GCC merge 02/23/03
[official-gcc.git] / gcc / config / rs6000 / netbsd.h
blobb473a8a868fe0e507cf9951fc4f3101db5d10717
1 /* Definitions of target machine for GNU compiler,
2 for PowerPC NetBSD systems.
3 Copyright 2002 Free Software Foundation, Inc.
4 Contributed by Wasabi Systems, Inc.
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #undef TARGET_OS_CPP_BUILTINS /* FIXME: sysv4.h should not define this! */
24 #define TARGET_OS_CPP_BUILTINS() \
25 do \
26 { \
27 NETBSD_OS_CPP_BUILTINS_ELF(); \
28 builtin_define ("__powerpc__"); \
29 builtin_assert ("cpu=powerpc"); \
30 builtin_assert ("machine=powerpc"); \
31 } \
32 while (0)
34 /* Override the default from rs6000.h to avoid conflicts with macros
35 defined in NetBSD header files. */
37 #undef RS6000_CPU_CPP_ENDIAN_BUILTINS
38 #define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
39 do \
40 { \
41 if (BYTES_BIG_ENDIAN) \
42 { \
43 builtin_define ("__BIG_ENDIAN__"); \
44 builtin_assert ("machine=bigendian"); \
45 } \
46 else \
47 { \
48 builtin_define ("__LITTLE_ENDIAN__"); \
49 builtin_assert ("machine=littleendian"); \
50 } \
51 } \
52 while (0)
54 /* Make GCC agree with <machine/ansi.h>. */
56 #undef SIZE_TYPE
57 #define SIZE_TYPE "unsigned int"
59 #undef PTRDIFF_TYPE
60 #define PTRDIFF_TYPE "int"
62 /* Undo the spec mess from sysv4.h, and just define the specs
63 the way NetBSD systems actually expect. */
65 #undef CPP_SPEC
66 #define CPP_SPEC NETBSD_CPP_SPEC
68 #undef LINK_SPEC
69 #define LINK_SPEC \
70 "%{!msdata=none:%{G*}} %{msdata=none:-G0} \
71 %(netbsd_link_spec)"
73 #define NETBSD_ENTRY_POINT "_start"
75 #undef STARTFILE_SPEC
76 #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
78 #undef ENDFILE_SPEC
79 #define ENDFILE_SPEC \
80 "crtsavres%O%s %(netbsd_endfile_spec)"
82 #undef LIB_SPEC
83 #define LIB_SPEC NETBSD_LIB_SPEC
85 #undef SUBTARGET_EXTRA_SPECS
86 #define SUBTARGET_EXTRA_SPECS \
87 { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \
88 { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \
89 { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC },
92 #undef TARGET_VERSION
93 #define TARGET_VERSION fprintf (stderr, " (NetBSD/powerpc ELF)");