3 --- ../gcc-2.95.3/gcc/config/netbsd.h
4 +++ ../gcc-2.95.3/gcc/config/netbsd.h.orig
8 /* Provide a CPP_SPEC appropriate for NetBSD. Current we just deal with
9 - the GCC option `-posix'. */
10 + the GCC option `-posix'. We also deal with -pthread, which is required
11 + for the 2.95.3 STL to work. */
14 -#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
16 + "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
17 + %{pthread:-D_REENTRANT -D_PTHREADS}"
19 /* Provide an ASM_SPEC appropriate for NetBSD. Currently we only deal
20 with the options for generating PIC code. */
25 - "%{posix:%{!p:%{!pg:-lposix}}%{p:-lposix_p}%{pg:-lposix_p}} \
26 + "%{pthread:%{!p:%{!pg:-lpthread}}%{p:-lpthread_p}%{pg:-lpthread_p}} \
27 + %{posix:%{!p:%{!pg:-lposix}}%{p:-lposix_p}%{pg:-lposix_p}} \
28 %{!shared:%{!symbolic:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}}"
30 /* Provide a LIBGCC_SPEC appropriate for NetBSD. We also want to exclude
33 #define LIBGCC_SPEC "%{!symbolic:%{!shared:%{!p:%{!pg:-lgcc}}}%{shared:-lgcc_pic}%{p:-lgcc_p}%{pg:-lgcc_p}}"
35 -#define LIBGCC_SPEC "%{!shared:%{!symbolic:-lgcc}}"
36 +#define LIBGCC_SPEC "%{!symbolic:%{!shared:-lgcc}%{shared:-lgcc_pic}}"
39 /* #ifdef NETBSD_AOUT */
41 #define ASM_DECLARE_RESULT(FILE, RESULT)
44 +/* NetBSD a.out support begins here. */
48 +#undef DWARF_DEBUGGING_INFO /* XXX */
49 +#undef DWARF2_DEBUGGING_INFO /* XXX */
51 +/* Write the extra assembler code needed to declare a function properly.
52 + Some svr4 assemblers need to also have something extra said about the
53 + function's return value. We allow for that here. */
55 +#undef ASM_DECLARE_FUNCTION_NAME
56 +#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
58 + fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
59 + assemble_name (FILE, NAME); \
61 + fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
62 + putc ('\n', FILE); \
63 + ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
64 + ASM_OUTPUT_LABEL(FILE, NAME); \
67 +/* Write the extra assembler code needed to declare an object properly. */
69 +#undef ASM_DECLARE_OBJECT_NAME
70 +#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
72 + fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
73 + assemble_name (FILE, NAME); \
75 + fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
76 + putc ('\n', FILE); \
77 + size_directive_output = 0; \
78 + if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
80 + size_directive_output = 1; \
81 + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
82 + assemble_name (FILE, NAME); \
83 + fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
85 + ASM_OUTPUT_LABEL(FILE, NAME); \
88 +/* Output the size directive for a decl in rest_of_decl_compilation
89 + in the case where we did not do so before the initializer.
90 + Once we find the error_mark_node, we know that the value of
91 + size_directive_output was set
92 + by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
94 +#undef ASM_FINISH_DECLARE_OBJECT
95 +#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
97 + char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
98 + if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
99 + && ! AT_END && TOP_LEVEL \
100 + && DECL_INITIAL (DECL) == error_mark_node \
101 + && !size_directive_output) \
103 + size_directive_output = 1; \
104 + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
105 + assemble_name (FILE, name); \
106 + fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
110 +/* This is how to declare the size of a function. */
112 +#undef ASM_DECLARE_FUNCTION_SIZE
113 +#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
115 + if (!flag_inhibit_size_directive) \
118 + static int labelno; \
120 + ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
121 + ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
122 + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
123 + assemble_name (FILE, (FNAME)); \
124 + fprintf (FILE, ","); \
125 + assemble_name (FILE, label); \
126 + fprintf (FILE, "-"); \
127 + assemble_name (FILE, (FNAME)); \
128 + putc ('\n', FILE); \
134 /* NetBSD ELF support begins here. */
141 + %:if-exists(crti%O%s) \
142 %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}"
144 /* Provide an ENDFILE_SPEC appropriate for NetBSD ELF targets. Here we
145 @@ -175,13 +270,14 @@
148 #define ENDFILE_SPEC \
149 - "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
150 + "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \
151 + %:if-exists(crtn%O%s)"
153 /* Provide a LINK_SPEC appropriate for a NetBSD ELF target. */
158 + "%{assert*} %{R*} \