1 /* Definitions of target machine for GNU compiler,
2 for PowerPC NetBSD systems.
3 Copyright 2002, 2003 Free Software Foundation, Inc.
4 Contributed by Wasabi Systems, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 2, or (at your
11 option) any later version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to the
20 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
21 MA 02110-1301, USA. */
23 /* This defines which switch letters take arguments. On NetBSD, most
24 of the normal cases (defined by gcc.c) apply, and we also have -h*
25 and -z* options (for the linker) (coming from SVR4).
26 Copied from ../netbsd-elf.h and re{undef,defined} here to
27 override the powerpc sysv4.h definition.
28 netbsd-elf.h defines the default list + 'h' + 'z' + 'R'.
29 rs6000/sysv4.h defines the default list + 'G'. */
31 #undef SWITCH_TAKES_ARG
32 #define SWITCH_TAKES_ARG(CHAR) \
33 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
39 #undef TARGET_OS_CPP_BUILTINS /* FIXME: sysv4.h should not define this! */
40 #define TARGET_OS_CPP_BUILTINS() \
43 NETBSD_OS_CPP_BUILTINS_ELF(); \
44 builtin_define ("__powerpc__"); \
45 builtin_assert ("cpu=powerpc"); \
46 builtin_assert ("machine=powerpc"); \
50 /* Override the default from rs6000.h to avoid conflicts with macros
51 defined in NetBSD header files. */
53 #undef RS6000_CPU_CPP_ENDIAN_BUILTINS
54 #define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
57 if (BYTES_BIG_ENDIAN) \
59 builtin_define ("__BIG_ENDIAN__"); \
60 builtin_assert ("machine=bigendian"); \
64 builtin_define ("__LITTLE_ENDIAN__"); \
65 builtin_assert ("machine=littleendian"); \
70 /* Make GCC agree with <machine/ansi.h>. */
73 #define SIZE_TYPE "unsigned int"
76 #define PTRDIFF_TYPE "int"
78 /* Redefine some types that where redefined by rs6000 include files. */
81 #define WCHAR_TYPE "int"
83 #undef WCHAR_TYPE_SIZE
84 #define WCHAR_TYPE_SIZE 32
87 #define WINT_TYPE "int"
89 /* Undo the spec mess from sysv4.h, and just define the specs
90 the way NetBSD systems actually expect. */
93 #define CPP_SPEC NETBSD_CPP_SPEC
97 "%{!msdata=none:%{G*}} %{msdata=none:-G0} \
100 #define NETBSD_ENTRY_POINT "_start"
102 #undef STARTFILE_SPEC
103 #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
106 #define ENDFILE_SPEC \
107 "%(netbsd_endfile_spec)"
110 #define LIB_SPEC NETBSD_LIB_SPEC
112 #undef SUBTARGET_EXTRA_SPECS
113 #define SUBTARGET_EXTRA_SPECS \
114 { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \
115 { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \
116 { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC },
119 * Add NetBSD specific defaults: -mpowerpc -mnew_mnemonics -mstrict-align
121 #undef TARGET_DEFAULT
122 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN)
124 /* Attempt to enable execute permissions on the stack. */
125 #define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK
127 #undef TRAMPOLINE_SIZE
128 #define TRAMPOLINE_SIZE 48
131 /* Make sure _enable_execute_stack() isn't the empty function in libgcc2.c.
132 It gets defined in _trampoline.o via NETBSD_ENABLE_EXECUTE_STACK. */
133 #undef ENABLE_EXECUTE_STACK
134 #define ENABLE_EXECUTE_STACK
136 /* Override STACK_BOUNDARY to use Altivec compliant one. */
137 #undef STACK_BOUNDARY
138 #define STACK_BOUNDARY 128
140 #undef TARGET_VERSION
141 #define TARGET_VERSION fprintf (stderr, " (NetBSD/powerpc ELF)");