mirror of git://gcc.gnu.org/git/gcc.git
gc_ext_config.h.in: Added GC_PTHREAD_SYM_VERSION.
2006-02-06 Jakub Jelinek <jakub@redhat.com> Anthony Green <green@redhat.com> Tom Tromey <tromey@redhat.com> * include/gc_ext_config.h.in: Added GC_PTHREAD_SYM_VERSION. * include/gc_config.h.in: Rebuilt. * include/gc_pthread_redirects.h (pthread_create): Conditionally define. * pthread_support.c (pthread_create_): New global. (constr): New function. (pthread_create): Conditionally renamed. * configure: Rebuilt. * configure.ac (GC_PTHREAD_SYM_VERSION): Define. Co-Authored-By: Anthony Green <green@redhat.com> Co-Authored-By: Tom Tromey <tromey@redhat.com> From-SVN: r110682
This commit is contained in:
parent
003fe0b3e3
commit
5fd231d2c7
|
@ -1,3 +1,17 @@
|
||||||
|
2006-02-06 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
Anthony Green <green@redhat.com>
|
||||||
|
Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* include/gc_ext_config.h.in: Added GC_PTHREAD_SYM_VERSION.
|
||||||
|
* include/gc_config.h.in: Rebuilt.
|
||||||
|
* include/gc_pthread_redirects.h (pthread_create): Conditionally
|
||||||
|
define.
|
||||||
|
* pthread_support.c (pthread_create_): New global.
|
||||||
|
(constr): New function.
|
||||||
|
(pthread_create): Conditionally renamed.
|
||||||
|
* configure: Rebuilt.
|
||||||
|
* configure.ac (GC_PTHREAD_SYM_VERSION): Define.
|
||||||
|
|
||||||
2006-02-04 Alan Modra <amodra@bigpond.net.au>
|
2006-02-04 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* include/private/gc_locks.h (GC_test_and_set <POWERPC>): Don't
|
* include/private/gc_locks.h (GC_test_and_set <POWERPC>): Don't
|
||||||
|
|
|
@ -6627,6 +6627,29 @@ _ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
symver=
|
||||||
|
case "$target" in
|
||||||
|
*-*-linux* )
|
||||||
|
cat > conftest.c <<EOF
|
||||||
|
#include <pthread.h>
|
||||||
|
void *tf (void *arg) { (void) arg; return NULL; }
|
||||||
|
int main (void) { pthread_t th; pthread_create (&th, NULL, tf, NULL); return 0; }
|
||||||
|
EOF
|
||||||
|
if $CC $CFLAGS -pthread -o conftest conftest.c > /dev/null 2>&1; then
|
||||||
|
symver=`readelf -s conftest 2> /dev/null | sed -n '/UND pthread_create@/{s/^.*@//;s/ .*$//;p;q}'`
|
||||||
|
fi
|
||||||
|
rm -f conftest conftest.c
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if test -n "$symver"; then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define GC_PTHREAD_SYM_VERSION "$symver"
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if test -n "$with_cross_host" &&
|
if test -n "$with_cross_host" &&
|
||||||
test x"$with_cross_host" != x"no"; then
|
test x"$with_cross_host" != x"no"; then
|
||||||
toolexecdir='$(exec_prefix)/$(target_noncanonical)'
|
toolexecdir='$(exec_prefix)/$(target_noncanonical)'
|
||||||
|
|
|
@ -450,6 +450,25 @@ if test "${gc_use_mmap}" = "yes"; then
|
||||||
AC_DEFINE(USE_MMAP, 1, [use MMAP instead of sbrk to get new memory])
|
AC_DEFINE(USE_MMAP, 1, [use MMAP instead of sbrk to get new memory])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
symver=
|
||||||
|
case "$target" in
|
||||||
|
*-*-linux* )
|
||||||
|
cat > conftest.c <<EOF
|
||||||
|
#include <pthread.h>
|
||||||
|
void *tf (void *arg) { (void) arg; return NULL; }
|
||||||
|
int main (void) { pthread_t th; pthread_create (&th, NULL, tf, NULL); return 0; }
|
||||||
|
EOF
|
||||||
|
if $CC $CFLAGS -pthread -o conftest conftest.c > /dev/null 2>&1; then
|
||||||
|
symver=`readelf -s conftest 2> /dev/null | sed -n '/UND pthread_create@/{s/^.*@//;s/ .*$//;p;q}'`
|
||||||
|
fi
|
||||||
|
rm -f conftest conftest.c
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if test -n "$symver"; then
|
||||||
|
AC_DEFINE_UNQUOTED(GC_PTHREAD_SYM_VERSION, "$symver", [symbol version of pthread_create])
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if test -n "$with_cross_host" &&
|
if test -n "$with_cross_host" &&
|
||||||
test x"$with_cross_host" != x"no"; then
|
test x"$with_cross_host" != x"no"; then
|
||||||
toolexecdir='$(exec_prefix)/$(target_noncanonical)'
|
toolexecdir='$(exec_prefix)/$(target_noncanonical)'
|
||||||
|
|
|
@ -45,6 +45,9 @@
|
||||||
/* support for Tru64 pthreads */
|
/* support for Tru64 pthreads */
|
||||||
#undef GC_OSF1_THREADS
|
#undef GC_OSF1_THREADS
|
||||||
|
|
||||||
|
/* symbol version of pthread_create */
|
||||||
|
#undef GC_PTHREAD_SYM_VERSION
|
||||||
|
|
||||||
/* support for Solaris pthreads */
|
/* support for Solaris pthreads */
|
||||||
#undef GC_SOLARIS_PTHREADS
|
#undef GC_SOLARIS_PTHREADS
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,5 @@ external clients that do not want to include the full gc.h. Currently this
|
||||||
is used by libjava/include/boehm-gc.h. */
|
is used by libjava/include/boehm-gc.h. */
|
||||||
|
|
||||||
#undef THREAD_LOCAL_ALLOC
|
#undef THREAD_LOCAL_ALLOC
|
||||||
|
|
||||||
|
#undef GC_PTHREAD_SYM_VERSION
|
||||||
|
|
|
@ -68,7 +68,9 @@
|
||||||
# undef pthread_detach
|
# undef pthread_detach
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef GC_PTHREAD_SYM_VERSION
|
||||||
# define pthread_create GC_pthread_create
|
# define pthread_create GC_pthread_create
|
||||||
|
#endif
|
||||||
# define pthread_join GC_pthread_join
|
# define pthread_join GC_pthread_join
|
||||||
# define pthread_detach GC_pthread_detach
|
# define pthread_detach GC_pthread_detach
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,9 @@
|
||||||
/*#define DEBUG_THREADS 1*/
|
/*#define DEBUG_THREADS 1*/
|
||||||
/*#define GC_ASSERTIONS*/
|
/*#define GC_ASSERTIONS*/
|
||||||
|
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
#include <dlfcn.h>
|
||||||
|
|
||||||
# include "gc.h"
|
# include "gc.h"
|
||||||
# include "private/pthread_support.h"
|
# include "private/pthread_support.h"
|
||||||
|
|
||||||
|
@ -1193,8 +1196,37 @@ void * GC_start_routine(void * arg)
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GC_PTHREAD_SYM_VERSION
|
||||||
|
|
||||||
|
/* Force constr to execute prior to main(). */
|
||||||
|
static void constr (void) __attribute__ ((constructor));
|
||||||
|
|
||||||
|
static int
|
||||||
|
(*pthread_create_)(pthread_t *new_thread,
|
||||||
|
const pthread_attr_t *attr_in,
|
||||||
|
void * (*thread_execp)(void *), void *arg);
|
||||||
|
|
||||||
|
static void
|
||||||
|
constr (void)
|
||||||
|
{
|
||||||
|
/* Get a pointer to the real pthread_create. */
|
||||||
|
pthread_create_ = dlvsym (RTLD_NEXT, "pthread_create",
|
||||||
|
GC_PTHREAD_SYM_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define GC_PTHREAD_CREATE_NAME pthread_create
|
||||||
|
#define GC_PTHREAD_REAL_NAME (*pthread_create_)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define GC_PTHREAD_CREATE_NAME WRAP_FUNC(pthread_create)
|
||||||
|
#define GC_PTHREAD_REAL_NAME REAL_FUNC(pthread_create)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
WRAP_FUNC(pthread_create)(pthread_t *new_thread,
|
GC_PTHREAD_CREATE_NAME(pthread_t *new_thread,
|
||||||
const pthread_attr_t *attr,
|
const pthread_attr_t *attr,
|
||||||
void *(*start_routine)(void *), void *arg)
|
void *(*start_routine)(void *), void *arg)
|
||||||
{
|
{
|
||||||
|
@ -1255,7 +1287,7 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread,
|
||||||
pthread_self());
|
pthread_self());
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
result = REAL_FUNC(pthread_create)(new_thread, attr, GC_start_routine, si);
|
result = GC_PTHREAD_REAL_NAME(new_thread, attr, GC_start_routine, si);
|
||||||
|
|
||||||
# ifdef DEBUG_THREADS
|
# ifdef DEBUG_THREADS
|
||||||
GC_printf1("Started thread 0x%X\n", *new_thread);
|
GC_printf1("Started thread 0x%X\n", *new_thread);
|
||||||
|
|
Loading…
Reference in New Issue