xref: /openbsd/gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h (revision 0bf93e2a)
1 /* Configuration file for an rs6000 OpenBSD target.
2    Copyright (C) 1999 Free Software Foundation, Inc.
3 
4 This file is part of GNU CC.
5 
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10 
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20 
21 /* XXX need to check ASM_WEAKEN_LABEL/ASM_GLOBALIZE_LABEL. */
22 
23 /* Run-time target specifications. */
24 #undef TARGET_OS_CPP_BUILTINS	/* FIXME: sysv4.h should not define this! */
25 #define TARGET_OS_CPP_BUILTINS()		\
26   do						\
27     {						\
28 	OPENBSD_OS_CPP_BUILTINS_ELF();		\
29 	builtin_define ("__PPC");		\
30 	builtin_define ("__PPC__");		\
31 	builtin_define ("__powerpc");		\
32 	builtin_define ("__powerpc__");		\
33 	builtin_assert ("cpu=powerpc");		\
34 	builtin_assert ("machine=powerpc");	\
35     }						\
36   while (0)
37 
38 /* Override the default from rs6000.h to avoid conflicts with macros
39    defined in OpenBSD header files.  */
40 
41 #undef RS6000_CPU_CPP_ENDIAN_BUILTINS
42 #define RS6000_CPU_CPP_ENDIAN_BUILTINS()	\
43   do						\
44     {						\
45       if (BYTES_BIG_ENDIAN)			\
46 	{					\
47 	  builtin_define ("__BIG_ENDIAN__");	\
48 	  builtin_assert ("machine=bigendian");	\
49 	}					\
50       else					\
51 	{					\
52 	  builtin_define ("__LITTLE_ENDIAN__");	\
53 	  builtin_assert ("machine=littleendian"); \
54 	}					\
55     }						\
56   while (0)
57 
58 #undef	CPP_OS_DEFAULT_SPEC
59 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_openbsd)"
60 
61 #undef LINKER_NAME
62 #define LINKER_NAME "ld"
63 
64 #undef LINK_SPEC
65 #define LINK_SPEC "%{shared:-shared} \
66   %{!shared: \
67     %{!static: \
68       %{rdynamic:-export-dynamic} \
69       %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \
70     %{static:-static}}"
71 
72 #undef	LIB_DEFAULT_SPEC
73 #define LIB_DEFAULT_SPEC "%(lib_openbsd)"
74 
75 #undef	STARTFILE_DEFAULT_SPEC
76 #define STARTFILE_DEFAULT_SPEC "%(startfile_openbsd)"
77 
78 #undef	ENDFILE_DEFAULT_SPEC
79 #define ENDFILE_DEFAULT_SPEC "%(endfile_openbsd)"
80 
81 #undef	LINK_START_DEFAULT_SPEC
82 #define LINK_START_DEFAULT_SPEC "%(link_start_openbsd)"
83 
84 #undef	LINK_OS_DEFAULT_SPEC
85 #define LINK_OS_DEFAULT_SPEC "%(link_os_openbsd)"
86 
87 #undef TARGET_VERSION
88 #define TARGET_VERSION fprintf (stderr, " (PowerPC OpenBSD)");
89 
90 /* Default ABI to use */
91 #undef RS6000_ABI_NAME
92 #define RS6000_ABI_NAME "openbsd"
93 
94 /* Define this macro as a C expression for the initializer of an
95    array of string to tell the driver program which options are
96    defaults for this target and thus do not need to be handled
97    specially when using `MULTILIB_OPTIONS'.
98 
99    Do not define this macro if `MULTILIB_OPTIONS' is not defined in
100    the target makefile fragment or if none of the options listed in
101    `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
102 
103 #undef	MULTILIB_DEFAULTS
104 #define	MULTILIB_DEFAULTS { "mbig", "mcall-openbsd" }
105 
106 /* collect2 support (Macros for initialization). */
107 
108 
109 /* Don't tell collect2 we use COFF as we don't have (yet ?) a dynamic ld
110    library with the proper functions to handle this -> collect2 will
111    default to using nm. */
112 #undef OBJECT_FORMAT_COFF
113 
114 /* Some code gets optimized incorrectly by move_movables() in loop.c */
115 #define	BROKEN_MOVE_MOVABLES_P
116 
117 /* This must agree with <machine/_types.h> */
118 #undef SIZE_TYPE
119 #define SIZE_TYPE "long unsigned int"
120 
121 #undef PTRDIFF_TYPE
122 #define PTRDIFF_TYPE "long int"
123 
124 #undef WCHAR_TYPE
125 #define WCHAR_TYPE	"int"
126 
127 #undef WCHAR_TYPE_SIZE
128 #define WCHAR_TYPE_SIZE	32
129 
130