patches/gcc/4.3.1/300-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
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 Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
     2 diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c
     3 --- gcc-4.3.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
     4 +++ gcc-4.3.1/libmudflap/mf-hooks2.c	2008-06-10 14:59:05.000000000 +0200
     5 @@ -427,7 +427,7 @@
     6  {
     7    TRACE ("%s\n", __PRETTY_FUNCTION__);
     8    MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
     9 -  bzero (s, n);
    10 +  memset (s, 0, n);
    11  }
    12  
    13  
    14 @@ -437,7 +437,7 @@
    15    TRACE ("%s\n", __PRETTY_FUNCTION__);
    16    MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
    17    MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
    18 -  bcopy (src, dest, n);
    19 +  memmove (dest, src, n);
    20  }
    21  
    22  
    23 @@ -447,7 +447,7 @@
    24    TRACE ("%s\n", __PRETTY_FUNCTION__);
    25    MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
    26    MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
    27 -  return bcmp (s1, s2, n);
    28 +  return memcmp (s1, s2, n);
    29  }
    30  
    31  
    32 @@ -456,7 +456,7 @@
    33    size_t n = strlen (s);
    34    TRACE ("%s\n", __PRETTY_FUNCTION__);
    35    MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
    36 -  return index (s, c);
    37 +  return strchr (s, c);
    38  }
    39  
    40  
    41 @@ -465,7 +465,7 @@
    42    size_t n = strlen (s);
    43    TRACE ("%s\n", __PRETTY_FUNCTION__);
    44    MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
    45 -  return rindex (s, c);
    46 +  return strrchr (s, c);
    47  }
    48  
    49  /* XXX:  stpcpy, memccpy */