mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
ab4daaf234
commit
f05816a5ee
|
|
@ -1,3 +1,10 @@
|
||||||
|
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.
|
||||||
|
|
||||||
2009-09-01 Loren J. Rittle <ljrittle@acm.org>
|
2009-09-01 Loren J. Rittle <ljrittle@acm.org>
|
||||||
Andreas Schwab <schwab@linux-m68k.org>
|
Andreas Schwab <schwab@linux-m68k.org>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -321,6 +321,11 @@ WRAPPER(void, free, void *buf)
|
||||||
void *
|
void *
|
||||||
__mf_0fn_mmap (void *start, size_t l, int prot, int f, int fd, off_t off)
|
__mf_0fn_mmap (void *start, size_t l, int prot, int f, int fd, off_t off)
|
||||||
{
|
{
|
||||||
|
#if defined(__FreeBSD__)
|
||||||
|
if (f == 0x1000 && fd == -1 && prot == 0 && off == 0)
|
||||||
|
return 0;
|
||||||
|
#endif /* Ignore red zone allocation request for initial thread's stack. */
|
||||||
|
|
||||||
return (void *) -1;
|
return (void *) -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -695,6 +695,12 @@ __mf_init ()
|
||||||
if (LIKELY (__mf_starting_p == 0))
|
if (LIKELY (__mf_starting_p == 0))
|
||||||
return;
|
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. */
|
/* This initial bootstrap phase requires that __mf_starting_p = 1. */
|
||||||
#ifdef PIC
|
#ifdef PIC
|
||||||
__mf_resolve_dynamics ();
|
__mf_resolve_dynamics ();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue