OSDN Git Service

* config/i386/sol2.h (UNALIGNED_DOUBLE_INT_ASM_OP): New.
[pf3gnuchains/gcc-fork.git] / gcc / config / netbsd.h
1 /* NETBSD_NATIVE is defined when gcc is integrated into the NetBSD
2    source tree so it can be configured appropriately without using
3    the GNU configure/build mechanism. */
4
5 #ifdef NETBSD_NATIVE
6
7 /* Look for the include files in the system-defined places.  */
8
9 #undef GPLUSPLUS_INCLUDE_DIR
10 #define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
11
12 #undef GCC_INCLUDE_DIR
13 #define GCC_INCLUDE_DIR "/usr/include"
14
15 #undef INCLUDE_DEFAULTS
16 #define INCLUDE_DEFAULTS                        \
17   {                                             \
18     { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },     \
19     { GCC_INCLUDE_DIR, "GCC", 0, 0 },           \
20     { 0, 0, 0, 0 }                              \
21   }
22
23 /* Under NetBSD, the normal location of the compiler back ends is the
24    /usr/libexec directory.  */
25
26 #undef STANDARD_EXEC_PREFIX
27 #define STANDARD_EXEC_PREFIX            "/usr/libexec/"
28
29 /* Under NetBSD, the normal location of the various *crt*.o files is the
30    /usr/lib directory.  */
31
32 #undef STANDARD_STARTFILE_PREFIX
33 #define STANDARD_STARTFILE_PREFIX       "/usr/lib/"
34
35 #endif
36
37
38 /* Provide a CPP_SPEC appropriate for NetBSD.  Current we just deal with
39    the GCC option `-posix'.  */
40
41 #undef CPP_SPEC
42 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
43
44 /* Provide an ASM_SPEC appropriate for NetBSD.  Currently we only deal
45    with the options for generating PIC code.  */
46
47 #undef ASM_SPEC
48 #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}"
49
50 /* Provide a LIB_SPEC appropriate for NetBSD.  Just select the appropriate
51    libc, depending on whether we're doing profiling.  */
52
53 #undef LIB_SPEC
54 #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
55
56 /* Provide a LINK_SPEC appropriate for NetBSD.  Here we provide support
57    for the special GCC options -static, -assert, and -nostdlib.  */
58
59 #undef LINK_SPEC
60 #define LINK_SPEC \
61   "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
62
63 /* This defines which switch letters take arguments. */
64 #undef SWITCH_TAKES_ARG
65 #define SWITCH_TAKES_ARG(CHAR) \
66   (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
67    || (CHAR) == 'R')
68
69 /* Implicit library calls should use memcpy, not bcopy, etc.  */
70
71 #define TARGET_MEM_FUNCTIONS
72
73 /* Handle #pragma weak and #pragma pack.  */
74
75 #define HANDLE_SYSV_PRAGMA
76 \f
77 /*
78  * Some imports from svr4.h in support of shared libraries.
79  * Currently, we need the DECLARE_OBJECT_SIZE stuff.
80  */
81
82 /* Define the strings used for the .type, .size, and .set directives.
83    These strings generally do not vary from one system running netbsd
84    to another, but if a given system needs to use different pseudo-op
85    names for these, they may be overridden in the file which includes
86    this one.  */
87
88 #undef TYPE_ASM_OP
89 #undef SIZE_ASM_OP
90 #undef SET_ASM_OP
91 #define TYPE_ASM_OP     "\t.type\t"
92 #define SIZE_ASM_OP     "\t.size\t"
93 #define SET_ASM_OP      "\t.set\t"
94
95 /* This is how we tell the assembler that a symbol is weak.  */
96
97 #undef ASM_WEAKEN_LABEL
98 #define ASM_WEAKEN_LABEL(FILE,NAME) \
99   do { fputs ("\t.globl\t", FILE); assemble_name (FILE, NAME); \
100        fputc ('\n', FILE); \
101        fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
102        fputc ('\n', FILE); } while (0)
103
104 /* The following macro defines the format used to output the second
105    operand of the .type assembler directive.  Different svr4 assemblers
106    expect various different forms for this operand.  The one given here
107    is just a default.  You may need to override it in your machine-
108    specific tm.h file (depending upon the particulars of your assembler).  */
109
110 #undef TYPE_OPERAND_FMT
111 #define TYPE_OPERAND_FMT        "@%s"
112
113 /* Write the extra assembler code needed to declare a function's result.
114    Most svr4 assemblers don't require any special declaration of the
115    result value, but there are exceptions.  */
116
117 #ifndef ASM_DECLARE_RESULT
118 #define ASM_DECLARE_RESULT(FILE, RESULT)
119 #endif
120
121 /* These macros generate the special .type and .size directives which
122    are used to set the corresponding fields of the linker symbol table
123    entries in an ELF object file under SVR4.  These macros also output
124    the starting labels for the relevant functions/objects.  */
125
126 /* Write the extra assembler code needed to declare a function properly.
127    Some svr4 assemblers need to also have something extra said about the
128    function's return value.  We allow for that here.  */
129
130 #undef ASM_DECLARE_FUNCTION_NAME
131 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
132   do {                                                                  \
133     fprintf (FILE, "%s", TYPE_ASM_OP);                                  \
134     assemble_name (FILE, NAME);                                         \
135     putc (',', FILE);                                                   \
136     fprintf (FILE, TYPE_OPERAND_FMT, "function");                       \
137     putc ('\n', FILE);                                                  \
138     ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));                      \
139     ASM_OUTPUT_LABEL(FILE, NAME);                                       \
140   } while (0)
141
142 /* Write the extra assembler code needed to declare an object properly.  */
143
144 #undef ASM_DECLARE_OBJECT_NAME
145 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)                       \
146   do {                                                                  \
147     fprintf (FILE, "%s", TYPE_ASM_OP);                                  \
148     assemble_name (FILE, NAME);                                         \
149     putc (',', FILE);                                                   \
150     fprintf (FILE, TYPE_OPERAND_FMT, "object");                         \
151     putc ('\n', FILE);                                                  \
152     size_directive_output = 0;                                          \
153     if (!flag_inhibit_size_directive && DECL_SIZE (DECL))               \
154       {                                                                 \
155         size_directive_output = 1;                                      \
156         fprintf (FILE, "%s", SIZE_ASM_OP);                              \
157         assemble_name (FILE, NAME);                                     \
158         fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (DECL))); \
159       }                                                                 \
160     ASM_OUTPUT_LABEL(FILE, NAME);                                       \
161   } while (0)
162
163 /* Output the size directive for a decl in rest_of_decl_compilation
164    in the case where we did not do so before the initializer.
165    Once we find the error_mark_node, we know that the value of
166    size_directive_output was set
167    by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
168
169 #undef ASM_FINISH_DECLARE_OBJECT
170 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)         \
171 do {                                                                     \
172      const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);             \
173      if (!flag_inhibit_size_directive && DECL_SIZE (DECL)                \
174          && ! AT_END && TOP_LEVEL                                        \
175          && DECL_INITIAL (DECL) == error_mark_node                       \
176          && !size_directive_output)                                      \
177        {                                                                 \
178          size_directive_output = 1;                                      \
179          fprintf (FILE, "%s", SIZE_ASM_OP);                              \
180          assemble_name (FILE, name);                                     \
181          fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (DECL))); \
182        }                                                                 \
183    } while (0)
184
185 /* This is how to declare the size of a function.  */
186
187 #undef ASM_DECLARE_FUNCTION_SIZE
188 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)                    \
189   do {                                                                  \
190     if (!flag_inhibit_size_directive)                                   \
191       {                                                                 \
192         char label[256];                                                \
193         static int labelno;                                             \
194         labelno++;                                                      \
195         ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno);            \
196         ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno);               \
197         fprintf (FILE, "%s", SIZE_ASM_OP);                              \
198         assemble_name (FILE, (FNAME));                                  \
199         fprintf (FILE, ",");                                            \
200         assemble_name (FILE, label);                                    \
201         fprintf (FILE, "-");                                            \
202         assemble_name (FILE, (FNAME));                                  \
203         putc ('\n', FILE);                                              \
204       }                                                                 \
205   } while (0)