build: Do not define PROVIDE_FUZZ_MAIN_FUNCTION macro unconditionally#24337
build: Do not define PROVIDE_FUZZ_MAIN_FUNCTION macro unconditionally#24337fanquake merged 1 commit intobitcoin:masterfrom
PROVIDE_FUZZ_MAIN_FUNCTION macro unconditionally#24337Conversation
|
Do you think that the fuzz task timeout is caused by this PR change? |
|
No |
|
This should be combined with the |
|
A third refacotring alternative might be to remove it. Then, call |
|
Updated 4a1e159 -> 7e7ae42 (pr24337.01 -> pr24337.02).
Chosen the former suggestion as it assumes minimal diff. |
|
Updated 7e7ae42 -> 8d0683d (pr24337.02 -> pr24337.03): reverted back and rebased.
Doesn't work. Fails with "multiple definition of `main'" error.
Doesn't work. The |
|
I mean: |
PROVIDE_FUZZ_MAIN_FUNCTION macro only when neededPROVIDE_FUZZ_MAIN_FUNCTION macro unconditionally
Thanks! Done: 8d0683d -> 121c4ba (pr24337.03 -> pr24337.04). |
Reverted back due to the CI failures. |
That's because it incorrectly uses a previously cached, but unrelated result. You can work around that with: diff --git a/configure.ac b/configure.ac
index b7852ae3b5..efdeb186c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1300,7 +1300,7 @@ fi
if test "$enable_fuzz_binary" = "yes"; then
AC_MSG_CHECKING([whether main function is needed for fuzz binary])
AX_CHECK_LINK_FLAG(
- [-fsanitize=$use_sanitizers],
+ [-fsanitize= -fsanitize=$use_sanitizers],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes]); CPPFLAGS="$CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"],
[], |
|
See https://cirrus-ci.com/task/6160465456791552?logs=ci#L2772
|
Yeap, |
|
Updated 8d0683d -> c0a089b (pr24337.03 -> pr24337.05):
|
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Rebased c0a089b -> 3ec7dc7 (pr24337.05 -> pr24337.06). |
|
Updated 3ec7dc7 -> c9c4e6c (pr24337.06 -> pr24337.07, diff): |
|
Approach ACK c9c4e6c did not review or test 🐤 Show signatureSignature: |
…` macro unconditionally c9c4e6c build: Do not define `PROVIDE_FUZZ_MAIN_FUNCTION` macro unconditionally (Hennadii Stepanov) Pull request description: No need to define the `PROVIDE_FUZZ_MAIN_FUNCTION` macro when the build system has been configured with the `--disable-fuzz-binary` option. See bitcoin#24336 (review). ACKs for top commit: MarcoFalke: Approach ACK c9c4e6c did not review or test 🐤 fanquake: ACK c9c4e6c Checked that `PROVIDE_FUZZ_MAIN_FUNCTION` isn't defined when configuring with `--disable-fuzz-binary`. Tree-SHA512: 54fbf02ba9f5ecc61b176b8ea7d05e308788d4de3f97ed40913e731300d9dc0edfdfcbf8e0a6e74cf1b2e2ae63f6208a34e03b9c8d203d070c457c4a7d9b5f2c
No need to define the
PROVIDE_FUZZ_MAIN_FUNCTIONmacro when the build system has been configured with the--disable-fuzz-binaryoption.See #24336 (review).