aboutsummaryrefslogtreecommitdiff
path: root/libmudflap/mf-runtime.c
diff options
context:
space:
mode:
authorLoren J. Rittle <ljrittle@acm.org>2009-09-01 18:13:18 +0000
committerLoren J. Rittle <ljrittle@gcc.gnu.org>2009-09-01 18:13:18 +0000
commitf05816a5eedc0f19dc2f601918e7858d8182d504 (patch)
tree8209ef794f609d9633cb0454279034f2a39a2e45 /libmudflap/mf-runtime.c
parentab4daaf234846814efda577812e8e42be5a40995 (diff)
downloadgcc-f05816a5eedc0f19dc2f601918e7858d8182d504.zip
gcc-f05816a5eedc0f19dc2f601918e7858d8182d504.tar.gz
gcc-f05816a5eedc0f19dc2f601918e7858d8182d504.tar.bz2
mf-runtime.c (__mf_init): Support FreeBSD.
2009-09-01 Loren J. Rittle <ljrittle@acm.org> * mf-runtime.c (__mf_init): Support FreeBSD. Prime mutex which calls calloc upon first lock to avoid deadlock. * mf-hooks1.c (__mf_0fn_mmap): Support FreeBSD. Ignore red zone allocation request for initial thread's stack. From-SVN: r151278
Diffstat (limited to 'libmudflap/mf-runtime.c')
-rw-r--r--libmudflap/mf-runtime.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libmudflap/mf-runtime.c b/libmudflap/mf-runtime.c
index 46e7e2f..3bfaf02 100644
--- a/libmudflap/mf-runtime.c
+++ b/libmudflap/mf-runtime.c
@@ -695,6 +695,12 @@ __mf_init ()
if (LIKELY (__mf_starting_p == 0))
return;
+#if defined(__FreeBSD__) && defined(LIBMUDFLAPTH)
+ pthread_self();
+ LOCKTH ();
+ UNLOCKTH ();
+#endif /* Prime mutex which calls calloc upon first lock to avoid deadlock. */
+
/* This initial bootstrap phase requires that __mf_starting_p = 1. */
#ifdef PIC
__mf_resolve_dynamics ();