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 # See http://gcc.gnu.org/PR7383, http://www.kegel.com/xgcc3/ppc405erratum77.html
4 diff -aur gcc-20020722.orig/gcc/config/rs6000/rs6000.h gcc-20020722/gcc/config/rs6000/rs6000.h
5 --- gcc-20020722.orig/gcc/config/rs6000/rs6000.h Thu Jul 25 09:32:21 2002
6 +++ gcc-20020722/gcc/config/rs6000/rs6000.h Thu Jul 25 09:34:45 2002
8 %{mcpu=rsc1: -D_ARCH_PWR} \
9 %{mcpu=401: -D_ARCH_PPC} \
10 %{mcpu=403: -D_ARCH_PPC} \
11 -%{mcpu=405: -D_ARCH_PPC} \
12 +%{mcpu=405: -D_ARCH_PPC -D__PPC405__} \
13 %{mcpu=505: -D_ARCH_PPC} \
14 %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
15 %{mcpu=602: -D_ARCH_PPC} \
16 diff -aur gcc-20020722.orig/libjava/sysdep/powerpc/locks.h gcc-20020722/libjava/sysdep/powerpc/locks.h
17 --- gcc-20020722.orig/libjava/sysdep/powerpc/locks.h Thu Jul 25 09:32:30 2002
18 +++ gcc-20020722/libjava/sysdep/powerpc/locks.h Thu Jul 25 11:39:13 2002
20 #ifndef __SYSDEP_LOCKS_H__
21 #define __SYSDEP_LOCKS_H__
24 +// workaround for PPC405 erratum #77 - 07/18/02 JRO, dank, NN. References:
25 +// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf
26 +// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489
27 +// http://www.kegel.com/xgcc3/ppc405erratum77.html
28 +// FIXME: using dbct instead of sync would be faster
29 +#define __LIBGCJ_PPC405_ERR77_SYNC "sync \n\t"
31 +#define __LIBGCJ_PPC405_ERR77_SYNC
34 typedef size_t obj_addr_t; /* Integer type big enough for object */
41 + __LIBGCJ_PPC405_ERR77_SYNC
49 + __LIBGCJ_PPC405_ERR77_SYNC
53 diff -aur gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h
54 --- gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:32:31 2002
55 +++ gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:34:45 2002
58 typedef int _Atomic_word;
61 +// workaround for PPC405 erratum #77 - 07/18/02 JRO & dank. References:
62 +// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf
63 +// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489
64 +// http://www.kegel.com/xgcc3/ppc405erratum77.html
65 +// FIXME: using dbct instead of sync would be faster
66 +#define __LIBSTDCPP_PPC405_ERR77_SYNC "sync \n\t"
68 +#define __LIBSTDCPP_PPC405_ERR77_SYNC
71 static inline _Atomic_word
72 __attribute__ ((__unused__))
73 __exchange_and_add (volatile _Atomic_word* __mem, int __val)
77 "add%I3 %1,%0,%3 \n\t"
78 + __LIBSTDCPP_PPC405_ERR77_SYNC
81 "/* End exchange & add */"
85 "add%I2 %0,%0,%2 \n\t"
86 + __LIBSTDCPP_PPC405_ERR77_SYNC
89 "/* End atomic add */"
91 "/* Inline always swap */\n"
94 + __LIBSTDCPP_PPC405_ERR77_SYNC
97 "/* End always swap */"
102 + __LIBSTDCPP_PPC405_ERR77_SYNC
103 "stwcx. %2,0,%1 \n\t"