Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SKIP SOF-TEST] fuzz.sh: add new boards/native_sim_libfuzzer.conf #9389

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/boards/native_sim_libfuzzer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://docs.zephyrproject.org/latest/build/kconfig/setting.html#initial-conf

CONFIG_ZEPHYR_POSIX=y
CONFIG_ASSERT=y
CONFIG_EXCEPTION_DEBUG=y
CONFIG_ARCH_POSIX_TRAP_ON_FATAL=y
CONFIG_SYS_HEAP_BIG_ONLY=y
CONFIG_ZEPHYR_NATIVE_DRIVERS=y
CONFIG_ARCH_POSIX_LIBFUZZER=y
CONFIG_ZEPHYR_POSIX_FUZZ_TICKS=100
CONFIG_ASAN=y
16 changes: 3 additions & 13 deletions scripts/fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,8 @@ main()
# This also drops _leading_ '--'.
shift $((OPTIND-1))

# Move this to a new fuzz.conf EXTRA_CONF_FILE if it grows bigger
local fuzz_configs=(
-DCONFIG_ZEPHYR_POSIX=y
-DCONFIG_ASSERT=y
-DCONFIG_EXCEPTION_DEBUG=y
-DCONFIG_ARCH_POSIX_TRAP_ON_FATAL=y
-DCONFIG_SYS_HEAP_BIG_ONLY=y
-DCONFIG_ZEPHYR_NATIVE_DRIVERS=y
-DCONFIG_ARCH_POSIX_LIBFUZZER=y
-DCONFIG_ZEPHYR_POSIX_FUZZ_TICKS=100
-DCONFIG_ASAN=y
)
# https://docs.zephyrproject.org/latest/build/kconfig/setting.html#initial-conf
local conf_files_list='prj.conf;boards/native_sim_libfuzzer.conf'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make it so we can append to this list. I.e. the ASAN config would be split so we can use the base config with other sanitzer configs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's the idea. In some future PR(s) anyone can just go and (for instance) do:

if $something; then
   conf_files_list+=';debug.conf'


# Note there's never any reason to delete fuzz_corpus/.
# Don't trust `west build -p` because it is not 100% unreliable,
Expand All @@ -125,7 +115,7 @@ main()
# When passing conflicting -DVAR='VAL UE1' -DVAR='VAL UE2' to CMake,
# the last 'VAL UE2' wins. Previous ones are silently ignored.
west build -d build-fuzz -b native_sim "$SOF_TOP"/app/ -- \
"${fuzz_configs[@]}" "$@"
-DCONF_FILE="$conf_files_list" "$@"
)

if $BUILD_ONLY; then
Expand Down
Loading