patches/gcc/4.4.5/330-libmudflap-susv3-legacy.patch
author Daniel Price <daniel.price@gmail.com>
Tue Nov 20 16:59:17 2012 -0800 (2012-11-20)
changeset 3126 333d3e40cbd1
permissions -rw-r--r--
scripts: refine static linking check to better guide the user

The current mechanism to check if static linking is possible, and the mesage
displayed on failure, can be puzzling to the unsuspecting user.

Also, the current implementation is not using the existing infrastructure,
and is thus difficult to enhance with new tests.

So, switch to using the standard CT_DoExecLog infra, and use four tests to
check for the host compiler:
- check we can run it
- check it can build a trivial program
- check it can statically link that program
- check if it statically link with libstdc++

That should cover most of the problems. Hopefully.

(At the same time, fix a typo in a comment)

Signed-off-by: Daniel Price <daniel.price@gmail.com>
[yann.morin.1998@free.fr: split original patch for self-contained changes]
[yann.morin.1998@free.fr: use steps to better see gcc's output]
[yann.morin.1998@free.fr: commit log]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <163f86b5216fc08c672a.1353459722@nipigon.dssd.com>
Patchwork-Id: 200536
yann@2149
     1
diff -durN gcc-4.4.5.orig/libmudflap/mf-hooks2.c gcc-4.4.5/libmudflap/mf-hooks2.c
yann@2149
     2
--- gcc-4.4.5.orig/libmudflap/mf-hooks2.c	2009-04-10 01:23:07.000000000 +0200
yann@2149
     3
+++ gcc-4.4.5/libmudflap/mf-hooks2.c	2010-10-09 23:11:52.000000000 +0200
yann@2149
     4
@@ -421,7 +421,7 @@
yann@2149
     5
 {
yann@2149
     6
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@2149
     7
   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
yann@2149
     8
-  bzero (s, n);
yann@2149
     9
+  memset (s, 0, n);
yann@2149
    10
 }
yann@2149
    11
 
yann@2149
    12
 
yann@2149
    13
@@ -431,7 +431,7 @@
yann@2149
    14
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@2149
    15
   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
yann@2149
    16
   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
yann@2149
    17
-  bcopy (src, dest, n);
yann@2149
    18
+  memmove (dest, src, n);
yann@2149
    19
 }
yann@2149
    20
 
yann@2149
    21
 
yann@2149
    22
@@ -441,7 +441,7 @@
yann@2149
    23
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@2149
    24
   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
yann@2149
    25
   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
yann@2149
    26
-  return bcmp (s1, s2, n);
yann@2149
    27
+  return n == 0 ? 0 : memcmp (s1, s2, n);
yann@2149
    28
 }
yann@2149
    29
 
yann@2149
    30
 
yann@2149
    31
@@ -450,7 +450,7 @@
yann@2149
    32
   size_t n = strlen (s);
yann@2149
    33
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@2149
    34
   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
yann@2149
    35
-  return index (s, c);
yann@2149
    36
+  return strchr (s, c);
yann@2149
    37
 }
yann@2149
    38
 
yann@2149
    39
 
yann@2149
    40
@@ -459,7 +459,7 @@
yann@2149
    41
   size_t n = strlen (s);
yann@2149
    42
   TRACE ("%s\n", __PRETTY_FUNCTION__);
yann@2149
    43
   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
yann@2149
    44
-  return rindex (s, c);
yann@2149
    45
+  return strrchr (s, c);
yann@2149
    46
 }
yann@2149
    47
 
yann@2149
    48
 /* XXX:  stpcpy, memccpy */