diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-06-08 21:06:56 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-06-16 23:58:21 +0200 |
commit | 66fd45afce1ba5e1032c32cc891c09d64fa38d9e (patch) | |
tree | b938649a3769b4163cd813af72ebb74ab68dff6a /configure.cmake | |
parent | 7bfda275a1b9a4759fcb3dbef4736b1094c892d2 (diff) | |
download | mariadb-git-66fd45afce1ba5e1032c32cc891c09d64fa38d9e.tar.gz |
MDEV-7398 mysqld segfaults on FreeBSD 10.1 i386 when built with clang 3.4
in cmake tests let's treat clang like gcc (same options,
same builtins) in many cases.
* don't check the compiler when
* testing for -fvisibility=hidden support
* testing for HAVE_ABI_CXA_DEMANGLE
* testing for HAVE_GCC_ATOMIC_BUILTINS
* when removing options with string(replace)
* when running ${CC} --version (ignore the error instead)
* run ABI checks for clang
* use "canonical" gcc flags for clang
* fix groonga too
Also:
* add cmake detection for gcc __atomic_* builtins. they might be
supported (__ATOMIC_SEQ_CST is defined), but not for all operand
sizes. In particular, 64-bit atomic load is problematic on i386
* cache check results for Windows
* remove the test for HAVE_CXXABI_H (HAVE_ABI_CXA_DEMANGLE is
suffifient)
Diffstat (limited to 'configure.cmake')
-rw-r--r-- | configure.cmake | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/configure.cmake b/configure.cmake index 215b0dc32b4..fb127688bd2 100644 --- a/configure.cmake +++ b/configure.cmake @@ -52,7 +52,7 @@ IF(NOT SYSTEM_TYPE) ENDIF() ENDIF() -IF(CMAKE_COMPILER_IS_GNUCXX) +IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") # MySQL "canonical" GCC flags. At least -fno-rtti flag affects # ABI and cannot be simply removed. SET(CMAKE_CXX_FLAGS @@ -175,7 +175,6 @@ CHECK_INCLUDE_FILES (alloca.h HAVE_ALLOCA_H) CHECK_INCLUDE_FILES (aio.h HAVE_AIO_H) CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H) -CHECK_INCLUDE_FILE_CXX (cxxabi.h HAVE_CXXABI_H) CHECK_INCLUDE_FILES (bfd.h BFD_H_EXISTS) CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H) CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H) @@ -874,7 +873,7 @@ ENDIF(NOT HAVE_POSIX_SIGNALS) # Assume regular sprintf SET(SPRINTFS_RETURNS_INT 1) -IF(CMAKE_COMPILER_IS_GNUCXX AND HAVE_CXXABI_H) +IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") CHECK_CXX_SOURCE_COMPILES(" #include <cxxabi.h> int main(int argc, char **argv) @@ -946,7 +945,6 @@ SET(SIGNAL_WITH_VIO_CLOSE 1) MARK_AS_ADVANCED(NO_ALARM) -IF(CMAKE_COMPILER_IS_GNUCXX) IF(WITH_ATOMIC_OPS STREQUAL "up") SET(MY_ATOMIC_MODE_DUMMY 1 CACHE BOOL "Assume single-CPU mode, no concurrency") ELSEIF(WITH_ATOMIC_OPS STREQUAL "rwlocks") @@ -977,10 +975,17 @@ ELSEIF(NOT WITH_ATOMIC_OPS) 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); + }" + HAVE_GCC_C11_ATOMICS) ELSE() MESSAGE(FATAL_ERROR "${WITH_ATOMIC_OPS} is not a valid value for WITH_ATOMIC_OPS!") ENDIF() -ENDIF() SET(WITH_ATOMIC_OPS "${WITH_ATOMIC_OPS}" CACHE STRING "Implement atomic operations using pthread rwlocks (rwlocks); or atomic CPU |