Skip to content
Merged
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
23 changes: 19 additions & 4 deletions projects/espeak-ng/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -eu
#!/bin/bash -eux
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -19,7 +19,22 @@
# build project
export ASAN_OPTIONS=detect_leaks=0
./autogen.sh
./configure --with-libfuzzer=yes --disable-shared --with-speechplayer=no
make check || true
cp tests/ssml-fuzzer.test $OUT/ssml-fuzzer
./configure --disable-shared --with-speechplayer=no
make -j$(nproc)

# Build the ssml-fuzzer manually with $LIB_FUZZING_ENGINE
$CC $CFLAGS -I. -Isrc/include -c tests/ssml-fuzzer.c -o tests/ssml-fuzzer.o
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE tests/ssml-fuzzer.o \
src/.libs/libespeak-ng.a -o $OUT/ssml-fuzzer -lm

# Build the synth_fuzzer manually with $LIB_FUZZING_ENGINE
# Instruct the synth_fuzzer to use "en" for FUZZ_VOICE. We do not set
# the environment variable at runtime, so we conver https://github.com/espeak-ng/espeak-ng/blob/3dcbe7ea3ea85a9212968d0f05172dde4259e770/tests/fuzzing/synth_fuzzer.c#L54C22-L54C28
# to const char *lang = "en";//getenv("FUZZ_VOICE");
# sed -i 's/getenv/"en";\/\//g' tests/fuzzing/synth_fuzzer.c
#$CC $CFLAGS -I. -Isrc/include -DPATH_ESPEAK_DATA=\"/out/espeak-ng-data\" -Isrc/libespeak-ng \
# -c tests/fuzzing/synth_fuzzer.c -o tests/fuzzing/synth_fuzzer.o
#$CXX $CXXFLAGS $LIB_FUZZING_ENGINE tests/fuzzing/synth_fuzzer.o \
# src/.libs/libespeak-ng.a -o $OUT/synth_fuzzer -lm

cp -r espeak-ng-data/ $OUT/