summaryrefslogtreecommitdiff
path: root/lang/pgcc/patches/patch-af
blob: aca3b11cca6f9be0eade2827cb2532e223572df0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
$NetBSD: patch-af,v 1.1 2002/03/14 14:54:51 wiz Exp $

--- ../gcc-2.95.2/gcc/config/sparc/netbsd64.h.orig	Fri Apr 27 10:59:15 2001
+++ ../gcc-2.95.2/gcc/config/sparc/netbsd64.h
@@ -0,0 +1,172 @@
+/* NetBSD/sparc64 ELF configuration */
+
+/*
+ * Pull in generic SPARC64 ELF configuration, and then clean up
+ * afterwards
+ */
+
+/* Let us output 32 bit code as well */
+#define SPARC_BI_ARCH
+
+/* Name the target CPU.  This must be before <sparc/sparc.h>. */
+#ifndef TARGET_CPU_DEFAULT
+#define TARGET_CPU_DEFAULT    TARGET_CPU_ultrasparc
+#endif
+
+#include <sparc/sp64-elf.h>
+
+#include <sparc/netbsd-elf-common.h>
+
+#undef CPP_SUBTARGET_SPEC
+#define CPP_SUBTARGET_SPEC "-D__sparc64__"
+
+#undef LINK_SPEC64
+#define LINK_SPEC64 \
+ "-m elf64_sparc \
+  %{assert*} %{R*} \
+  %{shared:-shared} \
+  %{!shared: \
+    -dy -dc -dp \
+    %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
+    %{static:-static}}"
+
+#undef LINK_SPEC
+#define LINK_SPEC LINK_SPEC64
+
+#ifdef SPARC_BI_ARCH
+
+#undef STARTFILE_SPEC64
+#define	STARTFILE_SPEC64 \
+ "%{!shared: \
+     %{pg:gcrt0%O%s} \
+     %{!pg: \
+        %{p:gcrt0%O%s} \
+        %{!p:crt0%O%s}}} \
+   %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}"
+
+#undef STARTFILE_SPEC32
+#define	STARTFILE_SPEC32 \
+ "%{!shared: \
+     %{pg:/emul/netbsd32/usr/lib/gcrt0%O%s} \
+     %{!pg: \
+        %{p:/emul/netbsd32/usr/lib/gcrt0%O%s} \
+        %{!p:/emul/netbsd32/usr/lib/crt0%O%s}}} \
+   %{!shared:/emul/netbsd32/usr/lib/crtbegin%O%s} %{shared:/emul/netbsd32/usr/lib/crtbeginS%O%s}"
+
+#undef STARTFILE_SPEC
+#if DEFAULT_ARCH32_P
+#define STARTFILE_SPEC "\
+%{m32:" STARTFILE_SPEC32 "} \
+%{m64:" STARTFILE_SPEC64 "} \
+%{!m32:%{!m64:" STARTFILE_SPEC32 "}}"
+#else
+#define STARTFILE_SPEC "\
+%{m32:" STARTFILE_SPEC32 "} \
+%{m64:" STARTFILE_SPEC64 "} \
+%{!m32:%{!m64:" STARTFILE_SPEC64 "}}"
+#endif
+
+#undef ENDFILE_SPEC64
+#define	ENDFILE_SPEC64 \
+ "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+
+#undef ENDFILE_SPEC32
+#define	ENDFILE_SPEC32 \
+ "%{!shared:/emul/netbsd32/usr/lib/crtend%O%s} %{shared:/emul/netbsd32/usr/lib/crtendS%O%s}"
+
+#undef ENDFILE_SPEC
+#if DEFAULT_ARCH32_P
+#define ENDFILE_SPEC "\
+%{m32:" ENDFILE_SPEC32 "} \
+%{m64:" ENDFILE_SPEC64 "} \
+%{!m32:%{!m64:" ENDFILE_SPEC32 "}}"
+#else
+#define ENDFILE_SPEC "\
+%{m32:" ENDFILE_SPEC32 "} \
+%{m64:" ENDFILE_SPEC64 "} \
+%{!m32:%{!m64:" ENDFILE_SPEC64 "}}"
+#endif
+
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+  { "link_arch32",       LINK_ARCH32_SPEC },              \
+  { "link_arch64",       LINK_ARCH64_SPEC },              \
+  { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
+  { "link_arch",	 LINK_ARCH_SPEC },
+
+#undef LINK_ARCH32_SPEC
+#define LINK_ARCH32_SPEC \
+ "-m elf32_sparc \
+  -Y P,/emul/netbsd32/usr/lib \
+  %{assert*} %{R*} \
+  %{shared:-shared} \
+  %{!shared: \
+    -dy -dc -dp \
+    %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
+    %{static:-static}}"
+
+#undef LINK_ARCH64_SPEC
+#define LINK_ARCH64_SPEC LINK_SPEC64
+
+#define LINK_ARCH_SPEC "\
+%{m32:%(link_arch32)} \
+%{m64:%(link_arch64)} \
+%{!m32:%{!m64:%(link_arch_default)}} \
+"
+
+#define LINK_ARCH_DEFAULT_SPEC \
+(DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
+
+#undef  LINK_SPEC
+#define LINK_SPEC "\
+%(link_arch) \
+%{mlittle-endian:-EL} \
+"
+
+#undef	CC1_SPEC
+#if DEFAULT_ARCH32_P
+#define CC1_SPEC "\
+%{sun4:} %{target:} \
+%{mcypress:-mcpu=cypress} \
+%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
+%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
+%{m64:-mptr64 -mcpu=ultrasparc -mstack-bias} \
+"
+#else
+#define CC1_SPEC "\
+%{sun4:} %{target:} \
+%{mcypress:-mcpu=cypress} \
+%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
+%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
+%{m32:-mptr32 -mcpu=cypress -mno-stack-bias} \
+"
+#endif
+
+#if DEFAULT_ARCH32_P
+#define MULTILIB_DEFAULTS { "m32" }
+#else
+#define MULTILIB_DEFAULTS { "m64" }
+#endif
+
+#undef CPP_SUBTARGET_SPEC
+#define CPP_SUBTARGET_SPEC \
+(DEFAULT_ARCH32_P ? "\
+%{m64:-D__sparc64__}%{!m64:-D__sparc} \
+" : "\
+%{!m32:-D__sparc64__}%{m32:-D__sparc} \
+")
+
+#endif	/* SPARC_BI_ARCH */
+
+/* Name the port. */
+#undef TARGET_NAME
+#define TARGET_NAME     "sparc64-netbsd"
+
+/* Use sjlj exceptions. */
+#define DWARF2_UNWIND_INFO 0