1 diff -Nur gcc-3.4.4.old/configure gcc-3.4.4/configure
2 --- gcc-3.4.4.old/configure 2005-03-08 18:31:40.000000000 +0100
3 +++ gcc-3.4.4/configure 2005-06-23 16:09:40.000000000 +0200
6 target_makefile_frag="config/mt-netware"
9 + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
10 target_makefile_frag="config/mt-linux"
12 *-*-aix4.[3456789]* | *-*-aix[56789].*)
13 diff -Nur gcc-3.4.4.old/configure.in gcc-3.4.4/configure.in
14 --- gcc-3.4.4.old/configure.in 2005-03-08 18:31:40.000000000 +0100
15 +++ gcc-3.4.4/configure.in 2005-06-23 16:09:40.000000000 +0200
18 target_makefile_frag="config/mt-netware"
21 + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
22 target_makefile_frag="config/mt-linux"
24 *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
25 diff -Nur gcc-3.4.4.old/gcc/config/i386/kfreebsd-gnu.h gcc-3.4.4/gcc/config/i386/kfreebsd-gnu.h
26 --- gcc-3.4.4.old/gcc/config/i386/kfreebsd-gnu.h 1970-01-01 01:00:00.000000000 +0100
27 +++ gcc-3.4.4/gcc/config/i386/kfreebsd-gnu.h 2005-06-23 16:09:40.000000000 +0200
29 +/* Definitions for Intel 386 running kFreeBSD-based GNU systems with ELF format
31 + Free Software Foundation, Inc.
32 + Contributed by Robert Millan.
34 +This file is part of GCC.
36 +GCC is free software; you can redistribute it and/or modify
37 +it under the terms of the GNU General Public License as published by
38 +the Free Software Foundation; either version 2, or (at your option)
41 +GCC is distributed in the hope that it will be useful,
42 +but WITHOUT ANY WARRANTY; without even the implied warranty of
43 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44 +GNU General Public License for more details.
46 +You should have received a copy of the GNU General Public License
47 +along with GCC; see the file COPYING. If not, write to
48 +the Free Software Foundation, 59 Temple Place - Suite 330,
49 +Boston, MA 02111-1307, USA. */
51 +#undef LINK_EMULATION
52 +#define LINK_EMULATION "elf_i386_fbsd"
54 +#define REG_NAME(reg) sc_ ## reg
55 diff -Nur gcc-3.4.4.old/gcc/config/i386/knetbsd-gnu.h gcc-3.4.4/gcc/config/i386/knetbsd-gnu.h
56 --- gcc-3.4.4.old/gcc/config/i386/knetbsd-gnu.h 1970-01-01 01:00:00.000000000 +0100
57 +++ gcc-3.4.4/gcc/config/i386/knetbsd-gnu.h 2005-06-23 16:09:41.000000000 +0200
59 +/* Definitions for Intel 386 running kNetBSD-based GNU systems with ELF format
61 + Free Software Foundation, Inc.
62 + Contributed by Robert Millan.
64 +This file is part of GCC.
66 +GCC is free software; you can redistribute it and/or modify
67 +it under the terms of the GNU General Public License as published by
68 +the Free Software Foundation; either version 2, or (at your option)
71 +GCC is distributed in the hope that it will be useful,
72 +but WITHOUT ANY WARRANTY; without even the implied warranty of
73 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74 +GNU General Public License for more details.
76 +You should have received a copy of the GNU General Public License
77 +along with GCC; see the file COPYING. If not, write to
78 +the Free Software Foundation, 59 Temple Place - Suite 330,
79 +Boston, MA 02111-1307, USA. */
82 +#define REG_NAME(reg) sc_ ## reg
83 diff -Nur gcc-3.4.4.old/gcc/config/i386/linux.h gcc-3.4.4/gcc/config/i386/linux.h
84 --- gcc-3.4.4.old/gcc/config/i386/linux.h 2003-11-29 04:08:10.000000000 +0100
85 +++ gcc-3.4.4/gcc/config/i386/linux.h 2005-06-23 16:09:41.000000000 +0200
88 /* If ELF is the default format, we should not use /lib/elf. */
90 +#ifndef LINK_EMULATION
91 +# define LINK_EMULATION "elf_i386"
93 +#ifndef DYNAMIC_LINKER
94 +# ifdef USE_GNULIBC_1
95 +# define DYNAMIC_LINKER "/lib/ld-linux.so.1"
97 +# define DYNAMIC_LINKER "/lib/ld-linux.so.2"
101 +#undef SUBTARGET_EXTRA_SPECS
102 +#define SUBTARGET_EXTRA_SPECS \
103 + { "link_emulation", LINK_EMULATION },\
104 + { "dynamic_linker", DYNAMIC_LINKER }
107 -#ifdef USE_GNULIBC_1
108 -#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
112 - %{rdynamic:-export-dynamic} \
113 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
114 - %{static:-static}}}"
116 -#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
117 +#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
121 %{rdynamic:-export-dynamic} \
122 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
123 + %{!dynamic-linker:-dynamic-linker %(dynamic_linker)}} \
127 /* A C statement (sans semicolon) to output to the stdio stream
128 FILE the assembler definition of uninitialized global DECL named
131 #include <sys/ucontext.h>
133 +#define REG_NAME(reg) reg
135 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
137 unsigned char *pc_ = (CONTEXT)->ra; \
138 @@ -245,28 +253,28 @@
142 - new_cfa_ = sc_->esp; \
143 + new_cfa_ = sc_->REG_NAME(esp); \
144 (FS)->cfa_how = CFA_REG_OFFSET; \
146 (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
148 /* The SVR4 register numbering macros aren't usable in libgcc. */ \
149 (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \
150 - (FS)->regs.reg[0].loc.offset = (long)&sc_->eax - new_cfa_; \
151 + (FS)->regs.reg[0].loc.offset = (long)&sc_->REG_NAME(eax) - new_cfa_; \
152 (FS)->regs.reg[3].how = REG_SAVED_OFFSET; \
153 - (FS)->regs.reg[3].loc.offset = (long)&sc_->ebx - new_cfa_; \
154 + (FS)->regs.reg[3].loc.offset = (long)&sc_->REG_NAME(ebx) - new_cfa_; \
155 (FS)->regs.reg[1].how = REG_SAVED_OFFSET; \
156 - (FS)->regs.reg[1].loc.offset = (long)&sc_->ecx - new_cfa_; \
157 + (FS)->regs.reg[1].loc.offset = (long)&sc_->REG_NAME(ecx) - new_cfa_; \
158 (FS)->regs.reg[2].how = REG_SAVED_OFFSET; \
159 - (FS)->regs.reg[2].loc.offset = (long)&sc_->edx - new_cfa_; \
160 + (FS)->regs.reg[2].loc.offset = (long)&sc_->REG_NAME(edx) - new_cfa_; \
161 (FS)->regs.reg[6].how = REG_SAVED_OFFSET; \
162 - (FS)->regs.reg[6].loc.offset = (long)&sc_->esi - new_cfa_; \
163 + (FS)->regs.reg[6].loc.offset = (long)&sc_->REG_NAME(esi) - new_cfa_; \
164 (FS)->regs.reg[7].how = REG_SAVED_OFFSET; \
165 - (FS)->regs.reg[7].loc.offset = (long)&sc_->edi - new_cfa_; \
166 + (FS)->regs.reg[7].loc.offset = (long)&sc_->REG_NAME(edi) - new_cfa_; \
167 (FS)->regs.reg[5].how = REG_SAVED_OFFSET; \
168 - (FS)->regs.reg[5].loc.offset = (long)&sc_->ebp - new_cfa_; \
169 + (FS)->regs.reg[5].loc.offset = (long)&sc_->REG_NAME(ebp) - new_cfa_; \
170 (FS)->regs.reg[8].how = REG_SAVED_OFFSET; \
171 - (FS)->regs.reg[8].loc.offset = (long)&sc_->eip - new_cfa_; \
172 + (FS)->regs.reg[8].loc.offset = (long)&sc_->REG_NAME(eip) - new_cfa_; \
173 (FS)->retaddr_column = 8; \
176 diff -Nur gcc-3.4.4.old/gcc/config/kfreebsd-gnu.h gcc-3.4.4/gcc/config/kfreebsd-gnu.h
177 --- gcc-3.4.4.old/gcc/config/kfreebsd-gnu.h 1970-01-01 01:00:00.000000000 +0100
178 +++ gcc-3.4.4/gcc/config/kfreebsd-gnu.h 2005-06-23 16:09:41.000000000 +0200
180 +/* Definitions for kFreeBSD-based GNU systems with ELF format
182 + Free Software Foundation, Inc.
183 + Contributed by Robert Millan.
185 +This file is part of GCC.
187 +GCC is free software; you can redistribute it and/or modify
188 +it under the terms of the GNU General Public License as published by
189 +the Free Software Foundation; either version 2, or (at your option)
192 +GCC is distributed in the hope that it will be useful,
193 +but WITHOUT ANY WARRANTY; without even the implied warranty of
194 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
195 +GNU General Public License for more details.
197 +You should have received a copy of the GNU General Public License
198 +along with GCC; see the file COPYING. If not, write to
199 +the Free Software Foundation, 59 Temple Place - Suite 330,
200 +Boston, MA 02111-1307, USA. */
202 +#undef LINUX_TARGET_OS_CPP_BUILTINS
203 +#define LINUX_TARGET_OS_CPP_BUILTINS() \
206 + builtin_define ("__FreeBSD_kernel__"); \
207 + builtin_define ("__GLIBC__"); \
208 + builtin_define_std ("unix"); \
209 + builtin_assert ("system=unix"); \
210 + builtin_assert ("system=posix"); \
214 +#undef DYNAMIC_LINKER
215 +#define DYNAMIC_LINKER "/lib/ld.so.1"
216 diff -Nur gcc-3.4.4.old/gcc/config/knetbsd-gnu.h gcc-3.4.4/gcc/config/knetbsd-gnu.h
217 --- gcc-3.4.4.old/gcc/config/knetbsd-gnu.h 1970-01-01 01:00:00.000000000 +0100
218 +++ gcc-3.4.4/gcc/config/knetbsd-gnu.h 2005-06-23 16:09:41.000000000 +0200
220 +/* Definitions for kNetBSD-based GNU systems with ELF format
222 + Free Software Foundation, Inc.
223 + Contributed by Robert Millan.
225 +This file is part of GCC.
227 +GCC is free software; you can redistribute it and/or modify
228 +it under the terms of the GNU General Public License as published by
229 +the Free Software Foundation; either version 2, or (at your option)
232 +GCC is distributed in the hope that it will be useful,
233 +but WITHOUT ANY WARRANTY; without even the implied warranty of
234 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
235 +GNU General Public License for more details.
237 +You should have received a copy of the GNU General Public License
238 +along with GCC; see the file COPYING. If not, write to
239 +the Free Software Foundation, 59 Temple Place - Suite 330,
240 +Boston, MA 02111-1307, USA. */
242 +#undef LINUX_TARGET_OS_CPP_BUILTINS
243 +#define LINUX_TARGET_OS_CPP_BUILTINS() \
246 + builtin_define ("__NetBSD_kernel__"); \
247 + builtin_define ("__GLIBC__"); \
248 + builtin_define_std ("unix"); \
249 + builtin_assert ("system=unix"); \
250 + builtin_assert ("system=posix"); \
254 +#undef DYNAMIC_LINKER
255 +#define DYNAMIC_LINKER "/lib/ld.so.1"
256 diff -Nur gcc-3.4.4.old/gcc/config.gcc gcc-3.4.4/gcc/config.gcc
257 --- gcc-3.4.4.old/gcc/config.gcc 2005-04-25 06:47:59.000000000 +0200
258 +++ gcc-3.4.4/gcc/config.gcc 2005-06-23 16:09:41.000000000 +0200
259 @@ -434,21 +434,10 @@
261 fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h"
264 - # Must come before *-*-gnu*
265 - xm_defines=POSIX # needed for cross-compiling from FreeBSD?
266 - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
267 - # GNU tools are the only tools.
270 - case ${enable_threads} in
271 - "" | yes | posix) thread_file='posix' ;;
274 *-*-linux*libc1* | *-*-linux*aout*)
275 # Avoid the generic linux case.
278 +*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
279 # Must come before *-*-gnu* (because of *-*-linux-gnu* systems).
280 extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
282 @@ -998,23 +987,21 @@
286 -i[34567]86-*-linux*) # Intel 80386's running GNU/Linux
287 +i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
288 + # Intel 80386's running GNU/*
289 # with ELF format using glibc 2
290 - # aka GNU/Linux C library 6
291 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
292 tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff"
294 + i[34567]86-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h i386/knetbsd-gnu.h" ;;
295 + i[34567]86-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu.h" ;;
299 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h \
300 i386/x86-64.h i386/linux64.h"
301 tmake_file="t-slibgcc-elf-ver t-linux i386/t-linux64"
303 -i[34567]86-*-kfreebsd*-gnu) # must be before i[34567]86-*-gnu*
304 - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h kfreebsdgnu.h i386/kfreebsdgnu.h"
305 - tmake_file="t-slibgcc-elf-ver t-kfreebsd-gnu i386/t-crtstuff"
311 i[34567]86-pc-msdosdjgpp*)
312 diff -Nur gcc-3.4.4.old/libstdc++-v3/configure gcc-3.4.4/libstdc++-v3/configure
313 --- gcc-3.4.4.old/libstdc++-v3/configure 2005-02-01 07:29:28.000000000 +0100
314 +++ gcc-3.4.4/libstdc++-v3/configure 2005-06-23 16:09:41.000000000 +0200
315 @@ -3944,7 +3944,7 @@
316 lt_cv_deplibs_check_method=pass_all
320 +freebsd* | kfreebsd*-gnu)
321 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
324 @@ -4012,7 +4012,7 @@
325 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
329 +netbsd* | knetbsd*-gnu)
330 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
331 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
333 diff -Nur gcc-3.4.4.old/libtool.m4 gcc-3.4.4/libtool.m4
334 --- gcc-3.4.4.old/libtool.m4 2004-05-18 11:08:37.000000000 +0200
335 +++ gcc-3.4.4/libtool.m4 2005-06-23 16:09:41.000000000 +0200
337 lt_cv_deplibs_check_method=pass_all
341 +freebsd* | kfreebsd*-gnu)
342 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
346 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
350 +netbsd* | knetbsd*-gnu)
351 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
352 [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
354 diff -Nur gcc-3.4.4.old/ltcf-c.sh gcc-3.4.4/ltcf-c.sh
355 --- gcc-3.4.4.old/ltcf-c.sh 2003-11-19 06:29:32.000000000 +0100
356 +++ gcc-3.4.4/ltcf-c.sh 2005-06-23 16:09:41.000000000 +0200
358 $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
362 + netbsd* | knetbsd*-gnu)
363 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
364 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
369 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
371 + freebsd* | kfreebsd*-gnu)
372 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
373 hardcode_libdir_flag_spec='-R$libdir'
380 + netbsd* | knetbsd*-gnu)
381 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
382 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
384 diff -Nur gcc-3.4.4.old/ltcf-cxx.sh gcc-3.4.4/ltcf-cxx.sh
385 --- gcc-3.4.4.old/ltcf-cxx.sh 2003-11-19 06:29:32.000000000 +0100
386 +++ gcc-3.4.4/ltcf-cxx.sh 2005-06-23 16:09:41.000000000 +0200
388 # C++ shared libraries reported to be fairly broken before switch to ELF
392 + freebsd* | kfreebsd*-gnu)
393 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
401 + netbsd* | knetbsd*-gnu)
402 # NetBSD uses g++ - do we need to do anything?
410 + freebsd* | kfreebsd*-gnu)
411 # FreeBSD uses GNU C++
414 diff -Nur gcc-3.4.4.old/ltcf-gcj.sh gcc-3.4.4/ltcf-gcj.sh
415 --- gcc-3.4.4.old/ltcf-gcj.sh 2003-11-19 06:29:32.000000000 +0100
416 +++ gcc-3.4.4/ltcf-gcj.sh 2005-06-23 16:09:41.000000000 +0200
418 $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
422 + netbsd* | knetbsd*-gnu)
423 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
424 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
429 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
431 + freebsd* | kfreebsd*-gnu)
432 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
433 hardcode_libdir_flag_spec='-R$libdir'
440 + netbsd* | knetbsd*-gnu)
441 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
442 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
444 diff -Nur gcc-3.4.4.old/ltconfig gcc-3.4.4/ltconfig
445 --- gcc-3.4.4.old/ltconfig 2004-03-05 22:05:41.000000000 +0100
446 +++ gcc-3.4.4/ltconfig 2005-06-23 16:09:41.000000000 +0200
447 @@ -1168,6 +1168,17 @@
448 hardcode_into_libs=yes
451 +kfreebsd*-gnu | knetbsd*-gnu)
455 + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
456 + soname_spec='${libname}${release}.so$major'
457 + shlibpath_var=LD_LIBRARY_PATH
458 + shlibpath_overrides_runpath=yes
459 + hardcode_into_libs=yes
462 hpux9* | hpux10* | hpux11*)
463 # Give a soname corresponding to the major version so that dld.sl refuses to
464 # link against other versions.