aboutsummaryrefslogtreecommitdiff
path: root/libmudflap/configure
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-07-16 19:29:00 -0700
committerRichard Henderson <rth@gcc.gnu.org>2005-07-16 19:29:00 -0700
commit7544a87f135c194395e525c7ca6123f4fd9f51ea (patch)
tree7eb9ea11806846cc5d60256f51b3b0a1033126fe /libmudflap/configure
parentf8820d33eba7e777142fbb8cb0772cc9dc0fe7c2 (diff)
downloadgcc-7544a87f135c194395e525c7ca6123f4fd9f51ea.zip
gcc-7544a87f135c194395e525c7ca6123f4fd9f51ea.tar.gz
gcc-7544a87f135c194395e525c7ca6123f4fd9f51ea.tar.bz2
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
Diffstat (limited to 'libmudflap/configure')
-rwxr-xr-xlibmudflap/configure133
1 files changed, 132 insertions, 1 deletions
diff --git a/libmudflap/configure b/libmudflap/configure
index ab7d227..03b3be5 100755
--- a/libmudflap/configure
+++ b/libmudflap/configure
@@ -850,6 +850,8 @@ Optional Features:
--enable-static=PKGS build static libraries default=yes
--enable-fast-install=PKGS optimize for fast installation default=yes
--disable-libtool-lock avoid locking (might break parallel builds)
+ _g_switchUse thread-local storage
+ [default=yes]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -5831,7 +5833,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 5834 "configure"' > conftest.$ac_ext
+ echo '#line 5836 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -6898,6 +6900,135 @@ else
multilib_arg=
fi
+# See if we support thread-local storage.
+
+ # Check whether --enable-tls or --disable-tls was given.
+if test "${enable_tls+set}" = set; then
+ enableval="$enable_tls"
+
+ case "$enableval" in
+ yes|no) ;;
+ *) { { echo "$as_me:$LINENO: error: Argument to enable/disable tls must be yes or no" >&5
+echo "$as_me: error: Argument to enable/disable tls must be yes or no" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ enable_tls=yes
+fi;
+
+ echo "$as_me:$LINENO: checking whether the target supports thread-local storage" >&5
+echo $ECHO_N "checking whether the target supports thread-local storage... $ECHO_C" >&6
+if test "${have_tls+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test "$cross_compiling" = yes; then
+ cat >conftest.$ac_ext <<_ACEOF
+__thread int foo;
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ have_tls=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+have_tls=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+ cat >conftest.$ac_ext <<_ACEOF
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="-static $LDFLAGS"
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ have_tls=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+have_tls=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+ LDFLAGS="$save_LDFLAGS"
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+have_tls=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $have_tls" >&5
+echo "${ECHO_T}$have_tls" >&6
+ if test "$enable_tls $have_tls" = "yes yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TLS 1
+_ACEOF
+
+ fi
+
ac_config_files="$ac_config_files Makefile testsuite/Makefile testsuite/mfconfig.exp"
cat >confcache <<\_ACEOF