]>
git.ipfire.org Git - thirdparty/gcc.git/blob - 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. */
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. */
85 #define TYPE_ASM_OP ".type"
86 #define SIZE_ASM_OP ".size"
88 /* This is how we tell the assembler that a symbol is weak. */
90 #undef ASM_WEAKEN_LABEL
91 #define ASM_WEAKEN_LABEL(FILE,NAME) \
92 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
93 fputc ('\n', FILE); } while (0)
95 /* The following macro defines the format used to output the second
96 operand of the .type assembler directive. Different svr4 assemblers
97 expect various different forms for this operand. The one given here
98 is just a default. You may need to override it in your machine-
99 specific tm.h file (depending upon the particulars of your assembler). */
101 #undef TYPE_OPERAND_FMT
102 #define TYPE_OPERAND_FMT "@%s"
104 /* Write the extra assembler code needed to declare a function's result.
105 Most svr4 assemblers don't require any special declaration of the
106 result value, but there are exceptions. */
108 #ifndef ASM_DECLARE_RESULT
109 #define ASM_DECLARE_RESULT(FILE, RESULT)
112 /* These macros generate the special .type and .size directives which
113 are used to set the corresponding fields of the linker symbol table
114 entries in an ELF object file under SVR4. These macros also output
115 the starting labels for the relevant functions/objects. */
117 /* Write the extra assembler code needed to declare a function properly.
118 Some svr4 assemblers need to also have something extra said about the
119 function's return value. We allow for that here. */
121 #undef ASM_DECLARE_FUNCTION_NAME
122 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
124 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
125 assemble_name (FILE, NAME); \
127 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
129 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
130 ASM_OUTPUT_LABEL(FILE, NAME); \
133 /* Write the extra assembler code needed to declare an object properly. */
135 #undef ASM_DECLARE_OBJECT_NAME
136 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
138 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
139 assemble_name (FILE, NAME); \
141 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
143 size_directive_output = 0; \
144 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
146 size_directive_output = 1; \
147 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
148 assemble_name (FILE, NAME); \
149 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
151 ASM_OUTPUT_LABEL(FILE, NAME); \
154 /* Output the size directive for a decl in rest_of_decl_compilation
155 in the case where we did not do so before the initializer.
156 Once we find the error_mark_node, we know that the value of
157 size_directive_output was set
158 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
160 #undef ASM_FINISH_DECLARE_OBJECT
161 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
163 char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
164 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
165 && ! AT_END && TOP_LEVEL \
166 && DECL_INITIAL (DECL) == error_mark_node \
167 && !size_directive_output) \
169 size_directive_output = 1; \
170 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
171 assemble_name (FILE, name); \
172 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
176 /* This is how to declare the size of a function. */
178 #undef ASM_DECLARE_FUNCTION_SIZE
179 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
181 if (!flag_inhibit_size_directive) \
184 static int labelno; \
186 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
187 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
188 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
189 assemble_name (FILE, (FNAME)); \
190 fprintf (FILE, ","); \
191 assemble_name (FILE, label); \
192 fprintf (FILE, "-"); \
193 assemble_name (FILE, (FNAME)); \