Skip to content

Commit

Permalink
scripts/fuzz.sh: fix multiple issues with "stub" overlays
Browse files Browse the repository at this point in the history
Fixes commit deed9a8 ("scripts: fuzz: add support for build and
overlays")

The main issue was the way fuzz.sh was trying to parse the overlay
file. Drop that and just pass it as is to `west` and `cmake` instead,
they know what to do with it.

Also:

- Fix invalid syntax in stub_build_all_ipc4.conf
- Make fuzz.sh shellcheck-clean again. Always use shellcheck.
- Temporarily disable `CONFIG_COMP_SMART_AMP` in
  stub_build_all_ipc3.conf because `smart_amp.c` does not compile (in
  any configuration)

```
sof/src/audio/smart_amp/smart_amp.c:748:9: error:
   no member named 'in_channels' in 'struct smart_amp_data'
   sad->in_channels = audio_stream_get_channels(&source_buffer->stream);
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb authored and lgirdwood committed Oct 31, 2023
1 parent 3cb13e7 commit 6458f48
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ jobs:
cd workspace
clang --verbose
set -x
sof/scripts/fuzz.sh -b -c stub_build_all_${{ matrix.IPC }}.conf -- "$cmake_arg"
sof/scripts/fuzz.sh -b -- -DOVERLAY_CONFIG=stub_build_all_${{ matrix.IPC }}.conf
7 changes: 5 additions & 2 deletions app/stub_build_all_ipc3.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ CONFIG_COMP_TONE=n
CONFIG_COMP_CROSSOVER=y
CONFIG_COMP_DRC=y
CONFIG_COMP_MULTIBAND_DRC=y
CONFIG_COMP_SMART_AMP=y
CONFIG_PASSTHROUGH_CODEC=y
CONFIG_WAVES_CODEC=y
CONFIG_DTS_CODEC=y
CONFIG_COMP_IGO_NR=y
CONFIG_COMP_RTNR=y
CONFIG_COMP_SMART_AMP=y
# temporarily disabled until it compiles:
# sof/src/audio/smart_amp/smart_amp.c:748:9: error:
# no member named 'in_channels' in 'struct smart_amp_data'
# sad->in_channels = audio_stream_get_channels(&source_buffer->stream);
CONFIG_COMP_SMART_AMP=n
CONFIG_MAXIM_DSM=y
10 changes: 5 additions & 5 deletions app/stub_build_all_ipc4.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-DCONFIG_COMP_STUBS=y
-DCONFIG_COMP_ARIA=y
-DCONFIG_COMP_CHAIN_DMA=y
-DCONFIG_COMP_UP_DOWN_MIXER=y
-DCONFIG_IPC_MAJOR_4=y
CONFIG_COMP_STUBS=y
CONFIG_COMP_ARIA=y
CONFIG_COMP_CHAIN_DMA=y
CONFIG_COMP_UP_DOWN_MIXER=y
CONFIG_IPC_MAJOR_4=y
16 changes: 6 additions & 10 deletions scripts/fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ main()
{
setup

BUILD_ONLY=false
# Parse "$@". getopts stops after '--'
while getopts "ho:t:c:b" opt; do
while getopts "ho:t:b" opt; do
case "$opt" in
h) print_help; exit 0;;
o) FUZZER_STDOUT="$OPTARG";;
t) TEST_DURATION="$OPTARG";;
b) BUILD_ONLY=1;;
c) OVERLAY="$OPTARG";;
b) BUILD_ONLY=true;;
*) print_help; exit 1;;
esac
done
Expand All @@ -80,15 +80,11 @@ main()
-DCONFIG_ASAN=y
)

if [ ! -z $OVERLAY ]; then
overlay_config=$(xargs -a "$SOF_TOP/app/$OVERLAY" printf -- "-D%s ")
fi

west build -d build-fuzz -b native_posix "$SOF_TOP"/app/ -- \
"${fuzz_configs[@]}" "$overlay_config" "$@"
"${fuzz_configs[@]}" "$@"

if [ $BUILD_ONLY -eq 1 ]; then
exit
if $BUILD_ONLY; then
exit 0
fi

mkdir -p ./fuzz_corpus
Expand Down

0 comments on commit 6458f48

Please sign in to comment.