Create an appropriate build config:
% tools/mb/mb.py gen -m chromium.fuzz -b 'Libfuzzer Upload Linux ASan' out/libfuzzer % gn gen out/libfuzzer
Build the fuzz target:
% ninja -C out/libfuzzer $TEST_NAME
Create an empty corpus directory:
% mkdir ${TEST_NAME}_corpus
Run the fuzz target, turning off detection of ODR violations that occur in component builds:
% export ASAN_OPTIONS=detect_odr_violation=0 % ./out/libfuzzer/$TEST_NAME ${TEST_NAME}_corpus
For more details, refer to https://chromium.googlesource.com/chromium/src/testing/libfuzzer/+/refs/heads/master/getting_started.md