clucene/UnpackedTarball_clucene.mk | 9 + clucene/configs/clucene-config-GCC-atomic.h | 148 ++++++++++++++++++++++++++ clucene/configs/clucene-config-MINGW-atomic.h | 148 ++++++++++++++++++++++++++ clucene/configs/clucene-config-generic.h | 2 clucene/patches/clucene-gcc-atomics.patch | 31 ----- config_host.mk.in | 1 configure.in | 27 ++++ icu/icu4c-bsd.patch | 22 +++ icu/icu4c-interlck.patch | 11 - icu/makefile.mk | 8 + sal/osl/unx/interlck.c | 24 ++-- solenv/gbuild/platform/com_GCC_defs.mk | 6 + 12 files changed, 376 insertions(+), 61 deletions(-)
New commits: commit c4ab4d3b2aa01f37bc38485fdee9ed59c68cb770 Author: Jung-uk Kim <j...@freebsd.org> Date: Mon Aug 27 13:26:27 2012 +0200 fdo#53894: Fix ICU version check Change-Id: I980401f886a6f95d35744b059706aca932af28a7 diff --git a/configure.in b/configure.in index 43de70b..db28504 100644 --- a/configure.in +++ b/configure.in @@ -8234,12 +8234,12 @@ You can use --with-system-icu-for-build=force to use it anyway.]) if test -z "$SYSTEM_GENCMN"; then AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\']) fi - if test "$ICU_MAJOR" -ge "5" -o "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4"; then + if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4" \); then ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES" else ICU_RECLASSIFIED_CLOSE_PARENTHESIS="NO" fi - if test "$ICU_MAJOR" -ge "5" -o "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "9"; then + if test "$ICU_MAJOR" -ge "49"; then ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES" else ICU_RECLASSIFIED_PREPEND_SET_EMPTY="NO" commit c89dab21ea72cf6ce9f831678da251fd6e24341c Author: Jung-uk Kim <j...@freebsd.org> Date: Mon Aug 27 13:19:25 2012 +0200 fdo#53893: Undefine U_TIMEZONE for BSDs (except for NetBSD) FreeBSD and other BSDs (except for NetBSD) must not define U_TIMEZONE. This patch is obtained from upstream: http://bugs.icu-project.org/trac/changeset?reponame=&new=31780 Change-Id: Id1b85b9958036230045c3e13eb4b6617e6bdc924 diff --git a/icu/icu4c-bsd.patch b/icu/icu4c-bsd.patch new file mode 100644 index 0000000..78f8ca2 --- /dev/null +++ b/icu/icu4c-bsd.patch @@ -0,0 +1,22 @@ +--- misc/icu/source/common/putilimp.h 2012-06-01 10:52:52.000000000 -0400 ++++ misc/build/icu/source/common/putilimp.h 2012-08-21 13:32:58.000000000 -0400 +@@ -117,6 +117,8 @@ + # define U_TIMEZONE __timezone + #elif U_PLATFORM_USES_ONLY_WIN32_API + # define U_TIMEZONE _timezone ++#elif U_PLATFORM == U_PF_BSD && !defined(__NetBSD__) ++ /* not defined */ + #elif U_PLATFORM == U_PF_OS400 + /* not defined */ + #else +--- misc/icu/source/common/unicode/platform.h 2012-08-21 16:53:20.957449000 -0400 ++++ misc/build/icu/source/common/unicode/platform.h 2012-08-21 17:02:16.000000000 -0400 +@@ -131,7 +131,7 @@ + # include <android/api-level.h> + #elif defined(linux) || defined(__linux__) || defined(__linux) + # define U_PLATFORM U_PF_LINUX +-#elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++#elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) + # define U_PLATFORM U_PF_BSD + #elif defined(sun) || defined(__sun) + /* Check defined(__SVR4) || defined(__svr4__) to distinguish Solaris from SunOS? */ diff --git a/icu/makefile.mk b/icu/makefile.mk index 7b990ab..aaace59 100644 --- a/icu/makefile.mk +++ b/icu/makefile.mk @@ -49,6 +49,7 @@ TARFILE_ROOTDIR=icu #http://bugs.icu-project.org/trac/ticket/8198 rendering with 0D30 and 0D31 PATCH_FILES=\ + icu4c-bsd.patch \ icu4c-build.patch \ icu4c.8320.freeserif.crash.patch \ icu4c.8198.revert.icu5431.patch \ commit 38e0a58ce11125d20ef1f8aed7996518d7ddbb38 Author: Jung-uk Kim <j...@freebsd.org> Date: Mon Aug 27 13:11:21 2012 +0200 fdo#53857: Assume --strip-components is always available for bsdtar Change-Id: Ic05c0cb9ac2c20788870069939d6708214ea0cda diff --git a/configure.in b/configure.in index b72029a..43de70b 100644 --- a/configure.in +++ b/configure.in @@ -2221,7 +2221,7 @@ fi AC_SUBST(GNUTAR) AC_MSG_CHECKING([for tar's option to strip components]) -$GNUTAR --help 2> /dev/null | egrep "strip-components" 2>&1 >/dev/null +$GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null if test $? -eq 0; then STRIP_COMPONENTS="--strip-components" else commit 6e7baaaba85b0d6cd86e959f9af229a0d30c01f8 Author: Jung-uk Kim <j...@freebsd.org> Date: Mon Aug 27 12:02:53 2012 +0200 fdo#53855: Use the newly added HAVE_GCC_BUILTIN_ATOMIC for icu Signed-off-by: Stephan Bergmann <sberg...@redhat.com>: * pass -DU_HAVE_GCC_ATOMICS=1 in when applicable on MINGW, too Change-Id: I2073c61fb92d698a3c1ba38266dbd0373b0a693c diff --git a/icu/icu4c-interlck.patch b/icu/icu4c-interlck.patch deleted file mode 100644 index 6426dce..0000000 --- a/icu/icu4c-interlck.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- misc/icu/source/common/putilimp.h -+++ misc/build/icu/source/common/putilimp.h -@@ -175,7 +175,7 @@ - */ - #ifdef U_HAVE_GCC_ATOMICS - /* Use the predefined value. */ --#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 401) -+#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 404) - # define U_HAVE_GCC_ATOMICS 1 - #else - # define U_HAVE_GCC_ATOMICS 0 diff --git a/icu/makefile.mk b/icu/makefile.mk index e7fa925..7b990ab 100644 --- a/icu/makefile.mk +++ b/icu/makefile.mk @@ -58,7 +58,6 @@ PATCH_FILES=\ icu4c-warnings.patch \ icu4c.9313.cygwin.patch \ icu4c-macosx.patch \ - icu4c-interlck.patch \ icu4c-solarisgcc.patch \ .IF "$(OS)"=="ANDROID" @@ -69,6 +68,10 @@ PATCH_FILES+=\ icu4c-rpath.patch .ENDIF +.IF "$(HAVE_GCC_BUILTIN_ATOMIC)"=="TRUE" +EXTRA_CDEFS+=-DU_HAVE_GCC_ATOMICS=1 +.ENDIF + .IF "$(GUI)"=="UNX" .IF "$(SYSBASE)"!="" @@ -236,7 +239,7 @@ BUILD_AND_HOST=--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --with-cross-bu BUILD_AND_HOST=--build=i586-pc-mingw32 --enable-64bit-libs=no .ENDIF -CONFIGURE_ACTION+=sh -c 'CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" LDFLAGS="$(icu_LDFLAGS)" LIBS="$(icu_LIBS)" \ +CONFIGURE_ACTION+=sh -c 'CPPFLAGS="$(EXTRA_CDEFS)" CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" LDFLAGS="$(icu_LDFLAGS)" LIBS="$(icu_LIBS)" \ ./configure $(BUILD_AND_HOST) --enable-layout --disable-static --enable-shared --disable-samples' CONFIGURE_FLAGS= commit 8a55c4af62d90ff8518491a86a97bfe827591ece Author: Jung-uk Kim <j...@freebsd.org> Date: Mon Aug 27 11:49:36 2012 +0200 fdo#53855: Use the newly added HAVE_GCC_BUILTIN_ATOMIC for clucene Signed-off-by: Stephan Bergmann <sberg...@redhat.com>: * added clucene-config-MINGW-atomic.h, to not lose _CL_HAVE_GCC_ATOMIC_FUNCTIONS when applicable there * renamed clucene-config-GCC.h to clucene-config-GCC-atomic.h for consistency with above Change-Id: I3dd15721b568fa9358b79ec28bad39249200c773 diff --git a/clucene/UnpackedTarball_clucene.mk b/clucene/UnpackedTarball_clucene.mk index de974da..d7ecfc7 100644 --- a/clucene/UnpackedTarball_clucene.mk +++ b/clucene/UnpackedTarball_clucene.mk @@ -26,7 +26,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,clucene,0)) # http://sourceforge.net/mailarchive/message.php?msg_id=29143260 $(eval $(call gb_UnpackedTarball_add_patches,clucene,\ clucene/patches/clucene-debug.patch \ - clucene/patches/clucene-gcc-atomics.patch \ clucene/patches/clucene-internal-zlib.patch \ clucene/patches/clucene-multimap-put.patch \ clucene/patches/clucene-narrowing-conversions.patch \ @@ -39,10 +38,18 @@ $(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/_clucene-co ifeq ($(COM),MSC) $(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,clucene/configs/clucene-config-MSVC.h)) else +ifeq ($(HAVE_GCC_BUILTIN_ATOMIC),TRUE) +$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,clucene/configs/clucene-config-MINGW-atomic.h)) +else $(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,clucene/configs/clucene-config-MINGW.h)) endif +endif else # ! $(OS),WNT +ifeq ($(HAVE_GCC_BUILTIN_ATOMIC),TRUE) +$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,clucene/configs/clucene-config-GCC-atomic.h)) +else $(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,clucene/configs/clucene-config-generic.h)) +endif ifeq ($(OS),LINUX) $(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/_clucene-config.h,clucene/configs/_clucene-config-LINUX.h)) else diff --git a/clucene/configs/clucene-config-GCC-atomic.h b/clucene/configs/clucene-config-GCC-atomic.h new file mode 100644 index 0000000..4dc8390 --- /dev/null +++ b/clucene/configs/clucene-config-GCC-atomic.h @@ -0,0 +1,148 @@ +#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H +#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1 + +/* src/shared/CLucene/clucene-config.h. +* Generated automatically at end of cmake. +*/ + +/* CMake will look for these headers: */ +#define _CL_HAVE_STRING_H 1 +#define _CL_HAVE_MEMORY_H 1 +#define _CL_HAVE_UNISTD_H 1 +/* #undef _CL_HAVE_IO_H */ +/* #undef _CL_HAVE_DIRECT_H */ +#define _CL_HAVE_DIRENT_H 1 +#define _CL_HAVE_SYS_DIR_H +/* #undef _CL_HAVE_SYS_NDIR_H */ +#define _CL_HAVE_ERRNO_H 1 +#define _CL_HAVE_WCHAR_H 1 +#define _CL_HAVE_WCTYPE_H +#define _CL_HAVE_CTYPE_H 1 +/* #undef _CL_HAVE_WINDOWS_H */ +/* #undef _CL_HAVE_WINDEF_H */ +#define _CL_HAVE_SYS_TYPES_H 1 +/* #undef _CL_HAVE_DLFCN_H */ +#define _CL_HAVE_EXT_HASH_MAP 1 +/* #undef _CL_HAVE_EXT_HASH_SET */ +#define _CL_HAVE_TR1_UNORDERED_MAP 1 +#define _CL_HAVE_TR1_UNORDERED_SET 1 +#define _CL_HAVE_HASH_MAP +#define _CL_HAVE_HASH_SET +/* #undef _CL_HAVE_NDIR_H */ +#define _CL_HAVE_SYS_STAT_H 1 +#define _CL_HAVE_SYS_TIMEB_H 1 +#define _CL_HAVE_SYS_TIME_H 1 +/* #undef _CL_HAVE_TCHAR_H */ +#define _CL_HAVE_SYS_MMAN_H 1 +/* #undef _CL_HAVE_WINERROR_H */ +#define _CL_HAVE_STDINT_H 1 + +// our needed types +/* undef int8_t int8_t */ +/* undef uint8_t uint8_t */ +/* undef int16_t int16_t */ +/* undef uint16_t uint16_t */ +/* undef int32_t int32_t */ +/* undef uint32_t uint32_t */ +/* undef int64_t int64_t */ +/* undef uint64_t uint64_t */ + +/* undef float_t*/ + +/* undef size_t size_t */ + +/* tchar & _T definitions... */ +typedef wchar_t TCHAR; +#define _T(x) L ## x + +/* CMake will determine these specifics. Things like bugs, etc */ + +/* if we can't support the map/set hashing */ +/* #undef LUCENE_DISABLE_HASHING */ + +/* Define if you have POSIX threads libraries and header files. */ +#define _CL_HAVE_PTHREAD 1 + +/* Define if you have Win32 threads libraries and header files. */ +/* #undef _CL_HAVE_WIN32_THREADS */ + +/* Define if we have gcc atomic functions */ +#define _CL_HAVE_GCC_ATOMIC_FUNCTIONS 1 + +/* Define what eval method is required for float_t to be defined (for GCC). */ +/* #undef _FLT_EVAL_METHOD */ + +/* If we use hashmaps, which namespace do we use: */ +#define CL_NS_HASHING(func) std::tr1::func +/* If we use hashmaps, which classes do we use: */ +#define _CL_HASH_MAP unordered_map +#define _CL_HASH_SET unordered_set + +/* define if the compiler implements namespaces */ +#define _CL_HAVE_NAMESPACES + +/* Defined if the snprintf overflow test fails */ +/* #undef _CL_HAVE_SNPRINTF_BUG */ + +/* Defined if the swprintf test fails */ +/* #undef _CL_HAVE_SNWPRINTF_BUG */ + +/* How to define a static const in a class */ +#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment + +/* Define to the necessary symbol if this constant uses a non-standard name on + your system. */ +//todo: not checked +/* #undef _CL_PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ +//todo: not being checked for... +/* #undef _CL_STAT_MACROS_BROKEN */ + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +//not actually used for anything... +//#define _CL_TIME_WITH_SYS_TIME 1 + +/* Define that we will be using -fvisibility=hidden, and + * make public classes visible using __attribute__ ((visibility("default"))) + */ +#define _CL_HAVE_GCCVISIBILITYPATCH 1 + + +/* Versions, etc */ + +/* Name of package */ +#define _CL_PACKAGE "clucene-core" + +/* Version number of package */ +#define _CL_VERSION "2.3.3.4" + +/* So-Version number of package */ +#define _CL_SOVERSION "1" + +/* A comparable version number */ +#define _CL_INT_VERSION 2030304 + +/* Configured options (from command line) */ + +/* Forces into Ascii mode */ +/* #undef _ASCII */ + +/* Conditional Debugging */ +/* #undef _CL__CND_DEBUG */ + +/* debuging option */ +/* #undef _DEBUG */ + +/* Disable multithreading */ +/* #undef _CL_DISABLE_MULTITHREADING */ + + +#ifdef __BORLANDC__ //borland compiler + //todo: bcc incorrectly detects this... fix this in cmake + #undef LUCENE_STATIC_CONSTANT + #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment } +#endif + + +#endif diff --git a/clucene/configs/clucene-config-MINGW-atomic.h b/clucene/configs/clucene-config-MINGW-atomic.h new file mode 100644 index 0000000..a75b98b --- /dev/null +++ b/clucene/configs/clucene-config-MINGW-atomic.h @@ -0,0 +1,148 @@ +#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H +#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1 + +/* src/shared/CLucene/clucene-config.h. +* Generated automatically at end of cmake. +*/ + +/* CMake will look for these headers: */ +#define _CL_HAVE_STRING_H 1 +#define _CL_HAVE_MEMORY_H 1 +/* #undef _CL_HAVE_UNISTD_H */ +#define _CL_HAVE_IO_H 1 +#define _CL_HAVE_DIRECT_H 1 +/* #undef _CL_HAVE_DIRENT_H */ +/* #undef _CL_HAVE_SYS_DIR_H */ +/* #undef _CL_HAVE_SYS_NDIR_H */ +#define _CL_HAVE_ERRNO_H 1 +#define _CL_HAVE_WCHAR_H 1 +#define _CL_HAVE_WCTYPE_H +#define _CL_HAVE_CTYPE_H 1 +#define _CL_HAVE_WINDOWS_H 1 +/* #undef _CL_HAVE_WINDEF_H */ +#define _CL_HAVE_SYS_TYPES_H 1 +/* #undef _CL_HAVE_DLFCN_H */ +/* #undef _CL_HAVE_EXT_HASH_MAP */ +/* #undef _CL_HAVE_EXT_HASH_SET */ +/* #undef _CL_HAVE_TR1_UNORDERED_MAP */ +/* #undef _CL_HAVE_TR1_UNORDERED_SET */ +/* #undef _CL_HAVE_HASH_MAP */ +/* #undef _CL_HAVE_HASH_SET */ +/* #undef _CL_HAVE_NDIR_H */ +#define _CL_HAVE_SYS_STAT_H 1 +#define _CL_HAVE_SYS_TIMEB_H 1 +/* #undef _CL_HAVE_SYS_TIME_H */ +#define _CL_HAVE_TCHAR_H 1 +/* #undef _CL_HAVE_SYS_MMAN_H */ +#define _CL_HAVE_WINERROR_H 1 +/* #undef _CL_HAVE_STDINT_H */ + +// our needed types +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; + +/* undef float_t*/ +typedef unsigned long _cl_dword_t; +/* undef size_t size_t */ + +/* tchar & _T definitions... */ +/* undef TCHAR TCHAR */ +/* #undef _T */ + +/* CMake will determine these specifics. Things like bugs, etc */ + +/* if we can't support the map/set hashing */ +/* #undef LUCENE_DISABLE_HASHING */ + +/* Define if you have POSIX threads libraries and header files. */ +/* #undef _CL_HAVE_PTHREAD */ + +/* Define if you have Win32 threads libraries and header files. */ +#define _CL_HAVE_WIN32_THREADS 1 + +/* Define if we have gcc atomic functions */ +#define _CL_HAVE_GCC_ATOMIC_FUNCTIONS 1 + +/* Define what eval method is required for float_t to be defined (for GCC). */ +/* #undef _FLT_EVAL_METHOD */ + +/* If we use hashmaps, which namespace do we use: */ +#define CL_NS_HASHING(func) +/* If we use hashmaps, which classes do we use: */ +#define _CL_HASH_MAP +#define _CL_HASH_SET + +/* define if the compiler implements namespaces */ +#define _CL_HAVE_NAMESPACES + +/* Defined if the snprintf overflow test fails */ +/* #undef _CL_HAVE_SNPRINTF_BUG */ + +/* Defined if the swprintf test fails */ +/* #undef _CL_HAVE_SNWPRINTF_BUG */ + +/* How to define a static const in a class */ +#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment + +/* Define to the necessary symbol if this constant uses a non-standard name on + your system. */ +//todo: not checked +/* #undef _CL_PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ +//todo: not being checked for... +/* #undef _CL_STAT_MACROS_BROKEN */ + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +//not actually used for anything... +/* #undef _CL_TIME_WITH_SYS_TIME */ + +/* Define that we will be using -fvisibility=hidden, and + * make public classes visible using __attribute__ ((visibility("default"))) + */ +/* #undef _CL_HAVE_GCCVISIBILITYPATCH */ + + +/* Versions, etc */ + +/* Name of package */ +#define _CL_PACKAGE "clucene-core" + +/* Version number of package */ +#define _CL_VERSION "2.3.3.4" + +/* So-Version number of package */ +#define _CL_SOVERSION "1" + +/* A comparable version number */ +#define _CL_INT_VERSION 2030304 + +/* Configured options (from command line) */ + +/* Forces into Ascii mode */ +/* #undef _ASCII */ + +/* Conditional Debugging */ +/* #undef _CL__CND_DEBUG */ + +/* debuging option */ +/* #undef _DEBUG */ + +/* Disable multithreading */ +/* #undef _CL_DISABLE_MULTITHREADING */ + + +#ifdef __BORLANDC__ //borland compiler + //todo: bcc incorrectly detects this... fix this in cmake + #undef LUCENE_STATIC_CONSTANT + #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment } +#endif + + +#endif diff --git a/clucene/configs/clucene-config-generic.h b/clucene/configs/clucene-config-generic.h index 4dc8390..b69ba5b 100644 --- a/clucene/configs/clucene-config-generic.h +++ b/clucene/configs/clucene-config-generic.h @@ -67,7 +67,7 @@ typedef wchar_t TCHAR; /* #undef _CL_HAVE_WIN32_THREADS */ /* Define if we have gcc atomic functions */ -#define _CL_HAVE_GCC_ATOMIC_FUNCTIONS 1 +/* #undef _CL_HAVE_GCC_ATOMIC_FUNCTIONS */ /* Define what eval method is required for float_t to be defined (for GCC). */ /* #undef _FLT_EVAL_METHOD */ diff --git a/clucene/patches/clucene-gcc-atomics.patch b/clucene/patches/clucene-gcc-atomics.patch deleted file mode 100644 index 819e9a7..0000000 --- a/clucene/patches/clucene-gcc-atomics.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- src/shared/CLucene/config/threads.cpp 2012-02-23 12:06:55.355506304 +0000 -+++ src/shared/CLucene/config/threads.cpp 2012-02-23 12:07:17.131766381 +0000 -@@ -185,7 +185,7 @@ - } - - int32_t atomic_threads::atomic_increment(_LUCENE_ATOMIC_INT *theInteger){ -- #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS -+ #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 )) - return __sync_add_and_fetch(theInteger, 1); - #else - SCOPED_LOCK_MUTEX(theInteger->THIS_LOCK) -@@ -193,7 +193,7 @@ - #endif - } - int32_t atomic_threads::atomic_decrement(_LUCENE_ATOMIC_INT *theInteger){ -- #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS -+ #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 )) - return __sync_sub_and_fetch(theInteger, 1); - #else - SCOPED_LOCK_MUTEX(theInteger->THIS_LOCK) ---- src/shared/CLucene/LuceneThreads.h 2012-02-23 12:36:28.388299322 +0000 -+++ src/shared/CLucene/LuceneThreads.h 2012-02-23 12:37:23.131885433 +0000 -@@ -70,7 +70,7 @@ - void NotifyAll(); - }; - -- #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS -+ #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 )) - #define _LUCENE_ATOMIC_INT uint32_t - #define _LUCENE_ATOMIC_INT_SET(x,v) x=v - #define _LUCENE_ATOMIC_INT_GET(x) x commit 8474c6af652343777653e6ac8115b994b54ff853 Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Aug 27 10:48:28 2012 +0200 Move -DHAVE_GCC_BUILTIN_ATOMIC to solenv/gbuild Change-Id: I82f62c998837783ac69317123268b0c87f74425f diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 7e77034..de22417 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -40,9 +40,6 @@ $(eval $(call gb_Library_set_include,sal,\ )) $(eval $(call gb_Library_add_defs,sal,\ - $(if $(filter $(HAVE_GCC_BUILTIN_ATOMIC),TRUE), \ - -DHAVE_GCC_BUILTIN_ATOMIC \ - ) \ $(if $(VALGRIND_CFLAGS), \ $(VALGRIND_CFLAGS) \ -DHAVE_MEMCHECK_H=1 \ diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index 39fa02b..d0d6136 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -57,6 +57,12 @@ gb_COMPILERDEFS := \ -DCPPU_ENV=gcc3 \ -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \ +ifeq ($(HAVE_GCC_BUILTIN_ATOMIC),TRUE) +gb_COMPILERDEFS += \ + -DHAVE_GCC_BUILTIN_ATOMIC \ + +endif + gb_CFLAGS_COMMON := \ -Wall \ -Wendif-labels \ commit 1d6e13e13b36163c07fc6013c9c3da6fc553e697 Author: Jung-uk Kim <j...@freebsd.org> Date: Mon Aug 27 10:38:05 2012 +0200 fdo#53855: Use the newly added HAVE_GCC_BUILTIN_ATOMIC for sal Signed-off-by: Stephan Bergmann <sberg...@redhat.com>: * nCount is needed in else branches after all * tabs -> spaces Change-Id: Iaa39ba9e1ed645819905f0e484fa4f1812271700 diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index de22417..7e77034 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -40,6 +40,9 @@ $(eval $(call gb_Library_set_include,sal,\ )) $(eval $(call gb_Library_add_defs,sal,\ + $(if $(filter $(HAVE_GCC_BUILTIN_ATOMIC),TRUE), \ + -DHAVE_GCC_BUILTIN_ATOMIC \ + ) \ $(if $(VALGRIND_CFLAGS), \ $(VALGRIND_CFLAGS) \ -DHAVE_MEMCHECK_H=1 \ diff --git a/sal/osl/unx/interlck.c b/sal/osl/unx/interlck.c index bf9ff62..91dd9c8 100644 --- a/sal/osl/unx/interlck.c +++ b/sal/osl/unx/interlck.c @@ -49,10 +49,9 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* { // Fast case for old, slow, single CPU Intel machines for whom // interlocking is a performance nightmare. - register oslInterlockedCount nCount asm("%eax"); - nCount = 1; - if ( osl_isSingleCPU ) { + register oslInterlockedCount nCount asm("%eax"); + nCount = 1; __asm__ __volatile__ ( "xaddl %0, %1\n\t" : "+r" (nCount), "+m" (*pCount) @@ -60,28 +59,29 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* : "memory"); return ++nCount; } -#if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 )) +#if defined( HAVE_GCC_BUILTIN_ATOMIC ) else return __sync_add_and_fetch (pCount, 1); #else else { + register oslInterlockedCount nCount asm("%eax"); + nCount = 1; __asm__ __volatile__ ( "lock\n\t" "xaddl %0, %1\n\t" : "+r" (nCount), "+m" (*pCount) : /* nothing */ : "memory"); + return ++nCount; } - return ++nCount; #endif } oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* pCount) { - register oslInterlockedCount nCount asm("%eax"); - nCount = -1; - if ( osl_isSingleCPU ) { + register oslInterlockedCount nCount asm("%eax"); + nCount = -1; __asm__ __volatile__ ( "xaddl %0, %1\n\t" : "+r" (nCount), "+m" (*pCount) @@ -89,22 +89,24 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* : "memory"); return --nCount; } -#if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 )) +#if defined( HAVE_GCC_BUILTIN_ATOMIC ) else return __sync_sub_and_fetch (pCount, 1); #else else { + register oslInterlockedCount nCount asm("%eax"); + nCount = -1; __asm__ __volatile__ ( "lock\n\t" "xaddl %0, %1\n\t" : "+r" (nCount), "+m" (*pCount) : /* nothing */ : "memory"); + return --nCount; } - return --nCount; #endif } -#elif ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 )) +#elif defined( HAVE_GCC_BUILTIN_ATOMIC ) oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* pCount) { return __sync_add_and_fetch(pCount, 1); commit 0983231c8382234cc08124d1ce9a3e200dd0da0e Author: Jung-uk Kim <j...@freebsd.org> Date: Mon Aug 27 10:29:30 2012 +0200 fdo#53855: Detect GCC built-in atomic functions Change-Id: I57a977d799df6bce6c854b38b441a0575218922b diff --git a/config_host.mk.in b/config_host.mk.in index 359915a..6da79d1 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -208,6 +208,7 @@ export GUI_FOR_BUILD=@GUI_FOR_BUILD@ export GXX_INCLUDE_PATH=@GXX_INCLUDE_PATH@ export HAVE_CXX0X=@HAVE_CXX0X@ export HAVE_GCC_AVX=@HAVE_GCC_AVX@ +export HAVE_GCC_BUILTIN_ATOMIC=@HAVE_GCC_BUILTIN_ATOMIC@ export HAVE_GCC_GGDB2=@HAVE_GCC_GGDB2@ export HAVE_GCC_FINLINE_LIMIT=@HAVE_GCC_FINLINE_LIMIT@ export HAVE_GCC_FNO_INLINE=@HAVE_GCC_FNO_INLINE@ diff --git a/configure.in b/configure.in index 1a23dff..b72029a 100644 --- a/configure.in +++ b/configure.in @@ -5076,7 +5076,25 @@ if test "$GCC" = "yes"; then AC_MSG_RESULT([no]) fi - AC_MSG_CHECKING([whether $CC supports -std=gnu++0x without Language Defect 757]) + AC_MSG_CHECKING([whether $CC supports atomic functions]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ + int v = 0; + if (__sync_add_and_fetch(&v, 1) != 1 || + __sync_sub_and_fetch(&v, 1) != 0) + return 1; + __sync_synchronize(); + if (__sync_val_compare_and_swap(&v, 0, 1) != 0 || + v != 1) + return 1; + return 0; +]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[]) + if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + + AC_MSG_CHECKING([whether $CXX supports -std=gnu++0x without Language Defect 757]) save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS -std=gnu++0x" AC_LANG_PUSH([C++]) @@ -5122,6 +5140,7 @@ fi AC_SUBST(HAVE_CXX0X) AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE) AC_SUBST(HAVE_GCC_AVX) +AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC) dnl =================================================================== dnl system stl sanity tests _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits