@@ -30,16 +30,11 @@ option(ASAN_WITH_LSAN "enable leak sanitizer while address sanitizer is enabled"
3030option (ENABLE_STATIC_LIBSTDCXX "link kvrocks with static library of libstd++ instead of shared library" ON )
3131option (ENABLE_LUAJIT "enable use of luaJIT instead of lua" ON )
3232option (ENABLE_OPENSSL "enable openssl to support tls connection" OFF )
33- option (ENABLE_LTO "enable link-time optimization" ON )
33+ option (ENABLE_LTO "enable link-time optimization" OFF )
3434set (SYMBOLIZE_BACKEND "" CACHE STRING "symbolization backend library for cpptrace (libbacktrace, libdwarf, or empty)" )
3535set (PORTABLE 0 CACHE STRING "build a portable binary (disable arch-specific optimizations)" )
3636option (ENABLE_NEW_ENCODING "enable new encoding (#1033) for storing 64bit size and expire time in milliseconds" ON )
3737
38- # to save build time in debug mode
39- if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
40- set (ENABLE_LTO OFF )
41- endif ()
42-
4338if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0" )
4439 cmake_policy (SET CMP0135 NEW )
4540endif ()
@@ -144,7 +139,6 @@ endif()
144139
145140if (CMAKE_HOST_APPLE )
146141 set (DISABLE_JEMALLOC ON )
147- set (ENABLE_LTO OFF )
148142endif ()
149143
150144if (NOT DISABLE_JEMALLOC)
@@ -298,17 +292,6 @@ else()
298292 target_compile_definitions (kvrocks_objs PUBLIC METADATA_ENCODING_VERSION=0 )
299293endif ()
300294
301- # disable LTO on ARM due to toolchain stability issues
302- string (TOLOWER "${CMAKE_SYSTEM_PROCESSOR} " CMAKE_SYSTEM_PROCESSOR_LOWER)
303- if (CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "^(aarch64|arm64|arm)" )
304- set (ENABLE_LTO OFF )
305- endif ()
306-
307- # disable LTO on GCC <= 9 due to an ICE
308- if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10))
309- set (ENABLE_LTO OFF )
310- endif ()
311-
312295if (ENABLE_LTO)
313296 include (CheckIPOSupported )
314297 check_ipo_supported (RESULT ipo_result OUTPUT ipo_output LANGUAGES CXX )
0 commit comments