diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-01 23:42:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-01 23:42:24 +0200 |
commit | 6517fd2107a5a71290afad8850da0eab51519bc6 (patch) | |
tree | 621104fd668c9da2eb97068fcb0a294197f6ce72 /configure.ac | |
parent | 6e433e05299bcd7d945b0febff994d52166bfd45 (diff) |
HAVE_THREADSAFE_STATICS sould always be true
...(for LIBO_INTERNAL_ONLY), now that the status of Android has been clarified,
see <https://lists.freedesktop.org/archives/libreoffice/2017-June/077827.html>
"Re: Some baseline thoughts"
Change-Id: Ie9d5444df84c23d48c24b68d9d2ab5322c619858
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/configure.ac b/configure.ac index 0fcab1169b13..05e370194d6e 100644 --- a/configure.ac +++ b/configure.ac @@ -5832,84 +5832,6 @@ fi AC_CONFIG_HEADERS([config_host/config_probes.h]) dnl =================================================================== -dnl thread-safe statics -dnl =================================================================== -AC_MSG_CHECKING([whether $CXX supports thread safe statics]) -unset HAVE_THREADSAFE_STATICS -if test "$GCC" = "yes"; then - dnl -fthreadsafe-statics is available since GCC 4, so always available for - dnl us. However, some C++ runtimes use a single lock for all static - dnl variables, which can cause deadlock in multi-threaded applications. - dnl This is not easily tested here; for POSIX-based systems, if executing - dnl the following C++ program does not terminate then the tool chain - dnl apparently has this problem: - dnl - dnl #include <pthread.h> - dnl int h() { return 0; } - dnl void * g(void * unused) { - dnl static int n = h(); - dnl return &n; - dnl } - dnl int f() { - dnl pthread_t t; - dnl pthread_create(&t, 0, g, 0); - dnl pthread_join(t, 0); - dnl return 0; - dnl } - dnl int main() { - dnl static int n = f(); - dnl return n; - dnl } - dnl - dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is at - dnl least one instance of GCC 4.2.4 (used on a "Linux ooobuild1.osuosl.org - dnl 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15 EDT 2011 i686 i686 i386 - dnl GNU/Linux" machine); see the definition of __cxa_guard_acquire in GCC's - dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a - dnl difference there. Conservative advice from Jakub Jelinek is to assume - dnl it working in GCC >= 4.3, so conservative way to check here is to use - dnl GCC_VERSION for GCC but resort to __GLIBCXX__ corresponding to libstdc++ - dnl shipped with GCC 4.3.0 (cf. <http://gcc.gnu.org/onlinedocs/libstdc++/ - dnl manual/abi.html#abi.versioning.history>; 4.3.0 is 20080306, 4.2.4 is - dnl 20080519, 4.3.1 is 20080606) for Clang (for which GCC_VERSION is notoriously - dnl "too old"): - if test "$_os" = Darwin; then - HAVE_THREADSAFE_STATICS=TRUE - elif test "$_os" != Android; then - if test "$COM_IS_CLANG" = TRUE; then - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include <list> -#if defined __GLIBCXX__ -#if __GLIBCXX__ < 20080606 && __GLIBCXX__ != 20080306 -#error -#endif -#endif - ]])],[HAVE_THREADSAFE_STATICS=TRUE],[]) - AC_LANG_POP([C++]) - else # known to work in GCC since version 4.3 - HAVE_THREADSAFE_STATICS=TRUE - fi - fi - if test "$HAVE_THREADSAFE_STATICS" = TRUE; then - AC_DEFINE(HAVE_THREADSAFE_STATICS) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([broken (i.e., no)]) - fi -else - # MSVC has sprouted C++11 thread-safe statics in 2015 - # http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx - if test "$COM" = "MSC"; then - AC_DEFINE(HAVE_THREADSAFE_STATICS) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi -fi -AC_SUBST(HAVE_THREADSAFE_STATICS) - -dnl =================================================================== dnl GCC features dnl =================================================================== if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then |