Skip to content

Commit 85b66ca

Browse files
espeak-ng: fix build
Updated build script to enable more verbose error reporting and improved build process for fuzzers.
1 parent a12e8d5 commit 85b66ca

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

projects/espeak-ng/build.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -eu
1+
#!/bin/bash -eux
22
# Copyright 2021 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +19,22 @@
1919
# build project
2020
export ASAN_OPTIONS=detect_leaks=0
2121
./autogen.sh
22-
./configure --with-libfuzzer=yes --disable-shared --with-speechplayer=no
23-
make check || true
24-
cp tests/ssml-fuzzer.test $OUT/ssml-fuzzer
22+
./configure --disable-shared --with-speechplayer=no
23+
make -j$(nproc)
24+
25+
# Build the ssml-fuzzer manually with $LIB_FUZZING_ENGINE
26+
$CC $CFLAGS -I. -Isrc/include -c tests/ssml-fuzzer.c -o tests/ssml-fuzzer.o
27+
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE tests/ssml-fuzzer.o \
28+
src/.libs/libespeak-ng.a -o $OUT/ssml-fuzzer -lm
29+
30+
# Build the synth_fuzzer manually with $LIB_FUZZING_ENGINE
31+
# Instruct the synth_fuzzer to use "en" for FUZZ_VOICE. We do not set
32+
# the environment variable at runtime, so we conver https://github.com/espeak-ng/espeak-ng/blob/3dcbe7ea3ea85a9212968d0f05172dde4259e770/tests/fuzzing/synth_fuzzer.c#L54C22-L54C28
33+
# to const char *lang = "en";//getenv("FUZZ_VOICE");
34+
sed -i 's/getenv/"en";\/\//g' tests/fuzzing/synth_fuzzer.c
35+
$CC $CFLAGS -I. -Isrc/include -DPATH_ESPEAK_DATA=\"/out/espeak-ng-data\" -Isrc/libespeak-ng \
36+
-c tests/fuzzing/synth_fuzzer.c -o tests/fuzzing/synth_fuzzer.o
37+
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE tests/fuzzing/synth_fuzzer.o \
38+
src/.libs/libespeak-ng.a -o $OUT/synth_fuzzer -lm
39+
2540
cp -r espeak-ng-data/ $OUT/

0 commit comments

Comments
 (0)