diff --git a/cmake/build_configurations/compiler_options.cmake b/cmake/build_configurations/compiler_options.cmake index 50198e8ac63a..58b37e52a7d8 100644 --- a/cmake/build_configurations/compiler_options.cmake +++ b/cmake/build_configurations/compiler_options.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2020, 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, version 2.0, @@ -71,6 +71,12 @@ IF(UNIX) SET(COMMON_CXX_FLAGS "-std=c++14 -fno-omit-frame-pointer") ENDIF() + # Faster TLS model + IF(MY_COMPILER_IS_GNU_OR_CLANG AND NOT SOLARIS) + STRING_APPEND(COMMON_C_FLAGS " -ftls-model=initial-exec") + STRING_APPEND(COMMON_CXX_FLAGS " -ftls-model=initial-exec") + ENDIF() + # Solaris flags IF(SOLARIS) # Link mysqld with mtmalloc on Solaris 10 and later