Files
verilator/nodist/fuzzer/setup_user
T

31 lines
872 B
Bash
Raw Normal View History

2019-10-16 22:18:35 -04:00
#!/bin/bash
######################################################################
# DESCRIPTION: Fuzzer setup to be run as a normal user
#
# SPDX-FileCopyrightText: 2019 Eric Rippey
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
2019-10-16 22:18:35 -04:00
######################################################################
# This is the portion of the setup for fuzzing that does not require root access.
set -e
# Build instrumented version of verilator
pushd ../..
autoconf
2025-10-07 18:37:42 +02:00
AFL_HARDEN=1 CXX=afl-g++ ./configure $(cd ..; pwd)
2019-10-16 22:18:35 -04:00
make clean
make -j $(ncpus)
popd
# Create a listing of likely snippets for the fuzzer to use.
# Not essential, but makes things likely to be found faster.
./generate_dictionary
# Set up input directory
mkdir in1
echo "module m; initial \$display(\"Hello world!\n\"); endmodule" > in1/1.v
# Compile wrapper program
AFL_HARDEN=1 CXX=afl-g++ make wrapper