Page MenuHomePhabricator

fuzz: Configure check for main function
ClosedPublic

Authored by Fabien on Jan 11 2024, 20:52.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCdb55c8d2cc09: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable