patches/gcc/4.2.0/305-libmudflap-susv3-legacy.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Apr 26 21:31:05 2008 +0000 (2008-04-26)
changeset 454 372b2f397baa
permissions -rw-r--r--
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(-)
yann@111
     1
Index: gcc-4.2/libmudflap/mf-hooks2.c
yann@111
     2
===================================================================
yann@111
     3
--- gcc-4.2/libmudflap/mf-hooks2.c	(revision 119834)
yann@111
     4
+++ gcc-4.2/libmudflap/mf-hooks2.c	(working copy)
yann@111
     5
@@ -427,7 +427,7 @@
yann@111
     6
 {
yann@111
     7
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@111
     8
   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
yann@111
     9
-  bzero (s, n);
yann@111
    10
+  memset (s, 0, n);
yann@111
    11
 }
yann@111
    12
 
yann@111
    13
 
yann@111
    14
@@ -437,7 +437,7 @@
yann@111
    15
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@111
    16
   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
yann@111
    17
   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
yann@111
    18
-  bcopy (src, dest, n);
yann@111
    19
+  memmove (dest, src, n);
yann@111
    20
 }
yann@111
    21
 
yann@111
    22
 
yann@111
    23
@@ -447,7 +447,7 @@
yann@111
    24
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@111
    25
   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
yann@111
    26
   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
yann@111
    27
-  return bcmp (s1, s2, n);
yann@111
    28
+  return n == 0 ? 0 : memcmp (s1, s2, n);
yann@111
    29
 }
yann@111
    30
 
yann@111
    31
 
yann@111
    32
@@ -456,7 +456,7 @@
yann@111
    33
   size_t n = strlen (s);
yann@111
    34
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@111
    35
   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
yann@111
    36
-  return index (s, c);
yann@111
    37
+  return strchr (s, c);
yann@111
    38
 }
yann@111
    39
 
yann@111
    40
 
yann@111
    41
@@ -465,7 +465,7 @@
yann@111
    42
   size_t n = strlen (s);
yann@111
    43
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@111
    44
   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
yann@111
    45
-  return rindex (s, c);
yann@111
    46
+  return strrchr (s, c);
yann@111
    47
 }
yann@111
    48
 
yann@111
    49
 /* XXX:  stpcpy, memccpy */