Same as #1517, but for the CMakle build system.
The second commit improves the configure summary (similar to https://github.com/hebasto/bitcoin/pull/189.
Same as #1517, but for the CMakle build system.
The second commit improves the configure summary (similar to https://github.com/hebasto/bitcoin/pull/189.
0@@ -0,0 +1,16 @@
1+include_guard(GLOBAL)
2+include(CheckCSourceCompiles)
3+
4+function(check_memory_sanitizer output)
5+ set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
6+ check_c_source_compiles("
7+ #if defined(__has_feature)
8+ # if __has_feature(memory_sanitizer)
9+ // MemorySanitizer is enabled.
//
comments which are invalid in C89, though that really is more of a philosophical concern.)
nit: We should probably use the same test program on configure and CMake
I’d prefer to align Autotools’ SECP_MSAN_CHECK
code with CMake’s check_memory_sanitizer
to keep the latter straightforward without negated values.
… and perhaps avoid
//
comments which are invalid in C89
Thanks. Fixed.
I’d prefer to align Autotools’
SECP_MSAN_CHECK
code with CMake’scheck_memory_sanitizer
to keep the latter straightforward without negated values.
Fine with that if you want to add a commit that makes them consistent, but then we’ll also need to #error
if !defined(__has_feature)
.
I’d prefer to align Autotools’
SECP_MSAN_CHECK
code with CMake’scheck_memory_sanitizer
to keep the latter straightforward without negated values.Fine with that if you want to add a commit that makes them consistent, but then we’ll also need to
#error
if!defined(__has_feature)
.
Thanks! Fixed.
262@@ -263,6 +263,17 @@ endif()
263
264 set(CMAKE_C_VISIBILITY_PRESET hidden)
265
266+set(print_msan_notice)
267+if(SECP256K1_BUILD_CTIME_TESTS AND CMAKE_C_COMPILER_ID MATCHES "^(Clang|AppleClang)$")
$GCC
check in configure.ac, just to keep the system consistent?
Addressed comments:
avoid
//
comments which are invalid in C89
Actually, why are you hard coding compiler IDs at all? This just makes things less flexible, and the check should be enough.
Clang >= 16 has `-fsanitize-memory-param-retval` turned on by default,
which is incompatible with
This change makes both Autotools and CMake build systems consistent.
Addressed comments:
… to add a commit that makes them consistent, but then we’ll also need to
#error
if!defined(__has_feature)
.
… to add a commit that also removes the $GCC check in configure.ac, just to keep the system consistent