mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
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)
This commit is contained in:
parent
7bfda275a1
commit
66fd45afce
12 changed files with 40 additions and 46 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue