summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bindar <robert@mariadb.org>2019-07-01 13:21:07 +0300
committerRobert Bindar <robert@mariadb.org>2019-07-03 12:11:22 +0300
commite8392e58b2a5a69f9c0bd5b5aed90348b4a0ccb3 (patch)
tree3506325a01a0c06c154cf14bdc762311693e5c3d
parent3acf74105175d4c909e0ea8e969f3d78bfc5f7af (diff)
downloadmariadb-git-e8392e58b2a5a69f9c0bd5b5aed90348b4a0ccb3.tar.gz
MDEV-19696 - Cleanup gcc sync builtins
Since 10.4 requires C++11 capable compiler, gcc sync builtins became dead code. Remove relevant cmake checks and cleanup include files.
-rw-r--r--cmake/os/WindowsCache.cmake1
-rw-r--r--config.h.cmake1
-rw-r--r--configure.cmake24
-rw-r--r--include/atomic/gcc_sync.h106
-rw-r--r--include/my_atomic.h2
5 files changed, 0 insertions, 134 deletions
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake
index 0f6537765c2..4ba36dc494d 100644
--- a/cmake/os/WindowsCache.cmake
+++ b/cmake/os/WindowsCache.cmake
@@ -299,7 +299,6 @@ SET(HAVE_SYS_UTSNAME_H CACHE INTERNAL "")
SET(HAVE_PTHREAD_ATTR_GETGUARDSIZE CACHE INTERNAL "")
SET(HAVE_SOCKPEERCRED CACHE INTERNAL "")
SET(HAVE_ABI_CXA_DEMANGLE CACHE INTERNAL "")
-SET(HAVE_GCC_ATOMIC_BUILTINS CACHE INTERNAL "")
SET(HAVE_GCC_C11_ATOMICS CACHE INTERNAL "")
SET(HAVE_VISIBILITY_HIDDEN CACHE INTERNAL "")
ENDIF(MSVC)
diff --git a/config.h.cmake b/config.h.cmake
index 7ff54bef069..b15f7b57a2b 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -380,7 +380,6 @@
#cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1
-#cmakedefine HAVE_GCC_ATOMIC_BUILTINS 1
#cmakedefine HAVE_GCC_C11_ATOMICS 1
#cmakedefine HAVE_SOLARIS_ATOMIC 1
#cmakedefine HAVE_DECL_SHM_HUGETLB 1
diff --git a/configure.cmake b/configure.cmake
index bef4d3c1505..6b8bbed636e 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -862,30 +862,6 @@ MARK_AS_ADVANCED(NO_ALARM)
CHECK_CXX_SOURCE_COMPILES("
int main()
{
- int foo= -10; int bar= 10;
- long long int foo64= -10; long long int bar64= 10;
- if (!__sync_fetch_and_add(&foo, bar) || foo)
- return -1;
- bar= __sync_lock_test_and_set(&foo, bar);
- if (bar || foo != 10)
- return -1;
- bar= __sync_val_compare_and_swap(&bar, foo, 15);
- if (bar)
- return -1;
- if (!__sync_fetch_and_add(&foo64, bar64) || foo64)
- return -1;
- bar64= __sync_lock_test_and_set(&foo64, bar64);
- if (bar64 || foo64 != 10)
- return -1;
- bar64= __sync_val_compare_and_swap(&bar64, foo, 15);
- if (bar64)
- return -1;
- return 0;
-}"
-HAVE_GCC_ATOMIC_BUILTINS)
-CHECK_CXX_SOURCE_COMPILES("
-int main()
-{
long long int var= 1;
long long int *ptr= &var;
return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
diff --git a/include/atomic/gcc_sync.h b/include/atomic/gcc_sync.h
deleted file mode 100644
index 82eea35b2ce..00000000000
--- a/include/atomic/gcc_sync.h
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifndef GCC_SYNC_INCLUDED
-#define GCC_SYNC_INCLUDED
-
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/* Old GCC __sync builtins introduced in GCC 4.1 */
-
-static inline int my_atomic_cas32(int32 volatile *a, int32 *cmp, int32 set)
-{
- int32 cmp_val= *cmp;
- int32 sav= __sync_val_compare_and_swap(a, cmp_val, set);
- int ret= (sav == cmp_val);
- if (!ret)
- *cmp = sav;
- return ret;
-}
-
-static inline int my_atomic_cas64(int64 volatile *a, int64 *cmp, int64 set)
-{
- int64 cmp_val= *cmp;
- int64 sav= __sync_val_compare_and_swap(a, cmp_val, set);
- int ret= (sav == cmp_val);
- if (!ret)
- *cmp = sav;
- return ret;
-}
-
-static inline int my_atomic_casptr(void * volatile *a, void **cmp, void *set)
-{
- void *cmp_val= *cmp;
- void *sav= __sync_val_compare_and_swap(a, cmp_val, set);
- int ret= (sav == cmp_val);
- if (!ret)
- *cmp = sav;
- return ret;
-}
-
-static inline int32 my_atomic_add32(int32 volatile *a, int32 v)
-{
- return __sync_fetch_and_add(a, v);
-}
-
-static inline int64 my_atomic_add64(int64 volatile *a, int64 v)
-{
- return __sync_fetch_and_add(a, v);
-}
-
-static inline int32 my_atomic_fas32(int32 volatile *a, int32 v)
-{
- return __sync_lock_test_and_set(a, v);
-}
-
-static inline int64 my_atomic_fas64(int64 volatile *a, int64 v)
-{
- return __sync_lock_test_and_set(a, v);
-}
-
-static inline void * my_atomic_fasptr(void * volatile *a, void * v)
-{
- return __sync_lock_test_and_set(a, v);
-}
-
-static inline int32 my_atomic_load32(int32 volatile *a)
-{
- return __sync_fetch_and_or(a, 0);
-}
-
-static inline int64 my_atomic_load64(int64 volatile *a)
-{
- return __sync_fetch_and_or(a, 0);
-}
-
-static inline void* my_atomic_loadptr(void * volatile *a)
-{
- return __sync_fetch_and_or(a, 0);
-}
-
-static inline void my_atomic_store32(int32 volatile *a, int32 v)
-{
- (void) __sync_lock_test_and_set(a, v);
-}
-
-static inline void my_atomic_store64(int64 volatile *a, int64 v)
-{
- (void) __sync_lock_test_and_set(a, v);
-}
-
-static inline void my_atomic_storeptr(void * volatile *a, void *v)
-{
- (void) __sync_lock_test_and_set(a, v);
-}
-
-#endif /* GCC_SYNC_INCLUDED */
diff --git a/include/my_atomic.h b/include/my_atomic.h
index 19983daed04..1c54c24d455 100644
--- a/include/my_atomic.h
+++ b/include/my_atomic.h
@@ -112,8 +112,6 @@
#include "atomic/solaris.h"
#elif defined(HAVE_GCC_C11_ATOMICS)
#include "atomic/gcc_builtins.h"
-#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
-#include "atomic/gcc_sync.h"
#endif
#if SIZEOF_LONG == 4