HomePhabricator

fuzz: Configure check for main function

Description

fuzz: Configure check for main function

Summary:
This determines at cmake time if the main needs to be provided rather than relying on the compiler preprocessor definitions.

Backport of core#20065 and core#21080.

Test Plan:

cmake -GNinja .. -DCMAKE_C_COMPILER=afl-gcc \
-DCMAKE_CXX_COMPILER=afl-g++ \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON

Check in the cmake output that all the fuzz target need a main()

ninja bitcoin-fuzzer

cmake -GNinja .. -DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DENABLE_SANITIZERS="fuzzer;address;undefined"

Check in the cmake output that no fuzz target need a main()

ninja bitcoin-fuzzer

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D15140

Details

Provenance
FabienAuthored on Jan 11 2024, 20:51
FabienPushed on Jan 12 2024, 13:43
Reviewer
Restricted Project
Differential Revision
D15140: fuzz: Configure check for main function
Parents
rABCf662f94f685d: Add function to validate difficulty changes
Branches
Unknown
Tags
Unknown