patches/gcc/4.4.4/330-libmudflap-susv3-legacy.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:09:43 2011 +0200 (2011-05-19)
branch1.11
changeset 2465 5f98b7a90fbc
parent 1948 d341be24dc68
permissions -rw-r--r--
complibs/ppl: fix 0.11-0.11.2 to compile with --disable-shared

PPL 0.11 (through 0.11.2) had a small bug where it still tried to build
and test its Java interface even when shared libraries are disabled.
Since that's exactly what ct-ng does, it explodes.

This is the patch from the PPL authors (see final link below).

More information can be found in these messages/threads:

Anthony's initial report and analysis with Yann:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00046.html

Ron Flory hit the same problem:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00054.html

Anthony's report to the ppl-devel list:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017450.html

Roberto's reply with a link to the fix in the PPL git repo:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017455.html

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
(transplanted from 139b85d70b623e51f7585e7c64ecb8c6a6cf4567)
     1 diff -durN gcc-4.4.4.orig/libmudflap/mf-hooks2.c gcc-4.4.4/libmudflap/mf-hooks2.c
     2 --- gcc-4.4.4.orig/libmudflap/mf-hooks2.c	2009-04-10 01:23:07.000000000 +0200
     3 +++ gcc-4.4.4/libmudflap/mf-hooks2.c	2010-05-16 19:37:18.000000000 +0200
     4 @@ -421,7 +421,7 @@
     5  {
     6    TRACE ("%s\n", __PRETTY_FUNCTION__);
     7    MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
     8 -  bzero (s, n);
     9 +  memset (s, 0, n);
    10  }
    11  
    12  
    13 @@ -431,7 +431,7 @@
    14    TRACE ("%s\n", __PRETTY_FUNCTION__);
    15    MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
    16    MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
    17 -  bcopy (src, dest, n);
    18 +  memmove (dest, src, n);
    19  }
    20  
    21  
    22 @@ -441,7 +441,7 @@
    23    TRACE ("%s\n", __PRETTY_FUNCTION__);
    24    MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
    25    MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
    26 -  return bcmp (s1, s2, n);
    27 +  return n == 0 ? 0 : memcmp (s1, s2, n);
    28  }
    29  
    30  
    31 @@ -450,7 +450,7 @@
    32    size_t n = strlen (s);
    33    TRACE ("%s\n", __PRETTY_FUNCTION__);
    34    MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
    35 -  return index (s, c);
    36 +  return strchr (s, c);
    37  }
    38  
    39  
    40 @@ -459,7 +459,7 @@
    41    size_t n = strlen (s);
    42    TRACE ("%s\n", __PRETTY_FUNCTION__);
    43    MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
    44 -  return rindex (s, c);
    45 +  return strrchr (s, c);
    46  }
    47  
    48  /* XXX:  stpcpy, memccpy */