@@ -137,19 +137,6 @@ endif ()
137137include (cmake/check_flags.cmake )
138138include (cmake/add_warning.cmake )
139139
140- # generate ranges for fast "addr2line" search
141- if (NOT CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE" )
142- # NOTE: that clang has a bug because of it does not emit .debug_aranges
143- # with ThinLTO, so custom ld.lld wrapper is shipped in docker images.
144- set (COMPILER_FLAGS "${COMPILER_FLAGS} -gdwarf-aranges" )
145- endif ()
146-
147- # See https://blog.llvm.org/posts/2021-04-05-constructor-homing-for-debug-info/
148- if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO" )
149- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fuse-ctor-homing" )
150- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Xclang -fuse-ctor-homing" )
151- endif ()
152-
153140option (ENABLE_TESTS "Provide unit_test_dbms target with Google.Test unit tests" ON )
154141option (ENABLE_EXAMPLES "Build all example programs in 'examples' subdirectories" OFF )
155142option (ENABLE_BENCHMARKS "Build all benchmark programs in 'benchmarks' subdirectories" OFF )
@@ -288,10 +275,6 @@ set (CMAKE_C_STANDARD 11)
288275set (CMAKE_C_EXTENSIONS ON ) # required by most contribs written in C
289276set (CMAKE_C_STANDARD_REQUIRED ON )
290277
291- # Enable C++14 sized global deallocation functions. It should be enabled by setting -std=c++14 but I'm not sure.
292- # See https://reviews.llvm.org/D112921
293- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsized-deallocation" )
294-
295278# falign-functions=64 prevents from random performance regressions with the code change. Thus, providing more stable benchmarks.
296279set (COMPILER_FLAGS "${COMPILER_FLAGS} -falign-functions=64" )
297280
@@ -310,6 +293,18 @@ if (DISABLE_ALL_DEBUG_SYMBOLS)
310293 set (DEBUG_INFO_FLAGS "-g0" )
311294endif ()
312295
296+ if (OS_DARWIN)
297+ # On Darwin the optimizatiosns to reduce the debug size are off by default. `-fno-standalone-debug` enables them
298+ set (DEBUG_INFO_FLAGS "${DEBUG_INFO_FLAGS} -fno-standalone-debug" )
299+ endif ()
300+
301+ # generate ranges for fast "addr2line" search
302+ if (NOT CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE" )
303+ # NOTE: that clang has a bug because of it does not emit .debug_aranges
304+ # with ThinLTO, so custom ld.lld wrapper is shipped in docker images.
305+ set (DEBUG_INFO_FLAGS "${DEBUG_INFO_FLAGS} -gdwarf-aranges" )
306+ endif ()
307+
313308# Disable omit frame pointer compiler optimization using -fno-omit-frame-pointer
314309option (DISABLE_OMIT_FRAME_POINTER "Disable omit frame pointer compiler optimization" OFF )
315310
0 commit comments