diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 18efa58b2a3..c3cb0ce94c6 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -1,4 +1,5 @@ # Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019, MariaDB Corporation. # # 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 @@ -74,6 +75,12 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG -DUNIV_SYNC_DEB CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU) IF(NOT MSVC) + # Work around MDEV-18417, MDEV-18656, MDEV-18417 + IF(WITH_ASAN AND CMAKE_COMPILER_IS_GNUCC AND + CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0") + SET_SOURCE_FILES_PROPERTIES(trx/trx0rec.cc PROPERTIES COMPILE_FLAGS -O1) + ENDIF() + # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not # workaround for old gcc on x86, gcc atomic ops only work under -march=i686 IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND