Configure tsocks with a simple heuristic.
Consider the proxy has to be in a 'local' network. It means it is directly
reachable by the local machine, even if the local machine has to hop through
one or more gates to reach the proxy (often the case in enterprise networks
where class A 10.0.0.0/8 is in fact sub-divided into smaller networks, each
one of them in a different location, eg. 10.1.0.0/16 in a place, while
10.2.0.0/16 would be on the other side of the world). Not being in the same
subnet does not mean the proxy is not available.
So we will build a mask with at most high bits set, which defines a network
that has both the local machine and the proxy. Because a machine may have
more than one interface, build a mask for each of them, removing 127.0.0.1
which is added automagically by tsocks, and removing duplicate masks.
If all of this does not work, then it means the local machine can NOT in fact
reach the proxy, which in turn means the user mis-configured something (most
probably a typo...).
/trunk/scripts/crosstool.sh | 61 52 9 0 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 9 deletions(-)
1 diff -ruN gcc-20030210.orig/boehm-gc/configure gcc-20030210/boehm-gc/configure
2 --- gcc-20030210.orig/boehm-gc/configure Fri Jan 31 19:17:00 2003
3 +++ gcc-20030210/boehm-gc/configure Sat Feb 22 01:40:14 2003
5 # This must be Linux ELF.
8 - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
9 + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
10 lt_cv_deplibs_check_method=pass_all ;;
12 # glibc up to 2.1.1 does not perform some relocations on ARM
13 diff -ruN gcc-20030210.orig/config-ml.in gcc-20030210/config-ml.in
14 --- gcc-20030210.orig/config-ml.in Fri Jan 31 19:16:59 2003
15 +++ gcc-20030210/config-ml.in Sat Feb 22 01:40:14 2003
17 if [ -d ../$${dir}/$${lib} ]; then \
18 flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
19 if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
20 + DESTDIR="$(DESTDIR)" \
21 CFLAGS="$(CFLAGS) $${flags}" \
23 exec_prefix="$(exec_prefix)" \
24 diff -ruN gcc-20030210.orig/debian/edit-specs.in gcc-20030210/debian/edit-specs.in
25 --- gcc-20030210.orig/debian/edit-specs.in Thu Jan 1 09:00:00 1970
26 +++ gcc-20030210/debian/edit-specs.in Sat Feb 22 01:40:14 2003
31 +@AS_ENDIAN_FLAG@ %{mrelax:-relax}
36 +%(cpp_default_cpu_spec) %(subtarget_cpp_spec) %(subtarget_cpp_ptr_spec) %(subtarget_cpp_endian_spec)
41 +-musermode @CC1_CPU_ENDIAN_FLAGS@ %{profile:-p}
46 +%{!static:--eh-frame-hdr} @LINKER_CPU_ENDIAN_FLAGS@ @LINKER_RPATH_LINK_FLAG@ %{mrelax:-relax} %{shared:-shared} %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static}
53 +/^*multilib_matches:$/ {
58 +/^*multilib_options:$/ {
63 +/^*subtarget_cpp_endian_spec:$/ {
68 +/^*cpp_default_cpu_spec:$/ {
73 diff -ruN gcc-20030210.orig/debian/install-CPU-linux gcc-20030210/debian/install-CPU-linux
74 --- gcc-20030210.orig/debian/install-CPU-linux Thu Jan 1 09:00:00 1970
75 +++ gcc-20030210/debian/install-CPU-linux Sat Feb 22 01:40:14 2003
82 +# literally (binary-ly) same
84 +PROGS_ADDITIONAL="c++ g++ g77 gcj"
86 +DRIVERS_C="cc1 cpp0 tradcpp0"
87 +DRIVERS_ADDITIONAL="cc1obj cc1plus collect2 f771 jc1 jvgenmain"
88 +if [ -z "$STEP1_COMPILER_BUILD" ]; then
89 + PROGS="$PROGS_C $PROGS_ADDITIONAL"
90 + DRIVERS="$DRIVERS_C $DRIVERSADDITIONAL"
98 +OBJS="crtbegin.o crtbeginS.o crtend.o crtendS.o"
100 +LIBS_1="libgcc_s.so libgcc_s.so.1 libstdc++.so libstdc++.so.3 libstdc++.so.3.0.2"
101 +LIBS_2="libobjc.a libstdc++.a libsupc++.a"
104 +cd debian/gcc-sh-linux-others${INITIAL} || exit 1
107 +mkdir -p usr/bin usr/share usr/share/man usr/share/man/man1 usr/lib \
108 + usr/lib/gcc-lib usr/lib/gcc-lib/${CPU}-linux \
109 + usr/lib/gcc-lib/${CPU}-linux/${VERSION} \
110 + usr/${CPU}-linux usr/${CPU}-linux/lib
112 +# Make symbolic links for include dir.
113 +(cd usr/${CPU}-linux; ln -s ../sh-linux/include .)
115 +# Make symbolic links for executables.
117 + for p in ${PROGS}; do
118 + ln -s shCPU-linux-GCC ${CPU}-linux-$p
124 + AS_ENDIAN_FLAG="-little"
125 + CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__"
126 + CPP_CPU_DEFS="-D__SH3__ -D__sh3__"
127 + CC1_CPU_ENDIAN_FLAGS="-ml -m3"
128 + LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh3"
129 + LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3-linux/lib"
133 + AS_ENDIAN_FLAG="-big"
134 + CPP_ENDIAN_DEF="-D__BIG_ENDIAN__"
135 + CPP_CPU_DEFS="-D__SH3__ -D__sh3__"
136 + CC1_CPU_ENDIAN_FLAGS="-mb -m3"
137 + LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh3"
138 + LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3eb-linux/lib"
142 + AS_ENDIAN_FLAG="-little"
143 + CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__"
144 + CPP_CPU_DEFS="-D__SH4__"
145 + CC1_CPU_ENDIAN_FLAGS="-ml -m4"
146 + LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh4"
147 + LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4-linux/lib"
151 + AS_ENDIAN_FLAG="-big"
152 + CPP_ENDIAN_DEF="-D__BIG_ENDIAN__"
153 + CPP_CPU_DEFS="-D__SH4__"
154 + CC1_CPU_ENDIAN_FLAGS="-mb -m4"
155 + LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh4"
156 + LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4eb-linux/lib"
160 +# Make symbolic links for GCC drivers, objects, libraries, and include dir.
161 +(cd usr/lib/gcc-lib/${CPU}-linux/${VERSION};
162 + for f in ${DRIVERS} ${INCLUDE}; do
163 + ln -s ../../sh-linux/${VERSION}/$f $f;
165 + for f in ${OBJS} ${LIBS_C}; do
166 + ln -s ../../sh-linux/${VERSION}${MULTILIBDIR}/$f $f;
169 +if [ -z "$STEP1_COMPILER_BUILD" ]; then
170 + for f in ${LIBS_1} ${LIBS_2}; do
171 + mv ../gcc-sh-linux/usr/sh-linux/lib${MULTILIBDIR}/$f usr/${CPU}-linux/lib/;
175 +sed -e "s+@AS_ENDIAN_FLAG@+${AS_ENDIAN_FLAG}+" \
176 + -e "s+@CPP_ENDIAN_DEF@+${CPP_ENDIAN_DEF}+" \
177 + -e "s+@CPP_CPU_DEFS@+${CPP_CPU_DEFS}+" \
178 + -e "s+@CC1_CPU_ENDIAN_FLAGS@+${CC1_CPU_ENDIAN_FLAGS}+" \
179 + -e "s+@LINKER_CPU_ENDIAN_FLAGS@+${LINKER_CPU_ENDIAN_FLAGS}+" \
180 + -e "s+@LINKER_RPATH_LINK_FLAG@+${LINKER_RPATH_LINK_FLAG}+" \
181 + ../edit-specs.in >../edit-specs-${CPU}.sed
183 +sed -f ../edit-specs-${CPU}.sed \
184 + ../gcc-sh-linux${INITIAL}/usr/lib/gcc-lib/sh-linux/${VERSION}/specs \
185 + > usr/lib/gcc-lib/${CPU}-linux/${VERSION}/specs
188 diff -ruN gcc-20030210.orig/debian/multilib-symlink gcc-20030210/debian/multilib-symlink
189 --- gcc-20030210.orig/debian/multilib-symlink Thu Jan 1 09:00:00 1970
190 +++ gcc-20030210/debian/multilib-symlink Sat Feb 22 01:40:14 2003
194 +cd /usr/sh-linux/lib
195 +ln -s ../../sh3-linux/lib/{*.a,*.so*,*.o} .
197 +ln -s ../../../sh4-linux/lib/{*.a,*.so*,*.o} .
199 +ln -s ../../../sh3eb-linux/lib/{*.a,*.so*,*.o} .
201 +ln -s ../../../../sh4eb-linux/lib/{*.a,*.so*,*.o} .
202 diff -ruN gcc-20030210.orig/debian/shCPU-linux-GCC gcc-20030210/debian/shCPU-linux-GCC
203 --- gcc-20030210.orig/debian/shCPU-linux-GCC Thu Jan 1 09:00:00 1970
204 +++ gcc-20030210/debian/shCPU-linux-GCC Sat Feb 22 01:40:14 2003
209 +PROG=${BASENAME##*-}
212 +if [ "$PROG" = gcc ]; then
213 + if [ "$1" = "-b" -a "$2" = "i386-linux" ]; then
215 + exec /usr/bin/gcc "$@"
216 + elif [ "$1" = "-print-multi-lib" -o "$1" = "--print-multi-lib" ]; then
219 + elif [ "$1" = "-print-multi-os-directory" -o "$1" = "--print-multi-os-directory" ]; then
222 + elif [ "$1" = "-dumpspecs" ]; then
223 + cat /usr/lib/gcc-lib/${CPU}-linux/@@VERSION@@/specs
231 + DEFINES="-D__sh3__ -D__SH3__ -D__LITTLE_ENDIAN__"
236 + DEFINES="-D__sh3__ -D__SH3__ -D__BIG_ENDIAN__"
241 + DEFINES="-D__SH4__ -D__LITTLE_ENDIAN__"
246 + DEFINES="-D__SH4__ -D__BIG_ENDIAN__"
251 +# Prepend the appropriate options
252 +# If user specifies some options, it will be overridden
256 + exec sh-linux-${PROG} $DEFINES "$@"
258 + c++|g++|g77|gcc|gcj)
259 + exec sh-linux-${PROG} -$ARCH -$ENDIAN "$@"
263 +echo "Something wrong..."
265 diff -ruN gcc-20030210.orig/gcc/config/sh/elf.h gcc-20030210/gcc/config/sh/elf.h
266 --- gcc-20030210.orig/gcc/config/sh/elf.h Fri Feb 22 01:42:28 2002
267 +++ gcc-20030210/gcc/config/sh/elf.h Sat Feb 22 01:40:14 2003
270 #define ENDFILE_SPEC \
271 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
273 +/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it,
274 + redundant .align will be generated. */
275 +#undef ASM_OUTPUT_CASE_LABEL
276 diff -ruN gcc-20030210.orig/gcc/config/sh/lib1funcs.asm gcc-20030210/gcc/config/sh/lib1funcs.asm
277 --- gcc-20030210.orig/gcc/config/sh/lib1funcs.asm Fri Feb 22 01:42:28 2002
278 +++ gcc-20030210/gcc/config/sh/lib1funcs.asm Sat Feb 22 01:40:14 2003
282 #define LOCAL(X) .L_##X
283 +#define FUNC(X) .type X,@function; .hidden X
284 +#define _ENDFUNC(X) .Lfe_##X: .size X,.Lfe_##X-X
285 +#define ENDFUNC(X) _ENDFUNC(X)
287 #define LOCAL(X) L_##X
294 .global GLOBAL(ashiftrt_r4_31)
295 .global GLOBAL(ashiftrt_r4_32)
297 + FUNC(GLOBAL(ashiftrt_r4_0))
298 + FUNC(GLOBAL(ashiftrt_r4_1))
299 + FUNC(GLOBAL(ashiftrt_r4_2))
300 + FUNC(GLOBAL(ashiftrt_r4_3))
301 + FUNC(GLOBAL(ashiftrt_r4_4))
302 + FUNC(GLOBAL(ashiftrt_r4_5))
303 + FUNC(GLOBAL(ashiftrt_r4_6))
304 + FUNC(GLOBAL(ashiftrt_r4_7))
305 + FUNC(GLOBAL(ashiftrt_r4_8))
306 + FUNC(GLOBAL(ashiftrt_r4_9))
307 + FUNC(GLOBAL(ashiftrt_r4_10))
308 + FUNC(GLOBAL(ashiftrt_r4_11))
309 + FUNC(GLOBAL(ashiftrt_r4_12))
310 + FUNC(GLOBAL(ashiftrt_r4_13))
311 + FUNC(GLOBAL(ashiftrt_r4_14))
312 + FUNC(GLOBAL(ashiftrt_r4_15))
313 + FUNC(GLOBAL(ashiftrt_r4_16))
314 + FUNC(GLOBAL(ashiftrt_r4_17))
315 + FUNC(GLOBAL(ashiftrt_r4_18))
316 + FUNC(GLOBAL(ashiftrt_r4_19))
317 + FUNC(GLOBAL(ashiftrt_r4_20))
318 + FUNC(GLOBAL(ashiftrt_r4_21))
319 + FUNC(GLOBAL(ashiftrt_r4_22))
320 + FUNC(GLOBAL(ashiftrt_r4_23))
321 + FUNC(GLOBAL(ashiftrt_r4_24))
322 + FUNC(GLOBAL(ashiftrt_r4_25))
323 + FUNC(GLOBAL(ashiftrt_r4_26))
324 + FUNC(GLOBAL(ashiftrt_r4_27))
325 + FUNC(GLOBAL(ashiftrt_r4_28))
326 + FUNC(GLOBAL(ashiftrt_r4_29))
327 + FUNC(GLOBAL(ashiftrt_r4_30))
328 + FUNC(GLOBAL(ashiftrt_r4_31))
329 + FUNC(GLOBAL(ashiftrt_r4_32))
332 GLOBAL(ashiftrt_r4_32):
333 GLOBAL(ashiftrt_r4_31):
335 GLOBAL(ashiftrt_r4_0):
339 + ENDFUNC(GLOBAL(ashiftrt_r4_0))
340 + ENDFUNC(GLOBAL(ashiftrt_r4_1))
341 + ENDFUNC(GLOBAL(ashiftrt_r4_2))
342 + ENDFUNC(GLOBAL(ashiftrt_r4_3))
343 + ENDFUNC(GLOBAL(ashiftrt_r4_4))
344 + ENDFUNC(GLOBAL(ashiftrt_r4_5))
345 + ENDFUNC(GLOBAL(ashiftrt_r4_6))
346 + ENDFUNC(GLOBAL(ashiftrt_r4_7))
347 + ENDFUNC(GLOBAL(ashiftrt_r4_8))
348 + ENDFUNC(GLOBAL(ashiftrt_r4_9))
349 + ENDFUNC(GLOBAL(ashiftrt_r4_10))
350 + ENDFUNC(GLOBAL(ashiftrt_r4_11))
351 + ENDFUNC(GLOBAL(ashiftrt_r4_12))
352 + ENDFUNC(GLOBAL(ashiftrt_r4_13))
353 + ENDFUNC(GLOBAL(ashiftrt_r4_14))
354 + ENDFUNC(GLOBAL(ashiftrt_r4_15))
355 + ENDFUNC(GLOBAL(ashiftrt_r4_16))
356 + ENDFUNC(GLOBAL(ashiftrt_r4_17))
357 + ENDFUNC(GLOBAL(ashiftrt_r4_18))
358 + ENDFUNC(GLOBAL(ashiftrt_r4_19))
359 + ENDFUNC(GLOBAL(ashiftrt_r4_20))
360 + ENDFUNC(GLOBAL(ashiftrt_r4_21))
361 + ENDFUNC(GLOBAL(ashiftrt_r4_22))
362 + ENDFUNC(GLOBAL(ashiftrt_r4_23))
363 + ENDFUNC(GLOBAL(ashiftrt_r4_24))
364 + ENDFUNC(GLOBAL(ashiftrt_r4_25))
365 + ENDFUNC(GLOBAL(ashiftrt_r4_26))
366 + ENDFUNC(GLOBAL(ashiftrt_r4_27))
367 + ENDFUNC(GLOBAL(ashiftrt_r4_28))
368 + ENDFUNC(GLOBAL(ashiftrt_r4_29))
369 + ENDFUNC(GLOBAL(ashiftrt_r4_30))
370 + ENDFUNC(GLOBAL(ashiftrt_r4_31))
371 + ENDFUNC(GLOBAL(ashiftrt_r4_32))
379 .global GLOBAL(ashrsi3)
380 + FUNC(GLOBAL(ashrsi3))
388 + ENDFUNC(GLOBAL(ashrsi3))
396 .global GLOBAL(ashlsi3)
397 + FUNC(GLOBAL(ashlsi3))
405 + ENDFUNC(GLOBAL(ashlsi3))
413 .global GLOBAL(lshrsi3)
414 + FUNC(GLOBAL(lshrsi3))
422 + ENDFUNC(GLOBAL(lshrsi3))
427 @@ -649,76 +732,113 @@
430 .global GLOBAL(movstrSI64)
431 + FUNC(GLOBAL(movstrSI64))
435 .global GLOBAL(movstrSI60)
436 + FUNC(GLOBAL(movstrSI60))
440 .global GLOBAL(movstrSI56)
441 + FUNC(GLOBAL(movstrSI56))
445 .global GLOBAL(movstrSI52)
446 + FUNC(GLOBAL(movstrSI52))
450 .global GLOBAL(movstrSI48)
451 + FUNC(GLOBAL(movstrSI48))
455 .global GLOBAL(movstrSI44)
456 + FUNC(GLOBAL(movstrSI44))
460 .global GLOBAL(movstrSI40)
461 + FUNC(GLOBAL(movstrSI40))
465 .global GLOBAL(movstrSI36)
466 + FUNC(GLOBAL(movstrSI36))
470 .global GLOBAL(movstrSI32)
471 + FUNC(GLOBAL(movstrSI32))
475 .global GLOBAL(movstrSI28)
476 + FUNC(GLOBAL(movstrSI28))
480 .global GLOBAL(movstrSI24)
481 + FUNC(GLOBAL(movstrSI24))
485 .global GLOBAL(movstrSI20)
486 + FUNC(GLOBAL(movstrSI20))
490 .global GLOBAL(movstrSI16)
491 + FUNC(GLOBAL(movstrSI16))
495 .global GLOBAL(movstrSI12)
496 + FUNC(GLOBAL(movstrSI12))
500 .global GLOBAL(movstrSI8)
501 + FUNC(GLOBAL(movstrSI8))
505 .global GLOBAL(movstrSI4)
506 + FUNC(GLOBAL(movstrSI4))
510 + .global GLOBAL(movstrSI0)
511 + FUNC(GLOBAL(movstrSI0))
516 + ENDFUNC(GLOBAL(movstrSI64))
517 + ENDFUNC(GLOBAL(movstrSI60))
518 + ENDFUNC(GLOBAL(movstrSI56))
519 + ENDFUNC(GLOBAL(movstrSI52))
520 + ENDFUNC(GLOBAL(movstrSI48))
521 + ENDFUNC(GLOBAL(movstrSI44))
522 + ENDFUNC(GLOBAL(movstrSI40))
523 + ENDFUNC(GLOBAL(movstrSI36))
524 + ENDFUNC(GLOBAL(movstrSI32))
525 + ENDFUNC(GLOBAL(movstrSI28))
526 + ENDFUNC(GLOBAL(movstrSI24))
527 + ENDFUNC(GLOBAL(movstrSI20))
528 + ENDFUNC(GLOBAL(movstrSI16))
529 + ENDFUNC(GLOBAL(movstrSI12))
530 + ENDFUNC(GLOBAL(movstrSI8))
531 + ENDFUNC(GLOBAL(movstrSI4))
532 + ENDFUNC(GLOBAL(movstrSI0))
536 .global GLOBAL(movstr)
537 + FUNC(GLOBAL(movstr))
546 + FUNC(GLOBAL(movstr))
551 .global GLOBAL(movstr_i4_odd)
552 .global GLOBAL(movstrSI12_i4)
554 + FUNC(GLOBAL(movstr_i4_even))
555 + FUNC(GLOBAL(movstr_i4_odd))
556 + FUNC(GLOBAL(movstrSI12_i4))
565 +GLOBAL(movstr_i4_even):
567 + bra L_movstr_start_even
570 GLOBAL(movstr_i4_odd):
577 -GLOBAL(movstr_i4_even):
579 - bra L_movstr_start_even
581 + ENDFUNC(GLOBAL(movstr_i4_even))
582 + ENDFUNC(GLOBAL(movstr_i4_odd))
585 GLOBAL(movstrSI12_i4):
586 @@ -831,12 +960,16 @@
591 + ENDFUNC(GLOBAL(movstrSI12_i4))
598 .global GLOBAL(mulsi3)
599 + FUNC(GLOBAL(mulsi3))
608 + FUNC(GLOBAL(mulsi3))
610 #endif /* ! __SH5__ */
613 !! args in r4 and r5, result in fpul, clobber dr0, dr2
615 .global GLOBAL(sdivsi3_i4)
616 + FUNC(GLOBAL(sdivsi3_i4))
624 + ENDFUNC(GLOBAL(sdivsi3_i4))
626 #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
627 !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2
632 .global GLOBAL(sdivsi3_i4)
633 + FUNC(GLOBAL(sdivsi3_i4))
641 + ENDFUNC(GLOBAL(sdivsi3_i4))
643 #endif /* ! __SH5__ || __SH5__ == 32 */
644 #endif /* ! __SH4__ */
646 @@ -924,9 +1063,10 @@
650 -!! args in r4 and r5, result in r0 clobber r1,r2,r3
651 +!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit
653 .global GLOBAL(sdivsi3)
654 + FUNC(GLOBAL(sdivsi3))
657 .section .text..SHmedia32,"ax"
658 @@ -1076,6 +1216,7 @@
662 + ENDFUNC(GLOBAL(sdivsi3))
663 #endif /* ! __SHMEDIA__ */
664 #endif /* ! __SH4__ */
666 @@ -1084,9 +1225,11 @@
668 !! 4 byte integer Divide code for the Hitachi SH
670 -!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
671 +!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4,
674 .global GLOBAL(udivsi3_i4)
675 + FUNC(GLOBAL(udivsi3_i4))
679 @@ -1127,6 +1270,8 @@
683 + ENDFUNC(GLOBAL(udivsi3_i4))
685 #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
686 !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
688 @@ -1135,6 +1280,7 @@
691 .global GLOBAL(udivsi3_i4)
692 + FUNC(GLOBAL(udivsi3_i4))
696 @@ -1183,6 +1329,8 @@
700 + ENDFUNC(GLOBAL(udivsi3_i4))
702 #endif /* ! __SH5__ || __SH5__ == 32 */
703 #endif /* ! __SH4__ */
705 @@ -1199,6 +1347,7 @@
707 !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit
708 .global GLOBAL(udivsi3)
709 + FUNC(GLOBAL(udivsi3))
713 @@ -1299,6 +1448,8 @@
717 + ENDFUNC(GLOBAL(udivsi3))
719 #endif /* ! __SHMEDIA__ */
722 @@ -1308,6 +1459,7 @@
725 .global GLOBAL(set_fpscr)
726 + FUNC(GLOBAL(set_fpscr))
729 mov.l LOCAL(set_fpscr_L1),r1
730 @@ -1340,11 +1492,16 @@
733 .long GLOBAL(fpscr_values)
735 + ENDFUNC(GLOBAL(set_fpscr))
737 +#ifndef NO_FPSCR_VALUES
739 .comm GLOBAL(fpscr_values),8,4
741 .comm GLOBAL(fpscr_values),8
743 +#endif /* NO_FPSCR_VALUES */
744 #endif /* SH3E / SH4 */
745 #endif /* L_set_fpscr */
746 #ifdef L_ic_invalidate
747 @@ -1360,6 +1517,7 @@
749 #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
750 .global GLOBAL(ic_invalidate)
751 + FUNC(GLOBAL(ic_invalidate))
752 GLOBAL(ic_invalidate):
755 @@ -1382,6 +1540,9 @@
760 + ENDFUNC(GLOBAL(ic_invalidate))
763 #endif /* L_ic_invalidate */
765 diff -ruN gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver gcc-20030210/gcc/config/sh/libgcc-glibc.ver
766 --- gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver Thu Jan 1 09:00:00 1970
767 +++ gcc-20030210/gcc/config/sh/libgcc-glibc.ver Sat Feb 22 01:40:14 2003
769 +# In order to work around the very problems that force us to now generally
770 +# create a libgcc.so, glibc reexported a number of routines from libgcc.a.
771 +# By now choosing the same version tags for these specific routines, we
772 +# maintain enough binary compatibility to allow future versions of glibc
773 +# to defer implementation of these routines to libgcc.so via DT_AUXILIARY.
775 +# Note that we cannot use the default libgcc-glibc.ver file on sh,
776 +# because GLIBC_2.0 does not exist on this architecture, as the first
777 +# ever glibc release on the platform was GLIBC_2.2.
779 +%inherit GCC_3.0 GLIBC_2.2
782 + __register_frame_table
784 + __register_frame_info
785 + __deregister_frame_info
787 + __register_frame_info_table
790 diff -ruN gcc-20030210.orig/gcc/config/sh/linux.h gcc-20030210/gcc/config/sh/linux.h
791 --- gcc-20030210.orig/gcc/config/sh/linux.h Tue Apr 16 05:27:42 2002
792 +++ gcc-20030210/gcc/config/sh/linux.h Sat Feb 22 01:40:14 2003
794 the Free Software Foundation, 59 Temple Place - Suite 330,
795 Boston, MA 02111-1307, USA. */
797 +/* We're not SYSVR4, not having /usr/ccs */
798 +#undef MD_EXEC_PREFIX
799 +#undef MD_STARTFILE_PREFIX
801 /* Run-time Target Specification. */
802 #undef TARGET_VERSION
803 #define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr);
805 #undef WCHAR_TYPE_SIZE
806 #define WCHAR_TYPE_SIZE BITS_PER_WORD
808 +/* This was defined in linux.h. Define it here also. */
809 +#undef DEFAULT_VTABLE_THUNKS
810 +#define DEFAULT_VTABLE_THUNKS 1
813 +#define HANDLE_PRAGMA_PACK_PUSH_POP
815 +/* Pick up the return address upon entry to a procedure. Used for
816 + dwarf2 unwind information. This also enables the table driven
819 +#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, PR_REG)
820 +#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (PR_REG)
825 + %{!m4:%(cpp_default_cpu_spec)} \
826 + %(subtarget_cpp_spec) \
827 + %(subtarget_cpp_ptr_spec) \
828 + %(subtarget_cpp_endian_spec) "
830 #undef SUBTARGET_CPP_SPEC
831 #define SUBTARGET_CPP_SPEC "\
832 %{fPIC:-D__PIC__ -D__pic__} \
834 #undef CPP_DEFAULT_CPU_SPEC
835 #define CPP_DEFAULT_CPU_SPEC "-D__SH3__ -D__sh3__"
838 #undef CPP_PREDEFINES
839 #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -D__gnu_linux__ -Dlinux -Asystem=posix"
841 +/* The GNU C++ standard library requires that these macros be defined. */
842 +#undef CPLUSPLUS_CPP_SPEC
843 +#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
846 -#define ASM_SPEC "%{!mb:-little} %{mrelax:-relax}"
847 +#define ASM_SPEC "%{mb:-big} %{!mb:-little} %{mrelax:-relax}"
851 - "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
854 -#define CC1PLUS_SPEC \
855 - "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
856 + "-musermode %{!mb:-ml} %{!m4:-m3} %{profile:-p}"
858 +/* XXX: It's wrong if prefix != /usr */
861 - "%{!mb:-m shlelf_linux} %{mrelax:-relax} \
862 + "%{!mb:-m shlelf_linux -EL} %{mb:-m shelf_linux -EB} %{mrelax:-relax} \
865 %{rdynamic:-export-dynamic} \
866 %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
867 - %{!rpath:-rpath /lib}} \
868 + %{!mb:%{!m4:-rpath-link /usr/sh-linux/lib }} \
869 + %{!mb:%{m4:-rpath-link /usr/sh-linux/lib/m4 }} \
870 + %{mb:%{!m4:-rpath-link /usr/sh-linux/lib/mb }} \
871 + %{mb:%{m4:-rpath-link /usr/sh-linux/lib/mb/m4 }}} \
878 - %{!shared: %{pthread:-lthread} \
879 - %{profile:-lc_p} %{!profile: -lc}}"
880 + %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \
881 + %{profile:-lc_p} %{!profile: -lc}}"
883 +#if defined(HAVE_LD_EH_FRAME_HDR)
885 +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
888 #undef STARTFILE_SPEC
889 #define STARTFILE_SPEC \
891 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
892 %{!p:%{profile:gcrt1.o%s} \
893 %{!profile:crt1.o%s}}}} \
894 - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
895 + crti.o%s %{static:crtbeginT.o%s}\
896 + %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
898 +#undef FUNCTION_PROFILER
899 +#define FUNCTION_PROFILER(STREAM,LABELNO) \
904 + fprintf (STREAM, " mov.l 3f,r1\n"); \
905 + fprintf (STREAM, " mova 3f,r0\n"); \
906 + fprintf (STREAM, " add r1,r0\n"); \
907 + fprintf (STREAM, " mov.l 1f,r1\n"); \
908 + fprintf (STREAM, " mov.l @(r0,r1),r1\n"); \
912 + fprintf (STREAM, " mov.l 1f,r1\n"); \
914 + fprintf (STREAM, " sts.l pr,@-r15\n"); \
915 + fprintf (STREAM, " mova 2f,r0\n"); \
916 + fprintf (STREAM, " jmp @r1\n"); \
917 + fprintf (STREAM, " lds r0,pr\n"); \
918 + fprintf (STREAM, " .align 2\n"); \
921 + fprintf (STREAM, "1: .long mcount@GOT\n"); \
922 + fprintf (STREAM, "3: .long _GLOBAL_OFFSET_TABLE_\n"); \
926 + fprintf (STREAM, "1: .long mcount\n"); \
928 + fprintf (STREAM, "2: lds.l @r15+,pr\n"); \
931 +#define NO_SHARED_LIBGCC_MULTILIB
932 diff -ruN gcc-20030210.orig/gcc/config/sh/sh-protos.h gcc-20030210/gcc/config/sh/sh-protos.h
933 --- gcc-20030210.orig/gcc/config/sh/sh-protos.h Fri Feb 22 01:42:28 2002
934 +++ gcc-20030210/gcc/config/sh/sh-protos.h Sat Feb 22 01:40:14 2003
936 extern int shl_sext_length PARAMS ((rtx));
937 extern int gen_shl_sext PARAMS ((rtx, rtx, rtx, rtx));
938 extern rtx gen_datalabel_ref PARAMS ((rtx));
939 +extern int shl_casesi_worker_length PARAMS ((rtx));
940 extern int regs_used PARAMS ((rtx, int));
941 extern void fixup_addr_diff_vecs PARAMS ((rtx));
942 extern int get_dest_uid PARAMS ((rtx, int));
943 diff -ruN gcc-20030210.orig/gcc/config/sh/sh.c gcc-20030210/gcc/config/sh/sh.c
944 --- gcc-20030210.orig/gcc/config/sh/sh.c Fri Feb 22 01:42:28 2002
945 +++ gcc-20030210/gcc/config/sh/sh.c Sat Feb 22 01:40:14 2003
946 @@ -2143,6 +2143,48 @@
951 +/* Function to be used in the length attribute of the casesi_worker
952 + instruction. Returns number of instructions, which is half of the
953 + length of bytes. */
956 +shl_casesi_worker_length (insn)
959 + rtx set_src, label;
962 + set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
963 + if (!(GET_CODE (set_src) == UNSPEC
964 + && XINT (set_src, 1) == UNSPEC_CASESI))
967 + label = XVECEXP (set_src, 0, 2);
968 + if (GET_CODE (label) != LABEL_REF)
971 + diff_vec = PATTERN (next_real_insn (XEXP (label, 0)));
973 + if (GET_CODE (diff_vec) != ADDR_DIFF_VEC)
976 + switch (GET_MODE (diff_vec))
981 + if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
985 + if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
993 /* The SH cannot load a large constant into a register, constants have to
994 come from a pc relative load. The reference of a pc relative load
995 @@ -3190,7 +3232,7 @@
996 vec_lab = XEXP (XEXP (pat, 0), 0);
998 /* Search the matching casesi_jump_2. */
999 - for (prev = vec_lab; ; prev = PREV_INSN (prev))
1000 + for (prev = vec_lab; prev; prev = PREV_INSN (prev))
1002 if (GET_CODE (prev) != JUMP_INSN)
1004 @@ -3205,6 +3247,13 @@
1009 + { /* Switch statement has been optimized out. */
1010 + delete_insn (PREV_INSN (insn));
1011 + delete_insn (insn);
1015 /* Emit the reference label of the braf where it belongs, right after
1016 the casesi_jump_2 (i.e. braf). */
1017 braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0);
1018 @@ -3223,7 +3272,7 @@
1019 rtx barrier_or_label;
1021 rtx next = next_real_insn (barrier_or_label), pat, prev;
1022 - int slot, credit, jump_to_next;
1023 + int slot, credit, jump_to_next = 0;
1027 @@ -4507,7 +4556,8 @@
1028 if (current_function_varargs || current_function_stdarg)
1030 /* This is not used by the SH3E calling convention */
1031 - if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI)
1032 + if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI
1033 + || TARGET_NO_IMPLICIT_FP)
1035 /* Push arg regs as if they'd been provided by caller in stack. */
1036 for (i = 0; i < NPARM_REGS(SImode); i++)
1037 @@ -5149,7 +5199,8 @@
1038 tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
1041 - if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI)
1042 + if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI
1043 + || TARGET_NO_IMPLICIT_FP)
1044 return ptr_type_node;
1046 record = make_node (RECORD_TYPE);
1047 @@ -5211,7 +5262,8 @@
1051 - if ((! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI)
1052 + if ((! TARGET_SH3E && ! TARGET_SH4)
1053 + || TARGET_HITACHI || TARGET_NO_IMPLICIT_FP)
1055 std_expand_builtin_va_start (stdarg_p, valist, nextarg);
1057 @@ -5289,7 +5341,8 @@
1058 rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
1059 pptr_type_node = build_pointer_type (ptr_type_node);
1061 - if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) && ! TARGET_HITACHI)
1062 + if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4)
1063 + && ! TARGET_HITACHI && ! TARGET_NO_IMPLICIT_FP)
1065 tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
1066 tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack;
1067 diff -ruN gcc-20030210.orig/gcc/config/sh/sh.h gcc-20030210/gcc/config/sh/sh.h
1068 --- gcc-20030210.orig/gcc/config/sh/sh.h Fri Feb 22 01:42:28 2002
1069 +++ gcc-20030210/gcc/config/sh/sh.h Sat Feb 22 01:40:14 2003
1070 @@ -147,10 +147,10 @@
1071 #define HARD_SH4_BIT (1<<5)
1072 #define FPU_SINGLE_BIT (1<<7)
1073 #define SH4_BIT (1<<12)
1074 +#define NO_IMPLICIT_FP_BIT (1<<3)
1075 #define FMOVD_BIT (1<<4)
1076 #define SH5_BIT (1<<0)
1077 #define SPACE_BIT (1<<13)
1078 -#define BIGTABLE_BIT (1<<14)
1079 #define RELAX_BIT (1<<15)
1080 #define USERMODE_BIT (1<<16)
1081 #define HITACHI_BIT (1<<22)
1083 /* Nonzero if we should generate code for a SH5 CPU (either ISA). */
1084 #define TARGET_SH5 (target_flags & SH5_BIT)
1086 +/* Nonzero if we should not use FPU implicitly. */
1087 +#define TARGET_NO_IMPLICIT_FP (target_flags & NO_IMPLICIT_FP_BIT)
1089 /* Nonzero if we should generate code using the SHcompact instruction
1090 set and 32-bit ABI. */
1091 #define TARGET_SHCOMPACT (TARGET_SH5 && TARGET_SH1)
1094 /* Nonzero if we should generate code using SHmedia FPU instructions. */
1095 #define TARGET_SHMEDIA_FPU (TARGET_SHMEDIA && TARGET_FPU_DOUBLE)
1097 /* Nonzero if we should generate fmovd. */
1098 #define TARGET_FMOVD (target_flags & FMOVD_BIT)
1101 /* Nonzero if we should generate smaller code rather than faster code. */
1102 #define TARGET_SMALLCODE (target_flags & SPACE_BIT)
1104 -/* Nonzero to use long jump tables. */
1105 -#define TARGET_BIGTABLE (target_flags & BIGTABLE_BIT)
1107 /* Nonzero to generate pseudo-ops needed by the assembler and linker
1108 to do function call relaxing. */
1109 #define TARGET_RELAX (target_flags & RELAX_BIT)
1111 {"5-compact-nofpu", TARGET_NONE, "" }, \
1112 {"5-compact-nofpu", SH5_BIT|SH3_BIT|SH2_BIT|SH1_BIT, "Generate FPU-less SHcompact code" }, \
1113 {"b", -LITTLE_ENDIAN_BIT, "" }, \
1114 - {"bigtable", BIGTABLE_BIT, "" }, \
1115 {"dalign", DALIGN_BIT, "" }, \
1116 {"fmovd", FMOVD_BIT, "" }, \
1117 {"hitachi", HITACHI_BIT, "" }, \
1119 {"isize", ISIZE_BIT, "" }, \
1120 {"l", LITTLE_ENDIAN_BIT, "" }, \
1121 {"no-ieee", -IEEE_BIT, "" }, \
1122 + {"no-implicit-fp", NO_IMPLICIT_FP_BIT, "" }, \
1123 {"padstruct", PADSTRUCT_BIT, "" }, \
1124 {"prefergot", PREFERGOT_BIT, "" }, \
1125 {"relax", RELAX_BIT, "" }, \
1126 @@ -2493,16 +2494,22 @@
1130 +extern int optimize; /* needed for gen_casesi. */
1131 +extern int optimize_size;
1133 /* Specify the machine mode that this machine uses
1134 for the index in the tablejump instruction. */
1135 -#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode)
1136 +#define CASE_VECTOR_MODE SImode
1138 #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \
1139 ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \
1140 ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \
1141 : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \
1142 ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \
1143 - : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 ? HImode \
1144 + : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 \
1145 + ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \
1146 + : optimize_size && (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 65535 \
1147 + ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, HImode) \
1150 /* Define as C expression which evaluates to nonzero if the tablejump
1151 @@ -3038,10 +3045,7 @@
1152 /* Output an absolute table element. */
1154 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \
1155 - if (TARGET_BIGTABLE) \
1156 - asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); \
1158 - asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE)); \
1159 + asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE))
1161 /* Output various types of constants. */
1163 @@ -3167,8 +3171,6 @@
1164 #define sh_cpu_attr ((enum attr_cpu)sh_cpu)
1165 extern enum processor_type sh_cpu;
1167 -extern int optimize; /* needed for gen_casesi. */
1169 enum mdep_reorg_phase_e
1171 SH_BEFORE_MDEP_REORG,
1172 diff -ruN gcc-20030210.orig/gcc/config/sh/sh.md gcc-20030210/gcc/config/sh/sh.md
1173 --- gcc-20030210.orig/gcc/config/sh/sh.md Sat Nov 23 04:58:06 2002
1174 +++ gcc-20030210/gcc/config/sh/sh.md Sat Feb 22 01:40:14 2003
1175 @@ -1242,7 +1242,7 @@
1176 (clobber (reg:SI PR_REG))
1177 (clobber (reg:SI R4_REG))
1178 (use (match_operand:SI 1 "arith_reg_operand" "r"))]
1179 - "TARGET_SH1 && ! TARGET_SH4"
1180 + "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP"
1182 [(set_attr "type" "sfunc")
1183 (set_attr "needs_delay_slot" "yes")])
1184 @@ -1336,7 +1336,7 @@
1186 operands[3] = gen_reg_rtx (Pmode);
1187 /* Emit the move of the address to a pseudo outside of the libcall. */
1188 - if (TARGET_HARD_SH4 && TARGET_SH3E)
1189 + if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP)
1191 emit_move_insn (operands[3],
1192 gen_rtx_SYMBOL_REF (SImode, \"__udivsi3_i4\"));
1193 @@ -1391,7 +1391,7 @@
1194 (clobber (reg:SI R2_REG))
1195 (clobber (reg:SI R3_REG))
1196 (use (match_operand:SI 1 "arith_reg_operand" "r"))]
1197 - "TARGET_SH1 && ! TARGET_SH4"
1198 + "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP"
1200 [(set_attr "type" "sfunc")
1201 (set_attr "needs_delay_slot" "yes")])
1202 @@ -1476,7 +1476,7 @@
1204 operands[3] = gen_reg_rtx (Pmode);
1205 /* Emit the move of the address to a pseudo outside of the libcall. */
1206 - if (TARGET_HARD_SH4 && TARGET_SH3E)
1207 + if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP)
1209 emit_move_insn (operands[3],
1210 gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3_i4\"));
1211 @@ -6446,6 +6446,8 @@
1213 return \"shll2 %1\;mov.l @(r0,%1),%0\";
1215 + if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
1216 + return \"add %1,%1\;mov.w @(r0,%1),%0\;extu.w %0,%0\";
1217 return \"add %1,%1\;mov.w @(r0,%1),%0\";
1219 if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
1220 @@ -6455,7 +6457,15 @@
1224 - [(set_attr "length" "4")])
1225 + [(set (attr "length")
1226 + (cond [(eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 1))
1227 + (const_string "2")
1228 + (eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 2))
1229 + (const_string "4")
1230 + ;; Put "match_dup" here so that insn_variable_length_p return 1.
1231 + (ne (match_dup 2) (match_dup 2))
1232 + (const_string "4")]
1233 + (const_string "6")))])
1235 (define_insn "casesi_shift_media"
1236 [(set (match_operand 0 "arith_reg_operand" "=r")
1237 diff -ruN gcc-20030210.orig/gcc/config/sh/sh3-linux.h gcc-20030210/gcc/config/sh/sh3-linux.h
1238 --- gcc-20030210.orig/gcc/config/sh/sh3-linux.h Thu Jan 1 09:00:00 1970
1239 +++ gcc-20030210/gcc/config/sh/sh3-linux.h Sat Feb 22 01:40:14 2003
1241 +#undef TARGET_VERSION
1242 +#define TARGET_VERSION fputs (" (SH3 GNU/Linux with ELF)", stderr);
1246 + "-D__LITTLE_ENDIAN__ \
1247 + -D__SH3__ -D__sh3__ \
1248 + -D__SIZE_TYPE__=unsigned\\ int \
1249 + -D__PTRDIFF_TYPE__=int \
1250 + %{fPIC:-D__PIC__ -D__pic__} \
1251 + %{fpic:-D__PIC__ -D__pic__} \
1252 + %{posix:-D_POSIX_SOURCE} \
1253 + %{pthread:-D_REENTRANT -D_PTHREADS}"
1256 +#define ASM_SPEC "%{mrelax:-relax}"
1260 + "-musermode -ml -m3 %{profile:-p}"
1263 +#define LINK_SPEC \
1264 + "%{mrelax:-relax} \
1265 + %{shared:-shared} \
1267 + %{rdynamic:-export-dynamic} \
1268 + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
1269 + %{static:-static}"
1270 diff -ruN gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h gcc-20030210/gcc/config/sh/sh3eb-linux.h
1271 --- gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h Thu Jan 1 09:00:00 1970
1272 +++ gcc-20030210/gcc/config/sh/sh3eb-linux.h Sat Feb 22 01:40:14 2003
1274 +#undef TARGET_VERSION
1275 +#define TARGET_VERSION fputs (" (SH3EB GNU/Linux with ELF)", stderr);
1279 + "-D__BIG_ENDIAN__ \
1280 + -D__SH3__ -D__sh3__ \
1281 + -D__SIZE_TYPE__=unsigned\\ int \
1282 + -D__PTRDIFF_TYPE__=int \
1283 + %{fPIC:-D__PIC__ -D__pic__} \
1284 + %{fpic:-D__PIC__ -D__pic__} \
1285 + %{posix:-D_POSIX_SOURCE} \
1286 + %{pthread:-D_REENTRANT -D_PTHREADS}"
1289 +#define ASM_SPEC "%{mrelax:-relax}"
1293 + "-musermode -mb -m3 %{profile:-p}"
1296 +#define LINK_SPEC \
1297 + "%{mrelax:-relax} \
1298 + %{shared:-shared} \
1300 + %{rdynamic:-export-dynamic} \
1301 + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
1302 + %{static:-static}"
1303 diff -ruN gcc-20030210.orig/gcc/config/sh/sh4-linux.h gcc-20030210/gcc/config/sh/sh4-linux.h
1304 --- gcc-20030210.orig/gcc/config/sh/sh4-linux.h Thu Jan 1 09:00:00 1970
1305 +++ gcc-20030210/gcc/config/sh/sh4-linux.h Sat Feb 22 01:40:14 2003
1307 +#undef TARGET_VERSION
1308 +#define TARGET_VERSION fputs (" (SH4 GNU/Linux with ELF)", stderr);
1312 + "-D__LITTLE_ENDIAN__ \
1314 + -D__SIZE_TYPE__=unsigned\\ int \
1315 + -D__PTRDIFF_TYPE__=int \
1316 + %{fPIC:-D__PIC__ -D__pic__} \
1317 + %{fpic:-D__PIC__ -D__pic__} \
1318 + %{posix:-D_POSIX_SOURCE} \
1319 + %{pthread:-D_REENTRANT -D_PTHREADS}"
1322 +#define ASM_SPEC "%{mrelax:-relax}"
1326 + "-musermode -ml -m4 %{profile:-p}"
1329 +#define LINK_SPEC \
1330 + "%{mrelax:-relax} \
1331 + %{shared:-shared} \
1333 + %{rdynamic:-export-dynamic} \
1334 + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
1335 + %{static:-static}"
1336 diff -ruN gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h gcc-20030210/gcc/config/sh/sh4eb-linux.h
1337 --- gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h Thu Jan 1 09:00:00 1970
1338 +++ gcc-20030210/gcc/config/sh/sh4eb-linux.h Sat Feb 22 01:40:14 2003
1340 +#undef TARGET_VERSION
1341 +#define TARGET_VERSION fputs (" (SH4EB GNU/Linux with ELF)", stderr);
1345 + "-D__BIG_ENDIAN__ \
1347 + -D__SIZE_TYPE__=unsigned\\ int \
1348 + -D__PTRDIFF_TYPE__=int \
1349 + %{fPIC:-D__PIC__ -D__pic__} \
1350 + %{fpic:-D__PIC__ -D__pic__} \
1351 + %{posix:-D_POSIX_SOURCE} \
1352 + %{pthread:-D_REENTRANT -D_PTHREADS}"
1355 +#define ASM_SPEC "%{mrelax:-relax}"
1359 + "-musermode -mb -m4 %{profile:-p}"
1362 +#define LINK_SPEC \
1363 + "%{mrelax:-relax} \
1364 + %{shared:-shared} \
1366 + %{rdynamic:-export-dynamic} \
1367 + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
1368 + %{static:-static}"
1369 diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux gcc-20030210/gcc/config/sh/t-linux
1370 --- gcc-20030210.orig/gcc/config/sh/t-linux Thu May 17 12:16:12 2001
1371 +++ gcc-20030210/gcc/config/sh/t-linux Sat Feb 22 01:40:14 2003
1373 -TARGET_LIBGCC2_CFLAGS = -fpic
1374 +TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES
1375 +LIBGCC1 = libgcc1-asm.a
1376 +CROSS_LIBGCC1 = libgcc1-asm.a
1377 +LIBGCC1_TEST = libgcc1-test
1378 LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
1379 _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
1381 +LIB2ADDEH = $(srcdir)/unwind-sjlj.c
1382 +LIB2ADDEHDEP = unwind.inc unwind-sjlj.c
1384 -MULTILIB_OPTIONS= mb m3e/m4
1385 +MULTILIB_OPTIONS= mb m4
1389 -EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
1390 +EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
1392 +# Override t-slibgcc-elf-ver to export some libgcc symbols with
1393 +# the symbol versions that glibc used and SH specific.
1394 +SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \
1395 + $(srcdir)/config/sh/libgcc-glibc.ver
1396 diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux-nomulti gcc-20030210/gcc/config/sh/t-linux-nomulti
1397 --- gcc-20030210.orig/gcc/config/sh/t-linux-nomulti Thu Jan 1 09:00:00 1970
1398 +++ gcc-20030210/gcc/config/sh/t-linux-nomulti Sat Feb 22 01:40:14 2003
1401 +EXTRA_PARTS = crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o
1403 +INSTALL_LIBGCC = install-libgcc
1408 +EXTRA_MULTILIB_PARTS=
1409 diff -ruN gcc-20030210.orig/gcc/config.gcc gcc-20030210/gcc/config.gcc
1410 --- gcc-20030210.orig/gcc/config.gcc Fri Jan 31 19:17:13 2003
1411 +++ gcc-20030210/gcc/config.gcc Sat Feb 22 01:40:14 2003
1424 tm_file=${cpu_type}/${cpu_type}.h
1425 @@ -3018,9 +3018,31 @@
1431 tm_file="${tm_file} sh/elf.h sh/linux.h"
1432 - tmake_file="sh/t-sh sh/t-elf sh/t-linux"
1433 + tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux"
1434 + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
1437 + tm_file="${tm_file} sh/sh3eb-linux.h"
1438 + tmake_file="${tmake_file} sh/t-linux-nomulti"
1441 + tm_file="${tm_file} sh/sh4eb-linux.h"
1442 + tmake_file="${tmake_file} sh/t-linux-nomulti"
1445 + tm_file="${tm_file} sh/sh3-linux.h"
1446 + tmake_file="${tmake_file} sh/t-linux-nomulti"
1449 + tm_file="${tm_file} sh/sh4-linux.h"
1450 + tmake_file="${tmake_file} sh/t-linux-nomulti"
1455 + xmake_file=x-linux
1459 diff -ruN gcc-20030210.orig/gcc/dwarf2out.c gcc-20030210/gcc/dwarf2out.c
1460 --- gcc-20030210.orig/gcc/dwarf2out.c Mon Feb 10 19:36:25 2003
1461 +++ gcc-20030210/gcc/dwarf2out.c Sat Feb 22 01:40:14 2003
1462 @@ -10224,7 +10224,9 @@
1463 /* We can have a normal definition following an inline one in the
1464 case of redefinition of GNU C extern inlines.
1465 It seems reasonable to use AT_specification in this case. */
1466 - && !get_AT_unsigned (old_die, DW_AT_inline))
1467 + && !get_AT_unsigned (old_die, DW_AT_inline)
1468 + /* Skip the nested function. */
1469 + && !decl_function_context (decl))
1471 /* ??? This can happen if there is a bug in the program, for
1472 instance, if it has duplicate function definitions. Ideally,
1473 diff -ruN gcc-20030210.orig/gcc/final.c gcc-20030210/gcc/final.c
1474 --- gcc-20030210.orig/gcc/final.c Fri Jan 31 19:17:20 2003
1475 +++ gcc-20030210/gcc/final.c Sat Feb 22 01:40:14 2003
1476 @@ -1128,7 +1128,7 @@
1480 - INSN_ADDRESSES (uid) = insn_current_address;
1481 + INSN_ADDRESSES (uid) = insn_current_address + insn_lengths[uid];
1483 if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER
1484 || GET_CODE (insn) == CODE_LABEL)
1485 diff -ruN gcc-20030210.orig/gcc/mkmap-symver.awk gcc-20030210/gcc/mkmap-symver.awk
1486 --- gcc-20030210.orig/gcc/mkmap-symver.awk Fri Jan 31 19:17:26 2003
1487 +++ gcc-20030210/gcc/mkmap-symver.awk Sat Feb 22 01:40:14 2003
1489 output(inherit[lib]);
1491 printf("%s {\n", lib);
1492 - printf(" global:\n");
1494 + if ((ver[sym] == lib) && (sym in def))
1497 + printf(" global:\n");
1499 if ((ver[sym] == lib) && (sym in def))
1501 diff -ruN gcc-20030210.orig/gcc/reload1.c gcc-20030210/gcc/reload1.c
1502 --- gcc-20030210.orig/gcc/reload1.c Fri Jan 31 19:17:29 2003
1503 +++ gcc-20030210/gcc/reload1.c Sat Feb 22 01:40:14 2003
1504 @@ -6103,6 +6103,7 @@
1505 for (j = 0; j < n_reloads; j++)
1507 && rld[j].when_needed != RELOAD_OTHER
1508 + && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS
1509 && reg_overlap_mentioned_for_reload_p (rld[j].in,
1512 diff -ruN gcc-20030210.orig/gcc/reorg.c gcc-20030210/gcc/reorg.c
1513 --- gcc-20030210.orig/gcc/reorg.c Fri Jan 31 19:17:30 2003
1514 +++ gcc-20030210/gcc/reorg.c Sat Feb 22 01:40:14 2003
1515 @@ -3265,6 +3265,14 @@
1516 || condjump_in_parallel_p (XVECEXP (PATTERN (insn), 0, 0))))
1519 +#ifdef MD_CAN_REDIRECT_BRANCH
1520 + /* On some targets, branches with delay slots can have a limited
1521 + displacement. Give the back end a chance to tell us we can't do
1523 + if (! MD_CAN_REDIRECT_BRANCH (insn, delay_insn))
1527 target_label = JUMP_LABEL (delay_insn);
1530 diff -ruN gcc-20030210.orig/gcc/tree-inline.c gcc-20030210/gcc/tree-inline.c
1531 --- gcc-20030210.orig/gcc/tree-inline.c Fri Jan 31 19:17:33 2003
1532 +++ gcc-20030210/gcc/tree-inline.c Sat Feb 22 01:40:14 2003
1533 @@ -836,11 +836,17 @@
1535 /* Don't try to inline functions that are not well-suited to
1537 - if (!inlinable_function_p (fn, id))
1539 + if (! inlinable_function_p (fn, id)
1540 + || ! (*lang_hooks.tree_inlining.start_inlining) (fn))
1542 + if (DECL_INLINE (fn) && warn_inline && ! flag_really_no_inline)
1544 + warning_with_decl (fn, "inlining failed in call to `%s'");
1545 + warning ("called from here");
1548 - if (! (*lang_hooks.tree_inlining.start_inlining) (fn))
1553 /* Set the current filename and line number to the function we are
1554 inlining so that when we create new _STMT nodes here they get
1555 diff -ruN gcc-20030210.orig/libjava/Makefile.in gcc-20030210/libjava/Makefile.in
1556 --- gcc-20030210.orig/libjava/Makefile.in Tue Jan 28 10:44:37 2003
1557 +++ gcc-20030210/libjava/Makefile.in Sat Feb 22 01:40:14 2003
1558 @@ -1637,6 +1637,7 @@
1564 "LIBCFLAGS=$(LIBCFLAGS)" \
1566 diff -ruN gcc-20030210.orig/libjava/configure gcc-20030210/libjava/configure
1567 --- gcc-20030210.orig/libjava/configure Tue Jan 28 10:44:37 2003
1568 +++ gcc-20030210/libjava/configure Sat Feb 22 01:42:11 2003
1569 @@ -2031,7 +2031,7 @@
1570 # This must be Linux ELF.
1573 - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
1574 + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
1575 lt_cv_deplibs_check_method=pass_all ;;
1577 # glibc up to 2.1.1 does not perform some relocations on ARM
1578 diff -ruN gcc-20030210.orig/libjava/java/net/natInetAddress.cc gcc-20030210/libjava/java/net/natInetAddress.cc
1579 --- gcc-20030210.orig/libjava/java/net/natInetAddress.cc Tue Mar 5 05:02:19 2002
1580 +++ gcc-20030210/libjava/java/net/natInetAddress.cc Sat Feb 22 01:40:14 2003
1584 #ifndef HAVE_GETHOSTNAME_DECL
1585 -extern "C" int gethostname (char *name, int namelen);
1586 +extern "C" int gethostname (char *name, unsigned int namelen);
1589 #ifdef DISABLE_JAVA_NET
1590 diff -ruN gcc-20030210.orig/libjava/libltdl/aclocal.m4 gcc-20030210/libjava/libltdl/aclocal.m4
1591 --- gcc-20030210.orig/libjava/libltdl/aclocal.m4 Sun Sep 10 17:04:40 2000
1592 +++ gcc-20030210/libjava/libltdl/aclocal.m4 Sat Feb 22 01:40:14 2003
1594 # This must be Linux ELF.
1597 - alpha* | i*86 | powerpc* | sparc* | ia64* )
1598 + alpha* | i*86 | powerpc* | sparc* | ia64* | sh*)
1599 lt_cv_deplibs_check_method=pass_all ;;
1601 # glibc up to 2.1.1 does not perform some relocations on ARM
1602 diff -ruN gcc-20030210.orig/libjava/sysdep/sh/locks.h gcc-20030210/libjava/sysdep/sh/locks.h
1603 --- gcc-20030210.orig/libjava/sysdep/sh/locks.h Thu Jan 1 09:00:00 1970
1604 +++ gcc-20030210/libjava/sysdep/sh/locks.h Sat Feb 22 01:40:14 2003
1606 +// locks.h - Thread synchronization primitives. SuperH implementation.
1608 +/* Copyright (C) 2002 Free Software Foundation
1610 + This file is part of libgcj.
1612 +This software is copyrighted work licensed under the terms of the
1613 +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
1616 +#ifndef __SYSDEP_LOCKS_H__
1617 +#define __SYSDEP_LOCKS_H__
1619 +typedef size_t obj_addr_t; /* Integer type big enough for object */
1622 +static unsigned char __cas_lock = 0;
1625 +__cas_start_atomic (void)
1630 + __asm__ __volatile__ ("tas.b @%1; movt %0"
1632 + : "r" (&__cas_lock)
1638 +__cas_end_atomic (void)
1640 + __asm__ __volatile__ (" " : : : "memory");
1645 +compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old,
1646 + obj_addr_t new_val)
1650 + __cas_start_atomic ();
1658 + __cas_end_atomic ();
1664 +release_set (volatile obj_addr_t *addr, obj_addr_t new_val)
1666 + __asm__ __volatile__ (" " : : : "memory");
1667 + *(addr) = new_val;
1671 +compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old,
1672 + obj_addr_t new_val)
1674 + return compare_and_swap (addr, old, new_val);
1677 +#endif /* ! __SYSDEP_LOCKS_H__ */
1678 diff -ruN gcc-20030210.orig/libstdc++-v3/acinclude.m4 gcc-20030210/libstdc++-v3/acinclude.m4
1679 --- gcc-20030210.orig/libstdc++-v3/acinclude.m4 Tue Jan 28 02:30:41 2003
1680 +++ gcc-20030210/libstdc++-v3/acinclude.m4 Sat Feb 22 01:40:14 2003
1681 @@ -1828,9 +1828,10 @@
1682 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1684 # Passed down for canadian crosses.
1685 - if test x"$CANADIAN" = xyes; then
1686 - TOPLEVEL_INCLUDES='-I$(includedir)'
1688 + #if test x"$CANADIAN" = xyes; then
1689 + # TOPLEVEL_INCLUDES='-I$(includedir)'
1691 + TOPLEVEL_INCLUDES=''
1693 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1695 diff -ruN gcc-20030210.orig/libstdc++-v3/aclocal.m4 gcc-20030210/libstdc++-v3/aclocal.m4
1696 --- gcc-20030210.orig/libstdc++-v3/aclocal.m4 Mon Feb 10 19:36:47 2003
1697 +++ gcc-20030210/libstdc++-v3/aclocal.m4 Sat Feb 22 01:40:14 2003
1698 @@ -1840,9 +1840,10 @@
1699 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1701 # Passed down for canadian crosses.
1702 - if test x"$CANADIAN" = xyes; then
1703 - TOPLEVEL_INCLUDES='-I$(includedir)'
1705 + #if test x"$CANADIAN" = xyes; then
1706 + # TOPLEVEL_INCLUDES='-I$(includedir)'
1708 + TOPLEVEL_INCLUDES=''
1710 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1712 diff -ruN gcc-20030210.orig/libstdc++-v3/configure gcc-20030210/libstdc++-v3/configure
1713 --- gcc-20030210.orig/libstdc++-v3/configure Mon Feb 10 19:37:17 2003
1714 +++ gcc-20030210/libstdc++-v3/configure Sat Feb 22 01:40:14 2003
1715 @@ -1982,7 +1982,7 @@
1716 # This must be Linux ELF.
1719 - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
1720 + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh*)
1721 lt_cv_deplibs_check_method=pass_all ;;
1723 # glibc up to 2.1.1 does not perform some relocations on ARM
1724 @@ -22340,9 +22340,10 @@
1725 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1727 # Passed down for canadian crosses.
1728 - if test x"$CANADIAN" = xyes; then
1729 - TOPLEVEL_INCLUDES='-I$(includedir)'
1731 + #if test x"$CANADIAN" = xyes; then
1732 + # TOPLEVEL_INCLUDES='-I$(includedir)'
1734 + TOPLEVEL_INCLUDES=''
1736 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1738 diff -ruN gcc-20030210.orig/libtool.m4 gcc-20030210/libtool.m4
1739 --- gcc-20030210.orig/libtool.m4 Fri Jan 31 19:16:59 2003
1740 +++ gcc-20030210/libtool.m4 Sat Feb 22 01:40:14 2003
1742 # This must be Linux ELF.
1745 - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
1746 + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
1747 lt_cv_deplibs_check_method=pass_all ;;
1749 # glibc up to 2.1.1 does not perform some relocations on ARM
1750 diff -ruN gcc-20030210.orig/zlib/configure gcc-20030210/zlib/configure
1751 --- gcc-20030210.orig/zlib/configure Tue Jan 28 10:44:15 2003
1752 +++ gcc-20030210/zlib/configure Sat Feb 22 01:40:14 2003
1753 @@ -1571,7 +1571,7 @@
1754 # This must be Linux ELF.
1757 - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
1758 + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
1759 lt_cv_deplibs_check_method=pass_all ;;
1761 # glibc up to 2.1.1 does not perform some relocations on ARM