aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-09-02 16:33:04 +0100
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-09-09 15:46:57 +0100
commit2d68c3b1c2e4f8fb881efc3569506d426ee5155d (patch)
tree44cac37abe109bb715cfaa8260e0ff2db8304329
parentdf86a4f333e13a4799945ba79e572ccfefff2283 (diff)
downloadbitcoin-2d68c3b1c2e4f8fb881efc3569506d426ee5155d.tar.xz
build: Use correct variables when passing `-fsanitize` to libsecp256k1
This was overlooked after https://github.com/bitcoin-core/secp256k1/pull/1546
-rw-r--r--src/CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4fe3793b81..9a76fe1eec 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -52,10 +52,13 @@ set(SECP256K1_BUILD_EXHAUSTIVE_TESTS ${BUILD_TESTS} CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
include(GetTargetInterface)
# -fsanitize and related flags apply to both C++ and C,
-# so we can pass them down to libsecp256k1 as CFLAGS.
+# so we can pass them down to libsecp256k1 as CFLAGS and LDFLAGS.
get_target_interface(core_sanitizer_cxx_flags "" sanitize_interface COMPILE_OPTIONS)
-set(SECP256K1_LATE_CFLAGS ${core_sanitizer_cxx_flags} CACHE STRING "" FORCE)
+set(SECP256K1_APPEND_CFLAGS ${core_sanitizer_cxx_flags} CACHE STRING "" FORCE)
unset(core_sanitizer_cxx_flags)
+get_target_interface(core_sanitizer_linker_flags "" sanitize_interface LINK_OPTIONS)
+set(SECP256K1_APPEND_LDFLAGS ${core_sanitizer_linker_flags} CACHE STRING "" FORCE)
+unset(core_sanitizer_linker_flags)
# We want to build libsecp256k1 with the most tested RelWithDebInfo configuration.
enable_language(C)
foreach(config IN LISTS CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES)