2004-05-13 08:41:07 +02:00
|
|
|
# Process this file with autoconf to produce a configure script, like so:
|
2006-06-21 18:35:27 +02:00
|
|
|
# aclocal -I .. -I ../config && autoconf && autoheader && automake
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-06-15 16:47:55 +02:00
|
|
|
AC_PREREQ(2.59)
|
|
|
|
AC_INIT(libmudflap, 1.0)
|
|
|
|
AC_CONFIG_SRCDIR(mf-runtime.c)
|
2004-05-13 08:41:07 +02:00
|
|
|
AC_CANONICAL_SYSTEM
|
2006-06-21 18:35:27 +02:00
|
|
|
ACX_NONCANONICAL_TARGET
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-06-15 16:47:55 +02:00
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
|
2004-06-01 07:21:07 +02:00
|
|
|
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
|
|
|
|
AC_ARG_ENABLE(version-specific-runtime-libs,
|
|
|
|
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
|
|
|
|
[case "$enableval" in
|
|
|
|
yes) version_specific_libs=yes ;;
|
|
|
|
no) version_specific_libs=no ;;
|
|
|
|
*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
|
|
|
|
esac],
|
|
|
|
[version_specific_libs=no])
|
|
|
|
AC_MSG_RESULT($version_specific_libs)
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
AC_EXEEXT
|
|
|
|
|
2004-06-01 07:21:07 +02:00
|
|
|
AM_ENABLE_MULTILIB(, ..)
|
|
|
|
|
2004-11-01 22:27:26 +01:00
|
|
|
target_alias=${target_alias-$host_alias}
|
2004-05-13 08:41:07 +02:00
|
|
|
AC_SUBST(target_alias)
|
|
|
|
|
2004-06-15 16:47:55 +02:00
|
|
|
AC_CONFIG_HEADERS(config.h)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
AC_LANG_C
|
2004-06-01 07:21:07 +02:00
|
|
|
# The same as in boehm-gc and libstdc++. Have to borrow it from there.
|
|
|
|
# We must force CC to /not/ be precious variables; otherwise
|
|
|
|
# the wrong, non-multilib-adjusted value will be used in multilibs.
|
|
|
|
# As a side effect, we have to subst CFLAGS ourselves.
|
|
|
|
|
|
|
|
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
|
|
|
|
m4_define([_AC_ARG_VAR_PRECIOUS],[])
|
2004-05-13 08:41:07 +02:00
|
|
|
AC_PROG_CC
|
2004-06-01 07:21:07 +02:00
|
|
|
m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
|
|
|
|
|
|
|
AC_SUBST(CFLAGS)
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
if test "x$GCC" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libmudflap must be built with GCC])
|
|
|
|
fi
|
|
|
|
AC_PROG_CPP
|
|
|
|
|
|
|
|
# Some hosts don't have dlsym(RTLD_NEXT, "symbol") for use in
|
|
|
|
# symbol interposition. We disable shared libraries for these.
|
|
|
|
AC_MSG_CHECKING([whether dlsym(RTLD_NEXT,...) is available])
|
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
#include <dlfcn.h>
|
|
|
|
],
|
|
|
|
[void *foo = dlsym (RTLD_NEXT, "exit");],
|
|
|
|
[AC_MSG_RESULT(yes)],
|
|
|
|
[AC_MSG_RESULT(no)
|
|
|
|
enable_shared=no])
|
|
|
|
|
configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
2004-09-07 Frank Ch. Eigler <fche@redhat.com>
* configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
* mf-hooks2.c (strerror): Unregister previous string returned by
previous strerror.
(getlogin,cuserid,getpwnam,getpwuid,getgrnam,getgrgid): New wrappers.
(getservent,getservbyname,getservbyport,gai_strerror): Ditto.
* mf-runtime.h.in: Add redefine_extname pragmas for them all.
* mf-runtime.c (__mf_describe_object): Clarify object life status.
* testsuite/libmudflap.c/pass48-frag.c, pass49-frag.c, fail32-frag.c:
New tests.
* configure, config.h.in: Regenerated.
From-SVN: r87160
2004-09-07 23:52:52 +02:00
|
|
|
AC_CHECK_HEADERS(stdint.h execinfo.h signal.h dlfcn.h dirent.h pwd.h grp.h \
|
2004-10-05 18:15:55 +02:00
|
|
|
netdb.h sys/ipc.h sys/sem.h sys/shm.h sys/wait.h ctype.h mntent.h \
|
configure.ac: Check for more headers, functions.
2004-10-12 Frank Ch. Eigler <fche@redhat.com>
* configure.ac: Check for more headers, functions.
* mf-hooks2.c (mkbuffer, unmkbuffer): New helper functions for
tracking overridden FILE buffers.
(fopen, setvbuf): New/revised hook functions for buffer overriding.
(setbuf,setlinebuf,fdopen,freopen,fopen64,freopen64,fclose): Ditto.
(fflush): Accept given NULL stream (means "all streams").
* mf-runtime.h.in:
* mf-runtime.c (__mfu_check): Accept accesses that span adjacent
HEAP/GUESS objects.
(LOOKUP_CACHE_SIZE_MAX): Raise to 64K entries tentatively.
(__mf_adapt_cache): Use them all.
* testsuite/libmudflap.c/pass35-frag.c: Update warning message.
* testsuite/libmudflap.c++/ctors.exp: Ditto.
* testsuite/libmudflap.c/{pass51,pass52}-frag.c: New tests.
* configure, config.h.in: Regenerated.
From-SVN: r88996
2004-10-13 20:27:16 +02:00
|
|
|
sys/socket.h netinet/in.h arpa/inet.h dlfcn.h sys/mman.h)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-10-04 19:33:54 +02:00
|
|
|
AC_CHECK_FUNCS(backtrace backtrace_symbols gettimeofday signal)
|
configure.ac: Check for more headers, functions.
2004-10-12 Frank Ch. Eigler <fche@redhat.com>
* configure.ac: Check for more headers, functions.
* mf-hooks2.c (mkbuffer, unmkbuffer): New helper functions for
tracking overridden FILE buffers.
(fopen, setvbuf): New/revised hook functions for buffer overriding.
(setbuf,setlinebuf,fdopen,freopen,fopen64,freopen64,fclose): Ditto.
(fflush): Accept given NULL stream (means "all streams").
* mf-runtime.h.in:
* mf-runtime.c (__mfu_check): Accept accesses that span adjacent
HEAP/GUESS objects.
(LOOKUP_CACHE_SIZE_MAX): Raise to 64K entries tentatively.
(__mf_adapt_cache): Use them all.
* testsuite/libmudflap.c/pass35-frag.c: Update warning message.
* testsuite/libmudflap.c++/ctors.exp: Ditto.
* testsuite/libmudflap.c/{pass51,pass52}-frag.c: New tests.
* configure, config.h.in: Regenerated.
From-SVN: r88996
2004-10-13 20:27:16 +02:00
|
|
|
AC_CHECK_FUNCS(fopen64 fseeko64 ftello64 stat64 freopen64)
|
|
|
|
AC_CHECK_FUNCS(setbuf setbuffer setlinebuf setvbuf)
|
2004-06-04 22:12:01 +02:00
|
|
|
AC_CHECK_FUNCS(strnlen memrchr strncpy memmem sethostname)
|
2004-06-09 21:04:56 +02:00
|
|
|
AC_CHECK_FUNCS(__ctype_b_loc __ctype_tolower_loc __ctype_toupper_loc)
|
configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
2004-09-07 Frank Ch. Eigler <fche@redhat.com>
* configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
* mf-hooks2.c (strerror): Unregister previous string returned by
previous strerror.
(getlogin,cuserid,getpwnam,getpwuid,getgrnam,getgrgid): New wrappers.
(getservent,getservbyname,getservbyport,gai_strerror): Ditto.
* mf-runtime.h.in: Add redefine_extname pragmas for them all.
* mf-runtime.c (__mf_describe_object): Clarify object life status.
* testsuite/libmudflap.c/pass48-frag.c, pass49-frag.c, fail32-frag.c:
New tests.
* configure, config.h.in: Regenerated.
From-SVN: r87160
2004-09-07 23:52:52 +02:00
|
|
|
AC_CHECK_FUNCS(getlogin cuserid getpwnam getpwuid getpwent getgrnam getgrgid getgrent)
|
|
|
|
AC_CHECK_FUNCS(getlogin_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r)
|
|
|
|
AC_CHECK_FUNCS(getservent getservbyname getservbyport getaddrinfo gai_strerror)
|
2004-10-04 19:33:54 +02:00
|
|
|
AC_CHECK_FUNCS(getprotoent getprotobyname getprotobynumber)
|
|
|
|
AC_CHECK_FUNCS(getmntent setmntent addmntent)
|
configure.ac: Check for more headers, functions.
2004-10-12 Frank Ch. Eigler <fche@redhat.com>
* configure.ac: Check for more headers, functions.
* mf-hooks2.c (mkbuffer, unmkbuffer): New helper functions for
tracking overridden FILE buffers.
(fopen, setvbuf): New/revised hook functions for buffer overriding.
(setbuf,setlinebuf,fdopen,freopen,fopen64,freopen64,fclose): Ditto.
(fflush): Accept given NULL stream (means "all streams").
* mf-runtime.h.in:
* mf-runtime.c (__mfu_check): Accept accesses that span adjacent
HEAP/GUESS objects.
(LOOKUP_CACHE_SIZE_MAX): Raise to 64K entries tentatively.
(__mf_adapt_cache): Use them all.
* testsuite/libmudflap.c/pass35-frag.c: Update warning message.
* testsuite/libmudflap.c++/ctors.exp: Ditto.
* testsuite/libmudflap.c/{pass51,pass52}-frag.c: New tests.
* configure, config.h.in: Regenerated.
From-SVN: r88996
2004-10-13 20:27:16 +02:00
|
|
|
AC_CHECK_FUNCS(inet_ntoa mmap munmap)
|
2006-11-06 19:02:13 +01:00
|
|
|
AC_CHECK_FUNCS(__libc_freeres)
|
configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
2004-09-07 Frank Ch. Eigler <fche@redhat.com>
* configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
* mf-hooks2.c (strerror): Unregister previous string returned by
previous strerror.
(getlogin,cuserid,getpwnam,getpwuid,getgrnam,getgrgid): New wrappers.
(getservent,getservbyname,getservbyport,gai_strerror): Ditto.
* mf-runtime.h.in: Add redefine_extname pragmas for them all.
* mf-runtime.c (__mf_describe_object): Clarify object life status.
* testsuite/libmudflap.c/pass48-frag.c, pass49-frag.c, fail32-frag.c:
New tests.
* configure, config.h.in: Regenerated.
From-SVN: r87160
2004-09-07 23:52:52 +02:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
AC_TRY_COMPILE([#include <sys/types.h>
|
|
|
|
#include <sys/ipc.h>
|
|
|
|
#include <sys/sem.h>],[union semun foo;], [mf_have_semun=1], [mf_have_semun=0])
|
|
|
|
if test $mf_have_semun = 1
|
|
|
|
then
|
|
|
|
AC_DEFINE(HAVE_UNION_SEMUN, 1, [union semun defined in sys/ipc.h or sys/sem.h])
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for socklen_t in sys/socket.h])
|
|
|
|
AC_TRY_COMPILE([#define _POSIX_PII_SOCKET
|
2004-06-01 07:21:07 +02:00
|
|
|
#include <sys/types.h>
|
2004-05-13 08:41:07 +02:00
|
|
|
#include <sys/socket.h>], [socklen_t x = 5;],
|
|
|
|
[AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define it socklen_t typedef is in sys/socket.h.])
|
|
|
|
AC_MSG_RESULT(yes)],
|
|
|
|
[AC_MSG_RESULT(no)])
|
|
|
|
|
|
|
|
AC_LIBTOOL_DLOPEN
|
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
AC_SUBST(enable_shared)
|
|
|
|
AC_SUBST(enable_static)
|
|
|
|
|
|
|
|
AC_CHECK_HEADER(stdint.h, [MF_HAVE_STDINT_H=1], [MF_HAVE_STDINT_H=0])
|
|
|
|
AC_SUBST(MF_HAVE_STDINT_H)
|
|
|
|
if test $MF_HAVE_STDINT_H = 1
|
|
|
|
then
|
|
|
|
MF_HAVE_UINTPTR_T=1
|
|
|
|
else
|
|
|
|
AC_TRY_COMPILE([#include <sys/types.h>], [uintptr_t k = 0;],
|
2004-06-01 07:21:07 +02:00
|
|
|
[MF_HAVE_UINTPTR_T=1], [MF_HAVE_UINTPTR_T=0])
|
2004-05-13 08:41:07 +02:00
|
|
|
fi
|
|
|
|
AC_SUBST(MF_HAVE_UINTPTR_T)
|
|
|
|
|
|
|
|
if test ! -d pth
|
|
|
|
then
|
|
|
|
# libmudflapth objects are built in this subdirectory
|
|
|
|
mkdir pth
|
|
|
|
fi
|
|
|
|
|
2005-10-01 01:13:06 +02:00
|
|
|
AC_CHECK_HEADERS(pthread.h)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for thread model used by GCC])
|
|
|
|
target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
|
|
|
|
AC_MSG_RESULT([$target_thread_file])
|
|
|
|
|
|
|
|
# We only support posix threads, or no threads at all.
|
|
|
|
posix_threads=
|
|
|
|
case ${target_thread_file} in
|
|
|
|
posix)
|
|
|
|
posix_threads=yes
|
|
|
|
;;
|
|
|
|
single)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "${target_thread_file} is an unsupported thread package" 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AM_CONDITIONAL(LIBMUDFLAPTH, [test "x$posix_threads" != "x"])
|
|
|
|
if test "x$posix_threads" != "x"
|
2004-06-04 22:12:01 +02:00
|
|
|
then
|
|
|
|
build_libmudflapth=1
|
|
|
|
else
|
|
|
|
build_libmudflapth=0
|
|
|
|
fi
|
|
|
|
AC_SUBST(build_libmudflapth)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
AC_CHECK_LIB(dl, dlsym)
|
|
|
|
|
2004-06-01 07:21:07 +02:00
|
|
|
# Calculate toolexeclibdir
|
|
|
|
# Also toolexecdir, though it's only used in toolexeclibdir
|
|
|
|
case ${version_specific_libs} in
|
|
|
|
yes)
|
|
|
|
# Need the gcc compiler version to know where to install libraries
|
|
|
|
# and header files if --enable-version-specific-runtime-libs option
|
|
|
|
# is selected.
|
|
|
|
toolexecdir='$(libdir)/gcc/$(target_alias)'
|
2005-03-21 18:44:38 +01:00
|
|
|
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
|
2004-06-01 07:21:07 +02:00
|
|
|
;;
|
|
|
|
no)
|
|
|
|
if test -n "$with_cross_host" &&
|
|
|
|
test x"$with_cross_host" != x"no"; then
|
|
|
|
# Install a library built with a cross compiler in tooldir, not libdir.
|
|
|
|
toolexecdir='$(exec_prefix)/$(target_alias)'
|
|
|
|
toolexeclibdir='$(toolexecdir)/lib'
|
|
|
|
else
|
|
|
|
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
|
|
|
toolexeclibdir='$(libdir)'
|
|
|
|
fi
|
|
|
|
multi_os_directory=`$CC -print-multi-os-directory`
|
|
|
|
case $multi_os_directory in
|
|
|
|
.) ;; # Avoid trailing /.
|
|
|
|
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SUBST(toolexecdir)
|
|
|
|
AC_SUBST(toolexeclibdir)
|
|
|
|
|
2006-06-21 18:35:27 +02:00
|
|
|
includedir=${toolexecdir}/include
|
|
|
|
AC_SUBST(includedir)
|
|
|
|
|
2005-10-01 01:13:06 +02:00
|
|
|
pthread_create_version='""'
|
|
|
|
if test "x$enable_shared" = "xyes" && test "x$posix_threads" != "x"; then
|
2004-05-13 08:41:07 +02:00
|
|
|
# NB: don't check for -lpthread here, because then it would be
|
|
|
|
# added to LIBS. For the thread-unaware libmudflap.la, we don't
|
|
|
|
# want it there.
|
|
|
|
|
|
|
|
# glibc-related hacks. dlsym() may pick the wrong version of
|
|
|
|
# interposed functions like pthread_create on modern glibc.
|
|
|
|
# We need to find the proper symbol version string, and use
|
|
|
|
# the nonstandard dlvsym().
|
|
|
|
AC_CHECK_FUNCS(dlvsym)
|
|
|
|
AC_CHECK_TOOL(NM, nm)
|
2004-06-04 22:12:01 +02:00
|
|
|
if test "x$ac_cv_have_dlvsym" != "x"; then
|
2004-05-13 08:41:07 +02:00
|
|
|
# Try compiling a simple pthreads program. Find the shared libraries it
|
|
|
|
# ends up with. Then use "nm" on those libraries to extract the
|
|
|
|
# default symbol versioning suffix ("@@"), if any. But that's tricky.
|
|
|
|
# Rather, run nm on the resulting executable. Unfortunately, autoconf
|
|
|
|
# doesn't appear to have a macro that builds a test executable for
|
2004-06-01 07:21:07 +02:00
|
|
|
# subsequent analysis ... so we do it by hand here.
|
2004-05-13 08:41:07 +02:00
|
|
|
cat >> conftest.c << EOF
|
|
|
|
#include <pthread.h>
|
|
|
|
int main () { void *p = (void *) & pthread_create; return (int) p; }
|
|
|
|
EOF
|
|
|
|
oldLIBS="$LIBS"
|
|
|
|
LIBS="$LIBS -lpthread"
|
|
|
|
pthread_create_version="\"\""
|
|
|
|
AC_MSG_CHECKING(pthread_create symbol version)
|
|
|
|
if eval $ac_link 2>&5 && test -s conftest${ac_exeext}; then
|
|
|
|
version=`$NM conftest${ac_exeect} | grep 'pthread_create@@' | sed -e 's/^.*@@//'`
|
|
|
|
if test "x$version" != "x"; then
|
|
|
|
pthread_create_version="\"$version\""
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT($pthread_create_version)
|
|
|
|
LIBS="$oldLIBS"
|
|
|
|
fi
|
|
|
|
fi
|
2004-06-01 07:21:07 +02:00
|
|
|
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_VERSION, $pthread_create_version, [pthread_create symbol version])
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-06-04 22:12:01 +02:00
|
|
|
|
|
|
|
# Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
|
|
|
|
# similarly to how libstdc++ does it
|
|
|
|
ac_test_CFLAGS="${CFLAGS+set}"
|
|
|
|
ac_save_CFLAGS="$CFLAGS"
|
|
|
|
|
|
|
|
# Check for -ffunction-sections -fdata-sections
|
|
|
|
AC_MSG_CHECKING([for gcc that supports -ffunction-sections -fdata-sections])
|
|
|
|
CFLAGS='-Werror -ffunction-sections -fdata-sections'
|
|
|
|
AC_TRY_COMPILE(, [int foo;], [ac_fdsections=yes], [ac_fdsections=no])
|
|
|
|
if test "$ac_test_CFLAGS" = set; then
|
|
|
|
CFLAGS="$ac_save_CFLAGS"
|
|
|
|
else
|
|
|
|
# this is the suspicious part
|
|
|
|
CFLAGS=""
|
|
|
|
fi
|
|
|
|
if test x"$ac_fdsections" = x"yes"; then
|
|
|
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT($ac_fdsections)
|
|
|
|
AC_SUBST(SECTION_FLAGS)
|
|
|
|
|
|
|
|
|
2005-08-15 18:15:16 +02:00
|
|
|
# Check for the name of the symbol used for the entry point.
|
|
|
|
AC_CACHE_CHECK([for the name of the symbol used for the entry point],
|
|
|
|
[mudflap_cv_entry_point], [
|
|
|
|
for name in _start __start unknown; do
|
2005-10-05 01:54:38 +02:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char $name@<:@@:>@;], [$name@<:@0@:>@ = 0;])],
|
2005-08-15 18:15:16 +02:00
|
|
|
[break])
|
|
|
|
done
|
|
|
|
mudflap_cv_entry_point="$name"])
|
|
|
|
if test "$mudflap_cv_entry_point" = unknown; then
|
|
|
|
AC_MSG_ERROR([none of the known symbol names works])
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED([ENTRY_POINT], [$mudflap_cv_entry_point],
|
|
|
|
[Define to the name of the symbol used for the entry point.])
|
|
|
|
|
|
|
|
|
2004-06-01 07:21:07 +02:00
|
|
|
if test ${multilib} = yes; then
|
|
|
|
multilib_arg="--enable-multilib"
|
|
|
|
else
|
|
|
|
multilib_arg=
|
|
|
|
fi
|
2004-05-13 08:41:07 +02:00
|
|
|
|
gcc.c (MFWRAP_SPEC): Don't wrap pthread_join or pthread_exit.
* gcc.c (MFWRAP_SPEC): Don't wrap pthread_join or pthread_exit.
* acinclude.m4: New file.
* configure.ac: Invoke LIBMUDFLAP_CHECK_TLS.
* configure, config.h.in, Makefile.in, testsuite/Makefile.in: Rebuild.
* mf-hooks1.c (__mf_0fn_malloc): Move body from ...
(__mf_0fn_calloc): ... here.
* mf-hooks3.c (struct pthread_info): Remove.
(__mf_pthread_info, __mf_pthread_info_idx): Remove.
(LIBMUDFLAPTH_THREADS_MAX): Set to 1021.
(struct mf_thread_data): New.
(mf_thread_data, mf_thread_data_lock): New.
(__mf_allocate_blank_threadinfo): Remove.
(__mf_find_threadinfo): Rewrite and simplify. Only use if TLS is
not available.
(__mf_state_perthread): Remove.
(__mf_get_state, __mf_set_state): New.
(__mf_pthread_cleanup): Use &errno, rather than saved pointer.
Update mf_thread_data killing procedure.
(__mf_pthread_spawner): Similarly.
(__mf_0fn_pthread_create): Only use wrapper if necessary. Remove
code to allocate thread stack space.
(__mf_0fn_pthread_join, pthread_join): Remove.
(__mf_0fn_pthread_exit, pthread_exit): Remove.
* mf-impl.h (dyn_pthread_join, dyn_pthread_exit): Remove.
(__mf_state_1): Rename from __mf_state; use TLS when available.
(__mf_get_state, __mf_set_state): New. Update all users.
* mf-runtime.c (begin_recursion_protect1): New.
(BEGIN_RECURSION_PROTECT): Use it.
(__mf_state_1): Rename from __mf_state; use TLS when available.
(threads_active_p): Remove.
(__mf_usage): Compute it directly.
From-SVN: r102108
2005-07-17 04:29:00 +02:00
|
|
|
# See if we support thread-local storage.
|
2005-09-23 18:33:47 +02:00
|
|
|
GCC_CHECK_TLS
|
2009-01-23 05:58:03 +01:00
|
|
|
GCC_CHECK_EMUTLS
|
gcc.c (MFWRAP_SPEC): Don't wrap pthread_join or pthread_exit.
* gcc.c (MFWRAP_SPEC): Don't wrap pthread_join or pthread_exit.
* acinclude.m4: New file.
* configure.ac: Invoke LIBMUDFLAP_CHECK_TLS.
* configure, config.h.in, Makefile.in, testsuite/Makefile.in: Rebuild.
* mf-hooks1.c (__mf_0fn_malloc): Move body from ...
(__mf_0fn_calloc): ... here.
* mf-hooks3.c (struct pthread_info): Remove.
(__mf_pthread_info, __mf_pthread_info_idx): Remove.
(LIBMUDFLAPTH_THREADS_MAX): Set to 1021.
(struct mf_thread_data): New.
(mf_thread_data, mf_thread_data_lock): New.
(__mf_allocate_blank_threadinfo): Remove.
(__mf_find_threadinfo): Rewrite and simplify. Only use if TLS is
not available.
(__mf_state_perthread): Remove.
(__mf_get_state, __mf_set_state): New.
(__mf_pthread_cleanup): Use &errno, rather than saved pointer.
Update mf_thread_data killing procedure.
(__mf_pthread_spawner): Similarly.
(__mf_0fn_pthread_create): Only use wrapper if necessary. Remove
code to allocate thread stack space.
(__mf_0fn_pthread_join, pthread_join): Remove.
(__mf_0fn_pthread_exit, pthread_exit): Remove.
* mf-impl.h (dyn_pthread_join, dyn_pthread_exit): Remove.
(__mf_state_1): Rename from __mf_state; use TLS when available.
(__mf_get_state, __mf_set_state): New. Update all users.
* mf-runtime.c (begin_recursion_protect1): New.
(BEGIN_RECURSION_PROTECT): Use it.
(__mf_state_1): Rename from __mf_state; use TLS when available.
(threads_active_p): Remove.
(__mf_usage): Compute it directly.
From-SVN: r102108
2005-07-17 04:29:00 +02:00
|
|
|
|
2005-01-02 23:24:50 +01:00
|
|
|
AC_CONFIG_FILES([Makefile testsuite/Makefile testsuite/mfconfig.exp])
|
2004-06-15 16:47:55 +02:00
|
|
|
AC_OUTPUT
|