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. */
7 /* Look for the include files in the system-defined places. */
9 #undef GPLUSPLUS_INCLUDE_DIR
10 #define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
12 #undef GCC_INCLUDE_DIR
13 #define GCC_INCLUDE_DIR "/usr/include"
15 #undef INCLUDE_DEFAULTS
16 #define INCLUDE_DEFAULTS \
18 { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \
19 { GCC_INCLUDE_DIR, 0, 0 }, \
23 /* Under NetBSD, the normal location of the compiler back ends is the
24 /usr/libexec directory. */
26 #undef STANDARD_EXEC_PREFIX
27 #define STANDARD_EXEC_PREFIX "/usr/libexec/"
29 /* Under NetBSD, the normal location of the various *crt*.o files is the
30 /usr/lib directory. */
32 #undef STANDARD_STARTFILE_PREFIX
33 #define STANDARD_STARTFILE_PREFIX "/usr/lib/"
38 /* Provide a CPP_SPEC appropriate for NetBSD. Current we just deal with
39 the GCC option `-posix'. */
42 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
44 /* Provide an ASM_SPEC appropriate for NetBSD. Currently we only deal
45 with the options for generating PIC code. */
48 #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}"
50 /* Provide a LIB_SPEC appropriate for NetBSD. Just select the appropriate
51 libc, depending on whether we're doing profiling. */
54 #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
56 /* Provide a LINK_SPEC appropriate for NetBSD. Here we provide support
57 for the special GCC options -static, -assert, and -nostdlib. */
61 "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}"
64 /* We have atexit(3). */
68 /* Implicit library calls should use memcpy, not bcopy, etc. */
70 #define TARGET_MEM_FUNCTIONS
73 * Some imports from svr4.h in support of shared libraries.
74 * Currently, we need the DECLARE_OBJECT_SIZE stuff.
77 /* Define the strings used for the special svr4 .type and .size directives.
78 These strings generally do not vary from one system running svr4 to
79 another, but if a given system (e.g. m88k running svr) needs to use
80 different pseudo-op names for these, they may be overridden in the
81 file which includes this one. */
86 #define TYPE_ASM_OP ".type"
87 #define SIZE_ASM_OP ".size"
88 #define WEAK_ASM_OP ".weak"
90 /* The following macro defines the format used to output the second
91 operand of the .type assembler directive. Different svr4 assemblers
92 expect various different forms for this operand. The one given here
93 is just a default. You may need to override it in your machine-
94 specific tm.h file (depending upon the particulars of your assembler). */
96 #undef TYPE_OPERAND_FMT
97 #define TYPE_OPERAND_FMT "@%s"
99 /* Write the extra assembler code needed to declare a function's result.
100 Most svr4 assemblers don't require any special declaration of the
101 result value, but there are exceptions. */
103 #ifndef ASM_DECLARE_RESULT
104 #define ASM_DECLARE_RESULT(FILE, RESULT)
107 /* These macros generate the special .type and .size directives which
108 are used to set the corresponding fields of the linker symbol table
109 entries in an ELF object file under SVR4. These macros also output
110 the starting labels for the relevant functions/objects. */
112 /* Write the extra assembler code needed to declare a function properly.
113 Some svr4 assemblers need to also have something extra said about the
114 function's return value. We allow for that here. */
116 #undef ASM_DECLARE_FUNCTION_NAME
117 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
119 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
120 assemble_name (FILE, NAME); \
122 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
124 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
125 ASM_OUTPUT_LABEL(FILE, NAME); \
128 /* Write the extra assembler code needed to declare an object properly. */
130 #undef ASM_DECLARE_OBJECT_NAME
131 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
133 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
134 assemble_name (FILE, NAME); \
136 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
138 size_directive_output = 0; \
139 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
141 size_directive_output = 1; \
142 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
143 assemble_name (FILE, NAME); \
144 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
146 ASM_OUTPUT_LABEL(FILE, NAME); \
149 /* Output the size directive for a decl in rest_of_decl_compilation
150 in the case where we did not do so before the initializer.
151 Once we find the error_mark_node, we know that the value of
152 size_directive_output was set
153 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
155 #undef ASM_FINISH_DECLARE_OBJECT
156 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
158 char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
159 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
160 && ! AT_END && TOP_LEVEL \
161 && DECL_INITIAL (DECL) == error_mark_node \
162 && !size_directive_output) \
164 size_directive_output = 1; \
165 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
166 assemble_name (FILE, name); \
167 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
171 /* This is how to declare the size of a function. */
173 #undef ASM_DECLARE_FUNCTION_SIZE
174 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
176 if (!flag_inhibit_size_directive) \
179 static int labelno; \
181 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
182 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
183 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
184 assemble_name (FILE, (FNAME)); \
185 fprintf (FILE, ","); \
186 assemble_name (FILE, label); \
187 fprintf (FILE, "-"); \
188 assemble_name (FILE, (FNAME)); \