aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2023-02-04 18:30:36 -0500
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-06 20:05:03 +0000
commit582904fdde86be25dfc5ee1a4f5385444c214678 (patch)
tree0a5081afddd96ef83aae20a9b6b9a4b2c9f48ec3 /CMakeLists.txt
parentdb98becc488393f735790ada8b1214cb4b8c58a5 (diff)
downloadboringssl-582904fdde86be25dfc5ee1a4f5385444c214678.zip
boringssl-582904fdde86be25dfc5ee1a4f5385444c214678.tar.gz
boringssl-582904fdde86be25dfc5ee1a4f5385444c214678.tar.bz2
Move malloc failure testing into OPENSSL_malloc
Rather than trying to override the actual malloc symbol, just intercept OPENSSL_malloc and gate it on a build flag. (When we first wrote these, OPENSSL_malloc was just an alias for malloc.) This has several benefits: - This is cross platform. We don't interfere with sanitizers or the libc, or have to mess with global symbols. - This removes the reason bssl_shim and handshaker linked test_support_lib, so we can fix the tes_support_lib / gtest dependency. - If we ever reduce the scope of fallible mallocs, we'll want to constrain the tests to only the ones that are fallible. An interception strategy like this can do it. Hopefully that will also take less time to run in the future. Also fix the ssl malloc failure tests, as they haven't been working for a while. (Malloc failure tests still take far too long to run to the end though. My immediate motivation is less malloc failure and more to tidy up the build.) Bug: 563 Change-Id: I32165b8ecbebfdcfde26964e06a404762edd28e3 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/56925 Commit-Queue: Bob Beck <bbe@google.com> Reviewed-by: Bob Beck <bbe@google.com> Auto-Submit: David Benjamin <davidben@google.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 536d83e..e0808d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -364,6 +364,10 @@ if(CONSTANT_TIME_VALIDATION)
add_definitions(-DNDEBUG)
endif()
+if(MALLOC_FAILURE_TESTING)
+ add_definitions(-DBORINGSSL_MALLOC_FAILURE_TESTING)
+endif()
+
function(go_executable dest package)
set(godeps "${CMAKE_SOURCE_DIR}/util/godeps.go")
if(NOT CMAKE_GENERATOR STREQUAL "Ninja")