1 Warning! The powerpc patch (rs6000/linux.h) is hack-ish and would
2 definitely need to be improved to be acceptable upstream. Also,
3 this patch isn't complete as it only supports i386, arm, mips, and
5 diff -urN gcc-20011006/config.sub gcc-20011006-new/config.sub
6 --- gcc-20011006/config.sub 2004-01-13 06:15:28.000000000 -0600
7 +++ gcc-20011006-new/config.sub 2004-01-10 11:09:35.000000000 -0600
9 # Here we must recognize all the valid KERNEL-OS combinations.
10 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
13 + linux-gnu* | linux-uclibc*)
15 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
18 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
19 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
20 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
21 - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
22 + | -mingw32* | -linux-gnu* | -linux-uclibc* \
23 + | -uxpv* | -beos* | -mpeix* | -udk* \
24 | -interix* | -uwin* )
25 # Remember, each alternative MUST END IN *, to match a version number.
27 diff -urN gcc-20011006/gcc/config/arm/linux-elf.h gcc-20011006-new/gcc/config/arm/linux-elf.h
28 --- gcc-20011006/gcc/config/arm/linux-elf.h 2004-01-13 06:15:28.000000000 -0600
29 +++ gcc-20011006-new/gcc/config/arm/linux-elf.h 2004-01-10 11:12:11.000000000 -0600
31 #define ENDFILE_SPEC \
32 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
35 +#define LINK_SPEC "%{h*} %{version:-v} \
37 + %{static:-Bstatic} \
39 + %{symbolic:-Bsymbolic} \
40 + %{rdynamic:-export-dynamic} \
41 + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
43 + %{mbig-endian:-EB}" \
44 + SUBTARGET_EXTRA_LINK_SPEC
46 #define LINK_SPEC "%{h*} %{version:-v} \
52 SUBTARGET_EXTRA_LINK_SPEC
56 #define CPP_PREDEFINES \
57 diff -urN gcc-20011006/gcc/config/i386/linux.h gcc-20011006-new/gcc/config/i386/linux.h
58 --- gcc-20011006/gcc/config/i386/linux.h 2001-04-03 17:38:59.000000000 -0500
59 +++ gcc-20011006-new/gcc/config/i386/linux.h 2004-01-10 11:15:38.000000000 -0600
64 +#if defined USE_UCLIBC
65 +#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
69 + %{rdynamic:-export-dynamic} \
70 + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
71 + %{static:-static}}}"
73 #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
77 %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
82 /* Get perform_* macros to build libgcc.a. */
83 #include "i386/perform.h"
84 diff -urN gcc-20011006/gcc/config/mips/linux.h gcc-20011006-new/gcc/config/mips/linux.h
85 --- gcc-20011006/gcc/config/mips/linux.h 2004-01-13 06:15:28.000000000 -0600
86 +++ gcc-20011006-new/gcc/config/mips/linux.h 2004-01-10 11:16:39.000000000 -0600
89 /* Borrowed from sparc/linux.h */
98 + %{rdynamic:-export-dynamic} \
99 + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
100 + %{static:-static}}}"
106 %{rdynamic:-export-dynamic} \
107 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
112 #undef SUBTARGET_ASM_SPEC
113 diff -urN old/gcc-20011006/gcc/config/mips/t-linux-uclibc gcc-20011006/gcc/config/mips/t-linux-uclibc
114 --- old/gcc-20011006/gcc/config/mips/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
115 +++ gcc-20011006/gcc/config/mips/t-linux-uclibc 2004-01-14 02:51:10.000000000 -0600
117 +T_CFLAGS = -DUSE_UCLIBC
118 diff -urN gcc-20011006/gcc/config/rs6000/linux.h gcc-20011006-new/gcc/config/rs6000/linux.h
119 --- gcc-20011006/gcc/config/rs6000/linux.h 2001-04-03 17:38:59.000000000 -0500
120 +++ gcc-20011006-new/gcc/config/rs6000/linux.h 2004-01-10 11:15:38.000000000 -0600
122 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
126 +#define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
129 + %{rdynamic:-export-dynamic} \
130 + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
131 + %{static:-static}}"
133 #define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
136 %{rdynamic:-export-dynamic} \
137 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
141 #undef LIB_DEFAULT_SPEC
142 #define LIB_DEFAULT_SPEC "%(lib_linux)"
143 diff -urN gcc-20011006/gcc/config/t-linux-uclibc gcc-20011006-new/gcc/config/t-linux-uclibc
144 --- gcc-20011006/gcc/config/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
145 +++ gcc-20011006-new/gcc/config/t-linux-uclibc 2004-01-10 11:18:46.000000000 -0600
147 +T_CFLAGS = -DUSE_UCLIBC
149 +# Don't run fixproto
152 +# Don't install "assert.h" in gcc. We use the one in glibc.
155 +# Compile crtbeginS.o and crtendS.o with pic.
156 +CRTSTUFF_T_CFLAGS_S = -fPIC
157 +# Compile libgcc2.a with pic.
158 +TARGET_LIBGCC2_CFLAGS = -fPIC
160 +# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
161 +# C library can handle them.
165 diff -urN gcc-20011006/gcc/configure gcc-20011006-new/gcc/configure
166 --- gcc-20011006/gcc/configure 2004-01-13 06:15:28.000000000 -0600
167 +++ gcc-20011006-new/gcc/configure 2004-01-10 11:28:54.000000000 -0600
168 @@ -3219,6 +3219,24 @@
172 + arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc
173 + xm_file=arm/xm-linux.h
175 + tm_file="arm/linux-elf.h"
178 + tm_file="arm/linux-elf26.h $tm_file"
181 + tmake_file="t-linux-uclibc arm/t-linux"
182 + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
184 + case x${enable_threads} in
185 + x | xyes | xpthreads | xposix)
186 + thread_file='posix'
192 tmake_file=arm/t-bare
193 @@ -3631,6 +3649,18 @@
197 + i[34567]86-*-linux*uclibc*) # Intel 80386's running GNU/Linux
198 + # with ELF format using uClibc
200 + tm_file=i386/linux.h
201 + tmake_file="t-linux-uclibc i386/t-crtstuff"
202 + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
205 + if test x$enable_threads = xyes; then
206 + thread_file='posix'
209 i[34567]86-*-linux-gnu*) # Intel 80386's running GNU/Linux
210 # aka GNU/Linux C library 6
212 @@ -4696,7 +4726,19 @@
213 # On NetBSD, the headers are already okay, except for math.h.
216 - mips*-*-linux*) # Linux MIPS, either endian.
217 + mips*-*-linux-uclibc*) # Linux (uclibc) MIPS, either endian.
218 + tmake_file=mips/t-linux-uclibc
220 + xm_file="xm-siglist.h ${xm_file}"
222 + mipsel-*) tm_file="mips/elfl.h mips/linux.h" ;;
223 + *) tm_file="mips/elf.h mips/linux.h" ;;
225 + extra_parts="crtbegin.o crtend.o"
229 + mips*-*-linux*) # Linux MIPS, either endian.
231 xm_file="xm-siglist.h ${xm_file}"
233 @@ -5159,6 +5201,24 @@
237 + powerpc-*-linux-uclibc*)
238 + tm_file=rs6000/linux.h
239 + xm_file="xm-siglist.h rs6000/xm-sysv4.h"
240 + xm_defines="USG ${xm_defines}"
241 + out_file=rs6000/rs6000.c
242 + if test x$gas = xyes
244 + tmake_file="rs6000/t-ppcos t-linux-uclibc rs6000/t-ppccomm"
246 + tmake_file="rs6000/t-ppc t-linux-uclibc rs6000/t-ppccomm"
249 + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
250 + extra_headers=ppc-asm.h
251 + if test x$enable_threads = xyes; then
252 + thread_file='posix'
255 powerpc-wrs-vxworks*)
257 xm_file="xm-siglist.h rs6000/xm-sysv4.h"
258 diff -urN gcc-20011006/ltconfig gcc-20011006-new/ltconfig
259 --- gcc-20011006/ltconfig 1999-06-21 21:35:12.000000000 -0500
260 +++ gcc-20011006-new/ltconfig 2004-01-10 11:34:23.000000000 -0600
262 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
266 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
269 @@ -1773,6 +1774,22 @@
277 + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
278 + soname_spec='${libname}${release}.so$major'
279 + finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
280 + shlibpath_var=LD_LIBRARY_PATH
281 + shlibpath_overrides_runpath=no
282 + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
283 + file_magic_cmd=/usr/bin/file
284 + file_magic_test_file=`echo /lib/libuClibc-*.so`
285 + # Assume using the uClibc dynamic linker.
286 + dynamic_linker="uClibc ld.so"
291 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then