diff options
author | David Benjamin <davidben@google.com> | 2024-03-17 12:04:45 +1000 |
---|---|---|
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-03-17 22:57:54 +0000 |
commit | b85a0d1ebe76d80986708ce3a8faa120d49ef8fe (patch) | |
tree | 3adbb43f82b908b4d039636f2d663157d310e73b /CMakeLists.txt | |
parent | c38abd038c6d6f6ebbe200090821e23313c4bd9c (diff) | |
download | boringssl-b85a0d1ebe76d80986708ce3a8faa120d49ef8fe.zip boringssl-b85a0d1ebe76d80986708ce3a8faa120d49ef8fe.tar.gz boringssl-b85a0d1ebe76d80986708ce3a8faa120d49ef8fe.tar.bz2 |
Gate -Wframe-larger-than on Clang 13
This is a somewhat speculative fix for https://crbug.com/boringssl/709.
Fixed: 709
Change-Id: I7ace65ca86048a04994fef7811527423af70e933
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67087
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0af8052..5d5e0ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,7 +141,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG) endif() if(CLANG) - set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wnewline-eof -fcolor-diagnostics -Wframe-larger-than=25344") + set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wnewline-eof -fcolor-diagnostics") else() # GCC (at least 4.8.4) has a bug where it'll find unreachable free() calls # and declare that the code is trying to free a stack pointer. @@ -158,6 +158,18 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG) set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wstring-concatenation") endif() + # Clang 12's -Wframe-larger-than reportedly does not work in clang-cl. See + # https://crbug.com/boringssl/709. Clang 13 includes the following fix, which + # may be related. Speculatively gate on Clang 13. That corresponds to + # AppleClang 13.1.6. + # https://github.com/llvm/llvm-project/commit/6aaf4fa2885600b0e31042071ad06f78218ab0f2 + if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND + CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "13.0.0") OR + (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND + CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "13.1.6")) + set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wframe-larger-than=25344") + endif() + if(CLANG OR CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0.0") set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wimplicit-fallthrough") endif() |