patches/gcc/4.3.4/300-libmudflap-susv3-legacy.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 22:43:07 2011 +0200 (2011-07-17)
changeset 2893 a8a65758664f
permissions -rw-r--r--
cc/gcc: do not use the core pass-2 to build the baremetal compiler

In case we build a baremetal compiler, use the standard passes:
- core_cc is used to build the C library;
- as such, it is meant to run on build, not host;
- the final compiler is meant to run on host;

As the current final compiler step can not build a baremetal compiler,
call the core backend from the final step.

NB: Currently, newlib is built during the start_files pass, so we have
to have a core compiler by then... Once we can build the baremetal
compiler from the final cc step, then we can move the newlib build to
the proper step, and then get rid of the core pass-1 static compiler...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
thomas@1461
     1
Original patch from: ../4.3.2/300-libmudflap-susv3-legacy.patch
thomas@1461
     2
thomas@1461
     3
-= BEGIN original header =-
thomas@1461
     4
Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
thomas@1461
     5
-= END original header =-
thomas@1461
     6
thomas@1461
     7
diff -durN gcc-4.3.3.orig/libmudflap/mf-hooks2.c gcc-4.3.3/libmudflap/mf-hooks2.c
thomas@1461
     8
--- gcc-4.3.3.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
thomas@1461
     9
+++ gcc-4.3.3/libmudflap/mf-hooks2.c	2009-01-27 22:25:45.000000000 +0100
thomas@1461
    10
@@ -427,7 +427,7 @@
thomas@1461
    11
 {
thomas@1461
    12
   TRACE ("%s\n", __PRETTY_FUNCTION__);
thomas@1461
    13
   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
thomas@1461
    14
-  bzero (s, n);
thomas@1461
    15
+  memset (s, 0, n);
thomas@1461
    16
 }
thomas@1461
    17
 
thomas@1461
    18
 
thomas@1461
    19
@@ -437,7 +437,7 @@
thomas@1461
    20
   TRACE ("%s\n", __PRETTY_FUNCTION__);
thomas@1461
    21
   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
thomas@1461
    22
   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
thomas@1461
    23
-  bcopy (src, dest, n);
thomas@1461
    24
+  memmove (dest, src, n);
thomas@1461
    25
 }
thomas@1461
    26
 
thomas@1461
    27
 
thomas@1461
    28
@@ -447,7 +447,7 @@
thomas@1461
    29
   TRACE ("%s\n", __PRETTY_FUNCTION__);
thomas@1461
    30
   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
thomas@1461
    31
   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
thomas@1461
    32
-  return bcmp (s1, s2, n);
thomas@1461
    33
+  return memcmp (s1, s2, n);
thomas@1461
    34
 }
thomas@1461
    35
 
thomas@1461
    36
 
thomas@1461
    37
@@ -456,7 +456,7 @@
thomas@1461
    38
   size_t n = strlen (s);
thomas@1461
    39
   TRACE ("%s\n", __PRETTY_FUNCTION__);
thomas@1461
    40
   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
thomas@1461
    41
-  return index (s, c);
thomas@1461
    42
+  return strchr (s, c);
thomas@1461
    43
 }
thomas@1461
    44
 
thomas@1461
    45
 
thomas@1461
    46
@@ -465,7 +465,7 @@
thomas@1461
    47
   size_t n = strlen (s);
thomas@1461
    48
   TRACE ("%s\n", __PRETTY_FUNCTION__);
thomas@1461
    49
   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
thomas@1461
    50
-  return rindex (s, c);
thomas@1461
    51
+  return strrchr (s, c);
thomas@1461
    52
 }
thomas@1461
    53
 
thomas@1461
    54
 /* XXX:  stpcpy, memccpy */