<br>
On Wed, Jun 21, 2017 at 6:16 PM, Hugo Beauzée-Luyssen <hugo@beauzee.fr> wrote:<br>
<blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">Hi,
On Wed, Jun 21, 2017, at 02:36 PM, Shaleen Jain wrote:
<blockquote> ---
.gitignore | 1 +
configure.ac | 8 ++++++++
test/Makefile.am | 2 ++
test/fuzz/Makefile.am | 19 +++++++++++++++++++
4 files changed, 30 insertions(+)
create mode 100644 test/fuzz/Makefile.am
diff --git a/.gitignore b/.gitignore
index 0b0ee9cc20..fcd0e59213 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,6 +45,7 @@ wxvlc
vlc_install_dir/*
plugins.dat
patches/*
+*_fuzzer
include/vlc/libvlc_version.h
diff --git a/configure.ac b/configure.ac
index 67fc7deb1a..c289b69510 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,6 +94,13 @@ AS_IF([test -n "${with_binary_version}"],[
[Binary specific version])
])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__clang__)
+#error
+#endif])], have_clang=yes, have_clang=no)
+
+AM_CONDITIONAL(HAVE_CLANG, test "x$have_clang" = "xyes")
+
</blockquote>
As pointed out by Marvin, it would be more idiomatic to use
ax_check_compile_flag (or something similar) to enable flags
conditionally.</div></blockquote><div><br></div>I don't think it would be worth adding a 75 line marco for a flag that is used<div>only maybe once, plus it not anymore idiomatic than ac_compile_ifelse<br><blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">
<blockquote> dnl
dnl Check the operating system
dnl
@@ -4248,6 +4255,7 @@ AC_CONFIG_FILES([
lib/Makefile
bin/Makefile
test/Makefile
+ test/fuzz/Makefile
modules/hw/mmal/Makefile
share/vlc.appdata.xml.in
])
diff --git a/test/Makefile.am b/test/Makefile.am
index 95d4df6516..30c1bb56b6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -4,6 +4,8 @@
AUTOMAKE_OPTIONS = subdir-objects
+SUBDIRS = fuzz
+
extra_check_verbose = $(extra_check_verbose_$(V))
extra_check_verbose_ = $(extra_check_flags__$(AM_DEFAULT_VERBOSITY))
extra_check_verbose_0 = @echo TEST $@
diff --git a/test/fuzz/Makefile.am b/test/fuzz/Makefile.am
new file mode 100644
index 0000000000..57eb04f13f
--- /dev/null
+++ b/test/fuzz/Makefile.am
@@ -0,0 +1,19 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
+AM_CXXFLAGS = -fsanitize=address -fsanitize-address-use-after-scope
-fsanitize=undefined -fno-sanitize-recover=undefined
+if HAVE_CLANG
+AM_CXXFLAGS += -fsanitize-coverage=trace-pc-guard,trace-cmp
+else
+AM_CXXFLAGS += -fsanitize-coverage=trace-pc
+endif
+
+LIBVLCCORE = ../../src/libvlccore.la
+LIBVLC = ../../lib/libvlc.la
+
+LDADD = $(LIBVLCCORE) $(LIBVLC) -L./ -lFuzzer
</blockquote>
You need to check for libfuzzer presence in the configure. Also, I'm not
sure running fuzz testing for each 'make check' is a good idea.
I'm not sure what would be the best way to do this, but I'd be in favor
of a separate target. Fuzz testing will most likely be quite long at
some point, and we don't want to make all our source builds that run
make check/make distcheck last for many hours.</div></blockquote><div><br></div>make check will only build the fuzz binaries, not run them.<br><blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">
<blockquote> +
+check_PROGRAMS = \
+ libvlc_demux_fuzzer
+
+libvlc_demux_fuzzer_SOURCES = libvlc_demux_fuzzer.cpp
</blockquote>
I think you forgot to add the file :)</div></blockquote><div><br></div>No, I planned to push a separate patch for that, which I did a few minutes ago.<br><blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">
<blockquote> +
--
2.13.1
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a>
</blockquote>
<div>--
</div> Hugo Beauzée-Luyssen
<a href="mailto:hugo@beauzee.fr">hugo@beauzee.fr</a>
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></div></blockquote><br><br>
</div>