diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-08 16:14:49 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-08 16:14:49 +0000 |
commit | cfbdd7def6579707128299d6429c1273e778a97f (patch) | |
tree | 8424b6e62d8e9172cc8b7a69773bcbcc62b63024 /libgomp | |
parent | d7c85fac4113c7c6a43781b366093eb9aca0b00f (diff) | |
download | gcc-cfbdd7def6579707128299d6429c1273e778a97f.tar.gz |
libstdc++-v3/
* configure.ac (--enable-linux-futex): Add new configure option.
(HAVE_LINUX_FUTEX): New AC_DEFINE.
* Makefile.in: Rebuilt.
* aclocal.m4: Rebuilt.
* configure: Rebuilt.
* config.h.in: Rebuilt.
* config/cpu/generic/cxxabi_tweaks.h (_GLIBCXX_GUARD_BIT,
_GLIBCXX_GUARD_PENDING_BIT, _GLIBCXX_GUARD_WAITING_BIT): Define.
* config/cpu/arm/cxxabi_tweaks.h (_GLIBCXX_GUARD_BIT,
_GLIBCXX_GUARD_PENDING_BIT, _GLIBCXX_GUARD_WAITING_BIT): Define.
* libsupc++/guard.cc: Include climits and syscall.h.
(_GLIBCXX_USE_FUTEX): Define if futex syscall and atomic builtins
are supported.
(_GLIBCXX_FUTEX_WAIT, _GLIBCXX_FUTEX_WAKE): Likewise.
(__guard_test_bit): New static inline.
(__cxa_guard_acquire, __cxa_guard_release, __cxa_guard_abort): Use
atomic builtins and futex syscall if _GLIBCXX_USE_FUTEX.
config/
* futex.m4: New file.
libgomp/
* configure.ac: Move futex checking into ../config/futex.m4.
* configure: Rebuilt.
* aclocal.m4: Rebuilt.
* Makefile.in: Rebuilt.
* configure.tgt: Rename have_tls to gcc_cv_have_tls to match
2007-10-15 ../config/tls.m4 change.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131399 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 10 | ||||
-rw-r--r-- | libgomp/Makefile.in | 3 | ||||
-rw-r--r-- | libgomp/aclocal.m4 | 1 | ||||
-rwxr-xr-x | libgomp/configure | 58 | ||||
-rw-r--r-- | libgomp/configure.ac | 50 | ||||
-rw-r--r-- | libgomp/configure.tgt | 2 |
6 files changed, 49 insertions, 75 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 0ef0abf7386..cf698662bdf 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,13 @@ +2008-01-08 Jakub Jelinek <jakub@redhat.com> + + * configure.ac: Move futex checking into ../config/futex.m4. + * configure: Rebuilt. + * aclocal.m4: Rebuilt. + * Makefile.in: Rebuilt. + + * configure.tgt: Rename have_tls to gcc_cv_have_tls to match + 2007-10-15 ../config/tls.m4 change. + 2007-12-19 Jakub Jelinek <jakub@redhat.com> PR c++/34513 diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in index bfc558c2e51..6ba3dcc9a28 100644 --- a/libgomp/Makefile.in +++ b/libgomp/Makefile.in @@ -55,7 +55,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/stdint.m4 \ - $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../config/tls.m4 \ + $(top_srcdir)/../config/futex.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac diff --git a/libgomp/aclocal.m4 b/libgomp/aclocal.m4 index 505095df94c..1746f255949 100644 --- a/libgomp/aclocal.m4 +++ b/libgomp/aclocal.m4 @@ -863,6 +863,7 @@ m4_include([../config/lead-dot.m4]) m4_include([../config/multi.m4]) m4_include([../config/stdint.m4]) m4_include([../config/tls.m4]) +m4_include([../config/futex.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) m4_include([../ltversion.m4]) diff --git a/libgomp/configure b/libgomp/configure index cb78249f4cd..391a81946f4 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -1003,8 +1003,6 @@ Optional Features: --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory [default=no] - --enable-linux-futex Use the Linux futex system call - [default=default] --enable-generated-files-in-srcdir put copies of generated files in source dir intended for creating source tarballs for users without @@ -1021,6 +1019,8 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer + --enable-linux-futex use the Linux futex system call + [default=default] --enable-tls Use thread-local storage [default=yes] --enable-symvers=STYLE enables symbol versioning of the shared library [default=yes] @@ -1518,26 +1518,6 @@ fi; echo "$as_me:$LINENO: result: $enable_version_specific_runtime_libs" >&5 echo "${ECHO_T}$enable_version_specific_runtime_libs" >&6 -echo "$as_me:$LINENO: checking for --enable-linux-futex" >&5 -echo $ECHO_N "checking for --enable-linux-futex... $ECHO_C" >&6 - # Check whether --enable-linux-futex or --disable-linux-futex was given. -if test "${enable_linux_futex+set}" = set; then - enableval="$enable_linux_futex" - - case "$enableval" in - yes|no|default) ;; - *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable linux-futex" >&5 -echo "$as_me: error: Unknown argument to enable/disable linux-futex" >&2;} - { (exit 1); exit 1; }; } ;; - esac - -else - enable_linux_futex=default -fi; - -echo "$as_me:$LINENO: result: $enable_linux_futex" >&5 -echo "${ECHO_T}$enable_linux_futex" >&6 - # We would like our source tree to be readonly. However when releases or # pre-releases are generated, the flex/bison generated files as well as the # various formats of manuals need to be included along with the rest of the @@ -16661,6 +16641,24 @@ cat >>confdefs.h <<\_ACEOF _ACEOF ;; +esac + + # Check whether --enable-linux-futex or --disable-linux-futex was given. +if test "${enable_linux_futex+set}" = set; then + enableval="$enable_linux_futex" + + case "$enableval" in + yes|no|default) ;; + *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable linux-futex" >&5 +echo "$as_me: error: Unknown argument to enable/disable linux-futex" >&2;} + { (exit 1); exit 1; }; } ;; + esac + +else + enable_linux_futex=default +fi; + +case "$target" in *-linux*) case "$enable_linux_futex" in default) @@ -16709,7 +16707,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - cat >conftest.$ac_ext <<_ACEOF + save_LIBS="$LIBS" + LIBS="-lpthread $LIBS" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -16757,7 +16757,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 if test x$cross_compiling = xno; then if getconf GNU_LIBPTHREAD_VERSION 2>/dev/null \ - | LC_ALL=C grep -i NPTL > /dev/null 2>/dev/null; then + | LC_ALL=C grep -i NPTL > /dev/null 2>/dev/null; then :; else { echo "$as_me:$LINENO: WARNING: The kernel might not support futex or gettid syscalls. If so, please configure with --disable-linux-futex" >&5 echo "$as_me: WARNING: The kernel might not support futex or gettid syscalls. @@ -16768,6 +16768,7 @@ If so, please configure with --disable-linux-futex" >&2;} fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -16776,7 +16777,7 @@ fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ;; - yes) + yes) cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16829,7 +16830,14 @@ rm -f conftest.err conftest.$ac_objext \ ;; esac ;; + *) + enable_linux_futex=no + ;; esac +if test x$enable_linux_futex = xyes; then + : +fi + # Check for pthread_{,attr_}[sg]etaffinity_np. cat >conftest.$ac_ext <<_ACEOF diff --git a/libgomp/configure.ac b/libgomp/configure.ac index 68a18e17561..0cda749d593 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -15,12 +15,6 @@ LIBGOMP_ENABLE(version-specific-runtime-libs, no, , permit yes|no) AC_MSG_RESULT($enable_version_specific_runtime_libs) -AC_MSG_CHECKING([for --enable-linux-futex]) -LIBGOMP_ENABLE(linux-futex, default, , - [Use the Linux futex system call], - permit yes|no|default) -AC_MSG_RESULT($enable_linux_futex) - # We would like our source tree to be readonly. However when releases or # pre-releases are generated, the flex/bison generated files as well as the # various formats of manuals need to be included along with the rest of the @@ -192,50 +186,10 @@ case "$host" in AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, Define if the POSIX Semaphores do not work on your system.) ;; - *-linux*) - case "$enable_linux_futex" in - default) - # If headers don't have gettid/futex syscalls definition, then - # default to no, otherwise there will be compile time failures. - # Otherwise, default to yes. If we don't detect we are - # compiled/linked against NPTL and not cross-compiling, check - # if programs are run by default against NPTL and if not, issue - # a warning. - enable_linux_futex=no - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include <sys/syscall.h> - int lk;], - [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#ifndef _GNU_SOURCE - #define _GNU_SOURCE 1 - #endif - #include <pthread.h> - pthread_t th; void *status;], - [pthread_tryjoin_np (th, &status);])],[enable_linux_futex=yes], - [if test x$cross_compiling = xno; then - if getconf GNU_LIBPTHREAD_VERSION 2>/dev/null \ - | LC_ALL=C grep -i NPTL > /dev/null 2>/dev/null; then - AC_MSG_WARN([The kernel might not support futex or gettid syscalls. -If so, please configure with --disable-linux-futex]) - fi - fi - enable_linux_futex=yes])]) - ;; - yes) - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include <sys/syscall.h> - int lk;], - [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])],[], - [AC_MSG_ERROR([SYS_gettid and SYS_futex required for --enable-linux-futex])]) - ;; - esac - ;; esac +GCC_LINUX_FUTEX(:) + # Check for pthread_{,attr_}[sg]etaffinity_np. AC_LINK_IFELSE( [AC_LANG_PROGRAM( diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt index f46210c3647..68115abf71d 100644 --- a/libgomp/configure.tgt +++ b/libgomp/configure.tgt @@ -11,7 +11,7 @@ # XLDFLAGS Add extra link flags to use. # Optimize TLS usage by avoiding the overhead of dynamic allocation. -if test $have_tls = yes ; then +if test $gcc_cv_have_tls = yes ; then case "${target}" in *-*-linux*) |