]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/netbsd.h
1 /* Look for the include files in the system-defined places. */
3 #undef GPLUSPLUS_INCLUDE_DIR
4 #define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
7 #define GCC_INCLUDE_DIR "/usr/include"
9 #undef INCLUDE_DEFAULTS
10 #define INCLUDE_DEFAULTS \
12 { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \
13 { GCC_INCLUDE_DIR, 0, 0 }, \
18 /* Under NetBSD, the normal location of the `ld' and `as' programs is the
19 /usr/bin directory. */
22 #define MD_EXEC_PREFIX "/usr/bin/"
24 /* Under NetBSD, the normal location of the various *crt*.o files is the
25 /usr/lib directory. */
27 #undef MD_STARTFILE_PREFIX
28 #define MD_STARTFILE_PREFIX "/usr/lib/"
31 /* Provide a CPP_SPEC appropriate for NetBSD. Current we just deal with
32 the GCC option `-posix'. */
35 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
37 /* Provide an ASM_SPEC appropriate for NetBSD. Currently we only deal
38 with the options for generating PIC code. */
41 #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}"
43 /* Provide a LIB_SPEC appropriate for NetBSD. Just select the appropriate
44 libc, depending on whether we're doing profiling. */
47 #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
49 /* Provide a LINK_SPEC appropriate for NetBSD. Here we provide support
50 for the special GCC options -static, -assert, and -nostdlib. */
54 "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}"
57 /* We have atexit(3). */
61 /* Implicit library calls should use memcpy, not bcopy, etc. */
63 #define TARGET_MEM_FUNCTIONS
66 * Some imports from svr4.h in support of shared libraries.
67 * Currently, we need the DECLARE_OBJECT_SIZE stuff.
70 /* Define the strings used for the special svr4 .type and .size directives.
71 These strings generally do not vary from one system running svr4 to
72 another, but if a given system (e.g. m88k running svr) needs to use
73 different pseudo-op names for these, they may be overridden in the
74 file which includes this one. */
76 #define TYPE_ASM_OP ".type"
77 #define SIZE_ASM_OP ".size"
78 #define WEAK_ASM_OP ".weak"
80 /* The following macro defines the format used to output the second
81 operand of the .type assembler directive. Different svr4 assemblers
82 expect various different forms for this operand. The one given here
83 is just a default. You may need to override it in your machine-
84 specific tm.h file (depending upon the particulars of your assembler). */
86 #define TYPE_OPERAND_FMT "@%s"
88 /* Write the extra assembler code needed to declare a function's result.
89 Most svr4 assemblers don't require any special declaration of the
90 result value, but there are exceptions. */
92 #ifndef ASM_DECLARE_RESULT
93 #define ASM_DECLARE_RESULT(FILE, RESULT)
96 /* These macros generate the special .type and .size directives which
97 are used to set the corresponding fields of the linker symbol table
98 entries in an ELF object file under SVR4. These macros also output
99 the starting labels for the relevant functions/objects. */
101 /* Write the extra assembler code needed to declare a function properly.
102 Some svr4 assemblers need to also have something extra said about the
103 function's return value. We allow for that here. */
105 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
107 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
108 assemble_name (FILE, NAME); \
110 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
112 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
113 ASM_OUTPUT_LABEL(FILE, NAME); \
116 /* Write the extra assembler code needed to declare an object properly. */
118 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
120 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
121 assemble_name (FILE, NAME); \
123 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
125 size_directive_output = 0; \
126 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
128 size_directive_output = 1; \
129 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
130 assemble_name (FILE, NAME); \
131 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
133 ASM_OUTPUT_LABEL(FILE, NAME); \
136 /* Output the size directive for a decl in rest_of_decl_compilation
137 in the case where we did not do so before the initializer.
138 Once we find the error_mark_node, we know that the value of
139 size_directive_output was set
140 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
142 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
144 char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
145 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
146 && ! AT_END && TOP_LEVEL \
147 && DECL_INITIAL (DECL) == error_mark_node \
148 && !size_directive_output) \
150 size_directive_output = 1; \
151 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
152 assemble_name (FILE, name); \
153 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
157 /* This is how to declare the size of a function. */
159 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
161 if (!flag_inhibit_size_directive) \
164 static int labelno; \
166 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
167 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
168 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
169 assemble_name (FILE, (FNAME)); \
170 fprintf (FILE, ","); \
171 assemble_name (FILE, label); \
172 fprintf (FILE, "-"); \
173 assemble_name (FILE, (FNAME)); \