Author: rjung
Date: Wed Aug 26 18:10:46 2015
New Revision: 1697985

URL: http://svn.apache.org/r1697985
Log:
BZ 58285: Don't use GCC atomics on platforms, for
which GCC doesn't provide an atomics implementation.

This is a regression in version 1.2.41.

Modified:
    tomcat/jk/trunk/native/common/jk_global.h
    tomcat/jk/trunk/native/configure.ac
    tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/jk/trunk/native/common/jk_global.h
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_global.h?rev=1697985&r1=1697984&r2=1697985&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_global.h (original)
+++ tomcat/jk/trunk/native/common/jk_global.h Wed Aug 26 18:10:46 2015
@@ -433,7 +433,7 @@ typedef int jk_sock_t;
     do {\
         if (InterlockedDecrement(x) < 0) InterlockedIncrement(x);\
     } while (0)
-#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ 
>= 1))
+#elif defined(HAVE_ATOMIC_BUILTINS)
 #define JK_ATOMIC_INCREMENT(x) __sync_add_and_fetch(x, 1)
 #define JK_ATOMIC_DECREMENT(x) \
     do {\

Modified: tomcat/jk/trunk/native/configure.ac
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/configure.ac?rev=1697985&r1=1697984&r2=1697985&view=diff
==============================================================================
--- tomcat/jk/trunk/native/configure.ac (original)
+++ tomcat/jk/trunk/native/configure.ac Wed Aug 26 18:10:46 2015
@@ -439,6 +439,29 @@ JK_CHECK_SASTORAGE
 AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO,1,[Have getaddrinfo()]))
 AC_CHECK_FUNC(gethostbyname_r, AC_DEFINE(HAVE_GETHOSTBYNAME_R,1,[Have 
gethostbyname_r()]))
 
+AC_DEFUN([JK_CHECK_ATOMICS], [
+AC_MSG_CHECKING(whether the compiler provides atomic builtins)
+AC_TRY_RUN([
+int main()
+{
+    unsigned long val = 1010;
+
+    if (__sync_add_and_fetch(&val, 1010) != 2020 || val != 2020)
+        return 1;
+
+    if (__sync_sub_and_fetch(&val, 1010) != 1010 || val != 1010)
+        return 1;
+
+    return 0;
+}
+]
+, [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define to 1 if 
the compiler provides atomic builtins]) ]
+, [ AC_MSG_RESULT([no]) ]
+)
+])dnl
+
+JK_CHECK_ATOMICS
+
 dnl Apache-2.0 needs the os subdirectory to include os.h
 dnl this include is copy from os/config.m4
 sinclude(../support/os_apache.m4)

Modified: tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml?rev=1697985&r1=1697984&r2=1697985&view=diff
==============================================================================
--- tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Wed Aug 26 18:10:46 2015
@@ -41,6 +41,15 @@
   </p>
 </section>
 <section name="Changes between 1.2.41 and 1.2.42">
+  <br />
+  <subsection name="Native">
+    <changelog>
+      <fix>
+        <bug>58285</bug>: Don't use GCC atomics on platforms, for which
+        GCC doesn't provide an atomics implementation. (rjung)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Changes between 1.2.40 and 1.2.41">
   <br />



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to