patches/gcc/4.2.4/210-libmudflap-susv3-legacy.patch
author Michael Hope <michael.hope@linaro.org>
Thu Sep 29 12:40:42 2011 +1300 (2011-09-29)
changeset 2695 f2495884ca3e
parent 687 b2b6b1d46aa1
permissions -rw-r--r--
config: add a 'auto' value for the number of parallel jobs

When CT_PARALLEL_JOBS is -1, set the number of parallel jobs to the
number of online CPUs + 1. Update documentation to match.

I find this useful when building in the cloud. You can use the same
.config file and have the build adapt to the number of processors
available. Limited testing shows that NCPUS+1 is faster than NCPUS+0
or NCPUS+2.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
     1 diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
     2 --- gcc-4.2.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
     3 +++ gcc-4.2.1/libmudflap/mf-hooks2.c	2007-08-03 20:35:09.000000000 +0200
     4 @@ -427,7 +427,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 @@ -437,7 +437,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 @@ -447,7 +447,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 @@ -456,7 +456,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 @@ -465,7 +465,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 */