Skip to content

Commit bc8283b

Browse files
committed
build: Use correct variables when passing -fsanitize to libsecp256k1
This was overlooked after bitcoin-core/secp256k1#1546
1 parent ff54395 commit bc8283b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ set(SECP256K1_BUILD_EXHAUSTIVE_TESTS ${BUILD_TESTS} CACHE BOOL "" FORCE)
5252
set(SECP256K1_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
5353
include(GetTargetInterface)
5454
# -fsanitize and related flags apply to both C++ and C,
55-
# so we can pass them down to libsecp256k1 as CFLAGS.
55+
# so we can pass them down to libsecp256k1 as CFLAGS and LDFLAGS.
5656
get_target_interface(core_sanitizer_cxx_flags "" sanitize_interface COMPILE_OPTIONS)
57-
set(SECP256K1_LATE_CFLAGS ${core_sanitizer_cxx_flags} CACHE STRING "" FORCE)
57+
set(SECP256K1_APPEND_CFLAGS ${core_sanitizer_cxx_flags} CACHE STRING "" FORCE)
5858
unset(core_sanitizer_cxx_flags)
59+
get_target_interface(core_sanitizer_linker_flags "" sanitize_interface LINK_OPTIONS)
60+
set(SECP256K1_APPEND_LDFLAGS ${core_sanitizer_linker_flags} CACHE STRING "" FORCE)
61+
unset(core_sanitizer_linker_flags)
5962
# We want to build libsecp256k1 with the most tested RelWithDebInfo configuration.
6063
enable_language(C)
6164
foreach(config IN LISTS CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES)

0 commit comments

Comments
 (0)