diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2011-07-07 10:14:02 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2011-07-07 10:14:02 +0000 |
commit | 891a2e42599a554e074f3c9e5fde54cce4795ed9 (patch) | |
tree | dabd723386297a21ecafc7c91d84abf760884544 /libmudflap/mf-runtime.c | |
parent | 8384ac41e6036d9055c6a1725546eced5d479ec8 (diff) | |
download | gcc-891a2e42599a554e074f3c9e5fde54cce4795ed9.zip gcc-891a2e42599a554e074f3c9e5fde54cce4795ed9.tar.gz gcc-891a2e42599a554e074f3c9e5fde54cce4795ed9.tar.bz2 |
re PR libmudflap/49550 (Many libmudflap tests fail on Solaris 11/x86)
gcc:
PR libmudflap/49550
* gcc.c (MFWRAP_SPEC): Also wrap mmap64.
libmudflap:
PR libmudflap/49550
* mf-runtime.c (__wrap_main) [__sun__ && __svr4__]: Don't register
stdin, stdout, stderr.
Register __ctype, __ctype_mask.
* configure.ac: Check for mmap64.
Check for rawmemchr, stpcpy, mempcpy.
* configure: Regenerate.
* config.h.in: Regenerate.
* mf-hooks1.c [HAVE_MMAP64] (__mf_0fn_mmap64): New function.
(mmap64): New wrapper function.
* mf-impl.h (__mf_dynamic_index) [HAVE_MMAP64]: Add dyn_mmap64.
* mf-runtime.c (__mf_dynamic) [HAVE_MMAP64]: Handle mmap64.
* mf-hooks2.c [HAVE_GETMNTENT && HAVE_SYS_MNTTAB_H]: Implement
getmntent wrapper.
* mf-hooks3.c (_REENTRANT): Define.
* testsuite/libmudflap.c/heap-scalestress.c (SCALE): Reduce to 10000.
* testsuite/libmudflap.c/pass-stratcliff.c: Include ../config.h.
(MIN): Define.
Use HAVE_RAWMEMCHR, HAVE_STPCPY, HAVE_MEMPCPY as guards.
* testsuite/libmudflap.c/pass47-frag.c: Expect __ctype warning on
*-*-solaris2.*.
From-SVN: r175961
Diffstat (limited to 'libmudflap/mf-runtime.c')
-rw-r--r-- | libmudflap/mf-runtime.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libmudflap/mf-runtime.c b/libmudflap/mf-runtime.c index 6892804..1036ccc 100644 --- a/libmudflap/mf-runtime.c +++ b/libmudflap/mf-runtime.c @@ -666,6 +666,9 @@ struct __mf_dynamic_entry __mf_dynamic [] = {NULL, "free", NULL}, {NULL, "malloc", NULL}, {NULL, "mmap", NULL}, +#ifdef HAVE_MMAP64 + {NULL, "mmap64", NULL}, +#endif {NULL, "munmap", NULL}, {NULL, "realloc", NULL}, {NULL, "DUMMY", NULL}, /* dyn_INITRESOLVE */ @@ -781,12 +784,22 @@ __wrap_main (int argc, char* argv[]) __mf_register (& errno, sizeof (errno), __MF_TYPE_STATIC, "errno area"); +#if !(defined(__sun__) && defined(__svr4__)) + /* Conflicts with the automatic registration of __iob[]. */ __mf_register (stdin, sizeof (*stdin), __MF_TYPE_STATIC, "stdin"); __mf_register (stdout, sizeof (*stdout), __MF_TYPE_STATIC, "stdout"); __mf_register (stderr, sizeof (*stderr), __MF_TYPE_STATIC, "stderr"); +#endif /* Make some effort to register ctype.h static arrays. */ - /* XXX: e.g., on Solaris, may need to register __ctype, _ctype, __ctype_mask, __toupper, etc. */ +#if defined(__sun__) && defined(__svr4__) + /* __ctype[] is declared without size, but MB_CUR_MAX is the last + member. There seems to be no proper way to determine the size. */ + __mf_register (__ctype, &MB_CUR_MAX - &__ctype[0] + 1, __MF_TYPE_STATIC, "__ctype"); + /* __ctype_mask points at _C_masks[1]. The size can only determined + using nm on libc.so.1. */ + __mf_register (__ctype_mask - 1, 1028, __MF_TYPE_STATIC, "_C_masks"); +#endif /* On modern Linux GLIBC, these are thread-specific and changeable, and are dealt with in mf-hooks2.c. */ } |