summaryrefslogtreecommitdiffstats
path: root/toolchain/gcc/2.95/100-uclibc-conf.patch
blob: f244387cc9a52a2d2068c28ffdea656f5ff2ca8f (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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
Warning!  The powerpc patch (rs6000/linux.h) is hack-ish and would
definitely need to be improved to be acceptable upstream.  Also,
this patch isn't complete as it only supports i386, arm, mips, and
powerpc (rs6000).
diff -urN gcc-20011006/config.sub gcc-20011006-new/config.sub
--- gcc-20011006/config.sub	2004-01-13 06:15:28.000000000 -0600
+++ gcc-20011006-new/config.sub	2004-01-10 11:09:35.000000000 -0600
@@ -68,7 +68,7 @@
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  linux-gnu*)
+  linux-gnu* | linux-uclibc*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -936,7 +936,8 @@
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -linux-gnu* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* )
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
diff -urN gcc-20011006/gcc/config/arm/linux-elf.h gcc-20011006-new/gcc/config/arm/linux-elf.h
--- gcc-20011006/gcc/config/arm/linux-elf.h	2004-01-13 06:15:28.000000000 -0600
+++ gcc-20011006-new/gcc/config/arm/linux-elf.h	2004-01-10 11:12:11.000000000 -0600
@@ -90,6 +90,18 @@
 #define ENDFILE_SPEC \
   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
 
+#ifdef USE_UCLIBC
+#define LINK_SPEC "%{h*} %{version:-v} \
+   %{b} %{Wl,*:%*} \
+   %{static:-Bstatic} \
+   %{shared:-shared} \
+   %{symbolic:-Bsymbolic} \
+   %{rdynamic:-export-dynamic} \
+   %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
+   -X \
+   %{mbig-endian:-EB}" \
+   SUBTARGET_EXTRA_LINK_SPEC
+#else
 #define LINK_SPEC "%{h*} %{version:-v} \
    %{b} %{Wl,*:%*} \
    %{static:-Bstatic} \
@@ -100,6 +112,7 @@
    -X \
    %{mbig-endian:-EB}" \
    SUBTARGET_EXTRA_LINK_SPEC
+#endif
 
 #undef  CPP_PREDEFINES
 #define CPP_PREDEFINES \
diff -urN gcc-20011006/gcc/config/i386/linux.h gcc-20011006-new/gcc/config/i386/linux.h
--- gcc-20011006/gcc/config/i386/linux.h	2001-04-03 17:38:59.000000000 -0500
+++ gcc-20011006-new/gcc/config/i386/linux.h	2004-01-10 11:15:38.000000000 -0600
@@ -199,6 +199,15 @@
 	%{static:-static}}}"
 #endif
 #else
+#if defined USE_UCLIBC
+#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+  %{!shared: \
+    %{!ibcs: \
+      %{!static: \
+	%{rdynamic:-export-dynamic} \
+	%{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
+	%{static:-static}}}"
+#else
 #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
   %{!shared: \
     %{!ibcs: \
@@ -207,6 +216,7 @@
 	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
 	%{static:-static}}}"
 #endif
+#endif
 
 /* Get perform_* macros to build libgcc.a.  */
 #include "i386/perform.h"
diff -urN gcc-20011006/gcc/config/mips/linux.h gcc-20011006-new/gcc/config/mips/linux.h
--- gcc-20011006/gcc/config/mips/linux.h	2004-01-13 06:15:28.000000000 -0600
+++ gcc-20011006-new/gcc/config/mips/linux.h	2004-01-10 11:16:39.000000000 -0600
@@ -154,6 +154,17 @@
 
 /* Borrowed from sparc/linux.h */
 #undef LINK_SPEC
+#ifdef USE_UCLIBC
+#define LINK_SPEC \
+ "%(endian_spec) \
+  %{shared:-shared} \
+  %{!shared: \
+    %{!ibcs: \
+      %{!static: \
+        %{rdynamic:-export-dynamic} \
+        %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
+        %{static:-static}}}"
+#else
 #define LINK_SPEC \
  "%(endian_spec) \
   %{shared:-shared} \
@@ -163,6 +174,7 @@
         %{rdynamic:-export-dynamic} \
         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
         %{static:-static}}}"
+#endif
 
 
 #undef SUBTARGET_ASM_SPEC
diff -urN old/gcc-20011006/gcc/config/mips/t-linux-uclibc gcc-20011006/gcc/config/mips/t-linux-uclibc
--- old/gcc-20011006/gcc/config/mips/t-linux-uclibc	1969-12-31 18:00:00.000000000 -0600
+++ gcc-20011006/gcc/config/mips/t-linux-uclibc	2004-01-14 02:51:10.000000000 -0600
@@ -0,0 +1 @@
+T_CFLAGS = -DUSE_UCLIBC
diff -urN gcc-20011006/gcc/config/rs6000/linux.h gcc-20011006-new/gcc/config/rs6000/linux.h
--- gcc-20011006/gcc/config/rs6000/linux.h	2001-04-03 17:38:59.000000000 -0500
+++ gcc-20011006-new/gcc/config/rs6000/linux.h	2004-01-10 11:15:38.000000000 -0600
@@ -36,12 +36,21 @@
 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
 
 #undef LINK_SPEC
+#ifdef USE_UCLIBC
+#define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
+  %{!shared: \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
+    %{static:-static}}"
+#else
 #define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
   %{!shared: \
     %{!static: \
       %{rdynamic:-export-dynamic} \
       %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
     %{static:-static}}"
+#endif
 
 #undef	LIB_DEFAULT_SPEC
 #define LIB_DEFAULT_SPEC "%(lib_linux)"
diff -urN gcc-20011006/gcc/config/t-linux-uclibc gcc-20011006-new/gcc/config/t-linux-uclibc
--- gcc-20011006/gcc/config/t-linux-uclibc	1969-12-31 18:00:00.000000000 -0600
+++ gcc-20011006-new/gcc/config/t-linux-uclibc	2004-01-10 11:18:46.000000000 -0600
@@ -0,0 +1,18 @@
+T_CFLAGS = -DUSE_UCLIBC
+
+# Don't run fixproto
+STMP_FIXPROTO =
+
+# Don't install "assert.h" in gcc. We use the one in glibc.
+INSTALL_ASSERT_H =
+
+# Compile crtbeginS.o and crtendS.o with pic.
+CRTSTUFF_T_CFLAGS_S = -fPIC
+# Compile libgcc2.a with pic.
+TARGET_LIBGCC2_CFLAGS = -fPIC
+
+# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
+# C library can handle them.
+LIBGCC1 = 
+CROSS_LIBGCC1 =
+LIBGCC1_TEST =
diff -urN gcc-20011006/gcc/configure gcc-20011006-new/gcc/configure
--- gcc-20011006/gcc/configure	2004-01-13 06:15:28.000000000 -0600
+++ gcc-20011006-new/gcc/configure	2004-01-10 11:28:54.000000000 -0600
@@ -3219,6 +3219,24 @@
 			;;
 		esac
 		;;
+	arm*-*-linux-uclibc*)		# ARM GNU/Linux with ELF - uClibc
+		xm_file=arm/xm-linux.h
+		xmake_file=x-linux
+		tm_file="arm/linux-elf.h"
+		case $machine in
+		armv2*-*-*)
+			tm_file="arm/linux-elf26.h $tm_file"
+			;;
+		esac
+		tmake_file="t-linux-uclibc arm/t-linux"
+		extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+		gnu_ld=yes
+		case x${enable_threads} in
+		x | xyes | xpthreads | xposix)
+			thread_file='posix'
+			;;
+		esac
+		;;
 	arm*-*-aout)
 		tm_file=arm/aout.h
 		tmake_file=arm/t-bare
@@ -3631,6 +3649,18 @@
  			thread_file='single'
  		fi
 		;;
+	i[34567]86-*-linux*uclibc*)	# Intel 80386's running GNU/Linux
+					# with ELF format using uClibc
+		xmake_file=x-linux
+		tm_file=i386/linux.h
+		tmake_file="t-linux-uclibc i386/t-crtstuff"
+		extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+		gnu_ld=yes
+		float_format=i386
+ 		if test x$enable_threads = xyes; then
+ 			thread_file='posix'
+ 		fi
+		;;
 	i[34567]86-*-linux-gnu*)	# Intel 80386's running GNU/Linux
 					# aka GNU/Linux C library 6
 		xmake_file=x-linux
@@ -4696,7 +4726,19 @@
 		# On NetBSD, the headers are already okay, except for math.h.
 		tmake_file=t-netbsd
 		;;
-       mips*-*-linux*)                         # Linux MIPS, either endian.
+	mips*-*-linux-uclibc*)          # Linux (uclibc) MIPS, either endian.
+		tmake_file=mips/t-linux-uclibc
+		xmake_file=x-linux
+		xm_file="xm-siglist.h ${xm_file}"
+               case $machine in
+                       mipsel-*)  tm_file="mips/elfl.h mips/linux.h" ;;
+                       *)         tm_file="mips/elf.h mips/linux.h" ;;
+               esac
+		extra_parts="crtbegin.o crtend.o"
+		gnu_ld=yes
+		gas=yes
+		;;
+	mips*-*-linux*)                         # Linux MIPS, either endian.
 		xmake_file=x-linux
 		xm_file="xm-siglist.h ${xm_file}"
                case $machine in
@@ -5159,6 +5201,24 @@
 			thread_file='posix'
 		fi
 		;;
+	powerpc-*-linux-uclibc*)
+		tm_file=rs6000/linux.h
+		xm_file="xm-siglist.h rs6000/xm-sysv4.h"
+		xm_defines="USG ${xm_defines}"
+		out_file=rs6000/rs6000.c
+		if test x$gas = xyes
+		then
+			tmake_file="rs6000/t-ppcos t-linux-uclibc rs6000/t-ppccomm"
+		else
+			tmake_file="rs6000/t-ppc t-linux-uclibc rs6000/t-ppccomm"
+		fi
+		xmake_file=x-linux
+		extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+		extra_headers=ppc-asm.h
+		if test x$enable_threads = xyes; then
+			thread_file='posix'
+		fi
+		;;
         powerpc-wrs-vxworks*)
                 cpu_type=rs6000
 		xm_file="xm-siglist.h rs6000/xm-sysv4.h"
diff -urN gcc-20011006/ltconfig gcc-20011006-new/ltconfig
--- gcc-20011006/ltconfig	1999-06-21 21:35:12.000000000 -0500
+++ gcc-20011006-new/ltconfig	2004-01-10 11:34:23.000000000 -0600
@@ -436,6 +436,7 @@
 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
 case "$host_os" in
 linux-gnu*) ;;
+linux-uclibc*) ;;
 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
 esac
 
@@ -1773,6 +1774,22 @@
   fi
   ;;
 
+linux-uclibc*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}.so$major'
+  finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+  file_magic_cmd=/usr/bin/file
+  file_magic_test_file=`echo /lib/libuClibc-*.so`
+  # Assume using the uClibc dynamic linker.
+  dynamic_linker="uClibc ld.so"
+  ;;
+
 netbsd*)
   version_type=sunos
   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then