aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormerge-script <fanquake@gmail.com>2024-09-10 11:48:36 +0100
committermerge-script <fanquake@gmail.com>2024-09-10 11:48:36 +0100
commite4fb97a5127ee767af7cbfab3ee07a18514bda1c (patch)
tree2830cd3cf038e900886334bfdb707111b4e301f0 /src
parentdf3f63ccfa0338ee38644b4a3c48f721fc28c2a2 (diff)
parent2d68c3b1c2e4f8fb881efc3569506d426ee5155d (diff)
Merge bitcoin/bitcoin#30791: build: Use correct variable name
2d68c3b1c2e4f8fb881efc3569506d426ee5155d build: Use correct variables when passing `-fsanitize` to libsecp256k1 (Hennadii Stepanov) Pull request description: This was overlooked after https://github.com/bitcoin-core/secp256k1/pull/1546. Also see: - https://github.com/bitcoin-core/secp256k1/pull/1600 - https://github.com/bitcoin/bitcoin/pull/30845 - https://github.com/hebasto/oss-fuzz/pull/9 ACKs for top commit: fanquake: ACK 2d68c3b1c2e4f8fb881efc3569506d426ee5155d Tree-SHA512: 1a149e2072fd471c3af2f8591ccd69bddc8060eb04246c7f5596d179608fb097293c4c7b17f237fcf9014d8fc1ddc727497554fa9535777243ac989672ab1a75
Diffstat (limited to 'src')
-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)