From 320b0f62319ab7a2bcc026b43ecf104e00784ee5 Mon Sep 17 00:00:00 2001 From: "siddhartha.mahajan" Date: Fri, 24 Jun 2022 05:29:10 +0000 Subject: Import wiredtiger: cec4e577d97ddbb2c87ba676e8644636b6e366ca from branch mongodb-master ref: 1696bc595c..cec4e577d9 for: 6.1.0-rc0 WT-9432 Ensure Evergreen builds have debug information (#8006) --- src/third_party/wiredtiger/cmake/configs/base.cmake | 19 +++++++++++++++++-- src/third_party/wiredtiger/cmake/configs/modes.cmake | 15 +++++++++------ src/third_party/wiredtiger/import.data | 2 +- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/third_party/wiredtiger/cmake/configs/base.cmake b/src/third_party/wiredtiger/cmake/configs/base.cmake index cdfd5abb36f..83dd332dbdb 100644 --- a/src/third_party/wiredtiger/cmake/configs/base.cmake +++ b/src/third_party/wiredtiger/cmake/configs/base.cmake @@ -212,11 +212,26 @@ config_bool( DEFAULT OFF ) +# Setup the WiredTiger build to use Debug settings as unless the build type was explicitly +# configured. Primary users of the build are our developers, who want as much help diagnosing +# issues as possible. Builds targeted for release to customers should switch to a "Release" setting. +set(default_build_type "Debug") +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + # Notify callers that our build chooses Debug, not the default empty + message(STATUS "Defaulting build type to '${default_build_type}'.") + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE + STRING "Type of build selected." FORCE) +endif() + set(default_optimize_level) if("${WT_OS}" STREQUAL "windows") - set(default_optimize_level "/O2") + set(default_optimize_level "/Od") else() - set(default_optimize_level "-O3") + # Ideally this would choose an optimization level of Og. Which is the recommended configuration + # for build-debug cycles when using GCC and is a synonym in clang for O1. + # Unfortunately at the moment, WiredTiger code generates compiler warnings (as errors) when + # built with Og. + set(default_optimize_level "-O1") endif() config_string( CC_OPTIMIZE_LEVEL diff --git a/src/third_party/wiredtiger/cmake/configs/modes.cmake b/src/third_party/wiredtiger/cmake/configs/modes.cmake index 1d0bb897ac1..ee7137874cb 100644 --- a/src/third_party/wiredtiger/cmake/configs/modes.cmake +++ b/src/third_party/wiredtiger/cmake/configs/modes.cmake @@ -130,6 +130,9 @@ else() endif() endif() +# Sanitizer builds should have debug info available and optimization off +set(san_debug_flags "-O1 -g ${no_omit_frame_flag}") + # UBSAN build variant flags. set(ubsan_link_flags "-fsanitize=undefined") set(ubsan_compiler_c_flag "-fsanitize=undefined") @@ -147,22 +150,22 @@ set(tsan_compiler_cxx_flag "-fsanitize=thread") # Define our custom build variants. define_build_mode(ASan - C_COMPILER_FLAGS ${asan_compiler_c_flag} ${no_omit_frame_flag} - CXX_COMPILER_FLAGS ${asan_compiler_cxx_flag} ${no_omit_frame_flag} + C_COMPILER_FLAGS ${asan_compiler_c_flag} ${san_debug_flags} + CXX_COMPILER_FLAGS ${asan_compiler_cxx_flag} ${san_debug_flags} LINK_FLAGS ${asan_link_flags} LIBS ${asan_lib_flags} ) define_build_mode(UBSan - C_COMPILER_FLAGS ${ubsan_compiler_c_flag} ${no_omit_frame_flag} - CXX_COMPILER_FLAGS ${ubsan_compiler_cxx_flag} ${no_omit_frame_flag} + C_COMPILER_FLAGS ${ubsan_compiler_c_flag} ${san_debug_flags} + CXX_COMPILER_FLAGS ${ubsan_compiler_cxx_flag} ${san_debug_flags} LINK_FLAGS ${ubsan_link_flags} # Disable UBSan on MSVC compilers (unsupported). DEPENDS "NOT MSVC" ) define_build_mode(MSan - C_COMPILER_FLAGS ${msan_compiler_c_flag} ${no_omit_frame_flag} + C_COMPILER_FLAGS ${msan_compiler_c_flag} ${san_debug_flags} CXX_COMPILER_FLAGS ${msan_compiler_cxx_flag} LINK_FLAGS ${msan_link_flags} # Disable MSan on MSVC and GNU compilers (unsupported). @@ -170,7 +173,7 @@ define_build_mode(MSan ) define_build_mode(TSan - C_COMPILER_FLAGS ${tsan_compiler_c_flag} ${no_omit_frame_flag} + C_COMPILER_FLAGS ${tsan_compiler_c_flag} ${san_debug_flags} CXX_COMPILER_FLAGS ${tsan_compiler_cxx_flag} LINK_FLAGS ${tsan_link_flags} # Disable TSan on MSVC compilers (unsupported). diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 43f465fec79..7e794490e76 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-master", - "commit": "1696bc595ca30ebeb0c2ecd5170c60b2367c83d2" + "commit": "cec4e577d97ddbb2c87ba676e8644636b6e366ca" } -- cgit v1.2.1