diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-11-05 17:03:30 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-05 06:33:39 +0000 |
commit | aaae2fd469009f0a424d1788e5ecaf7ad6a5a785 (patch) | |
tree | 0eceff79322e028b6c32a46989867f2d9086d6fe | |
parent | f9339e9fddf54e7f7f731968b11c4d5df77b5e78 (diff) | |
download | mongo-aaae2fd469009f0a424d1788e5ecaf7ad6a5a785.tar.gz |
Import wiredtiger: 5339c184e86d5bc64706b5d7c6fd60ccd5cf60e5 from branch mongodb-master
ref: 65c277f3b7..5339c184e8
for: 5.2.0
WT-8336 Disable unsafe-loop-optimizations flag when compiling c++ files
4 files changed, 27 insertions, 19 deletions
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/strict.m4 b/src/third_party/wiredtiger/build_posix/aclocal/strict.m4 index af1947818dd..4159eea0e4b 100644 --- a/src/third_party/wiredtiger/build_posix/aclocal/strict.m4 +++ b/src/third_party/wiredtiger/build_posix/aclocal/strict.m4 @@ -26,9 +26,8 @@ AC_DEFUN([AM_GCC_WARNINGS], [ w="$w -Wwrite-strings" # Non-fatal informational warnings. - # We don't turn on the unsafe-loop-optimizations warning after gcc7, - # it's too noisy to tolerate. Regardless, don't fail even when it's - # configured. + # The unsafe-loop-optimizations warning is only enabled for specific gcc versions. + # Regardless, don't fail when it's configured. w="$w -Wno-error=unsafe-loop-optimizations" # GCC 4.7 @@ -40,13 +39,10 @@ AC_DEFUN([AM_GCC_WARNINGS], [ gcc8=0 case "$1" in [*4.7.[0-9]*]) # gcc4.7 - w="$w -Wno-c11-extensions" - w="$w -Wunsafe-loop-optimizations";; + w="$w -Wno-c11-extensions";; [*5.[0-9].[0-9]*]) # gcc5.X - w="$w -Wunsafe-loop-optimizations" gcc5=1;; [*6.[0-9].[0-9]*]) # gcc6.X - w="$w -Wunsafe-loop-optimizations" gcc5=1 gcc6=1;; [*7.[0-9].[0-9]*]) # gcc7.X @@ -102,6 +98,17 @@ AC_DEFUN([AM_GCC_WARNINGS], [ w_c="$w_c -Wpointer-sign" w_c="$w_c -Wstrict-prototypes" + # We only turn on the unsafe-loop-optimizations warning before gcc7, + # it's too noisy to tolerate otherwise. + case "$1" in + [*4.7.[0-9]*]) # gcc4.7 + w_c="$w_c -Wunsafe-loop-optimizations";; + [*5.[0-9].[0-9]*]) # gcc5.X + w_c="$w_c -Wunsafe-loop-optimizations";; + [*6.[0-9].[0-9]*]) # gcc6.X + w_c="$w_c -Wunsafe-loop-optimizations";; + esac + wt_c_strict_warnings="$w_c" wt_cxx_strict_warnings="$w_cxx" ]) diff --git a/src/third_party/wiredtiger/cmake/strict/gcc_strict.cmake b/src/third_party/wiredtiger/cmake/strict/gcc_strict.cmake index d15e065cc91..5a894fcd595 100644 --- a/src/third_party/wiredtiger/cmake/strict/gcc_strict.cmake +++ b/src/third_party/wiredtiger/cmake/strict/gcc_strict.cmake @@ -30,4 +30,14 @@ list(APPEND gcc_flags "-Wold-style-definition") list(APPEND gcc_flags "-Wpointer-sign") list(APPEND gcc_flags "-Wstrict-prototypes") +# We only turn on the unsafe-loop-optimizations warning before gcc7, +# it's too noisy to tolerate otherwise. +if(${CMAKE_C_COMPILER_VERSION} VERSION_EQUAL 4.7) + list(APPEND gcc_flags "-Wunsafe-loop-optimizations") +elseif(${CMAKE_C_COMPILER_VERSION} VERSION_EQUAL 5) + list(APPEND gcc_flags "-Wunsafe-loop-optimizations") +elseif(${CMAKE_C_COMPILER_VERSION} VERSION_EQUAL 6) + list(APPEND gcc_flags "-Wunsafe-loop-optimizations") +endif() + set(COMPILER_DIAGNOSTIC_C_FLAGS ${gcc_flags}) diff --git a/src/third_party/wiredtiger/cmake/strict/strict_flags_helpers.cmake b/src/third_party/wiredtiger/cmake/strict/strict_flags_helpers.cmake index 8abfe950416..8b400f4cc7d 100644 --- a/src/third_party/wiredtiger/cmake/strict/strict_flags_helpers.cmake +++ b/src/third_party/wiredtiger/cmake/strict/strict_flags_helpers.cmake @@ -58,22 +58,13 @@ function(get_gnu_base_flags flags) list(APPEND gnu_flags "-Wwrite-strings") # Non-fatal informational warnings. - # We don't turn on the unsafe-loop-optimizations warning after gcc7, - # it's too noisy to tolerate. Regardless, don't fail even when it's - # configured. + # The unsafe-loop-optimizations warning is only enabled for specific gcc versions. + # Regardless, don't fail when it's configured. list(APPEND gnu_flags "-Wno-error=unsafe-loop-optimizations") - # Create a function to return the base flags! - # We cannot return a value, pass in a parent variable, the function will set it. if(${cmake_compiler_version} VERSION_EQUAL 4.7) list(APPEND gnu_flags "-Wno-c11-extensions") - list(APPEND gnu_flags "-Wunsafe-loop-optimizations") - elseif(${cmake_compiler_version} VERSION_EQUAL 5) - list(APPEND gnu_flags "-Wunsafe-loop-optimizations") - elseif(${cmake_compiler_version} VERSION_EQUAL 6) - list(APPEND gnu_flags "-Wunsafe-loop-optimizations") endif() - if(${cmake_compiler_version} VERSION_GREATER_EQUAL 5) list(APPEND gnu_flags "-Wformat-signedness") list(APPEND gnu_flags "-Wunused-macros") diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 7f3750d626c..cfca5b7b9b6 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": "65c277f3b719a440f51fb63315d9737344f894d3" + "commit": "5339c184e86d5bc64706b5d7c6fd60ccd5cf60e5" } |