Thanks for taking a look. On Tue, May 12, 2020 at 8:41 AM Ilya Maximets <[email protected]> wrote: > > On 5/12/20 5:22 PM, William Tu wrote: > > When running fuzzer locally by doing > > $ ./configure CC=clang CFLAGS="-g -O2 -fsanitize=fuzzer-no-link -Werror" > > Hmm... Why passing 'fuzzer-no-link' to replace it inside the make script?
the configure fails i`f passing as "-fsanitize=fuzzer" configure: error: C compiler cannot create executables See `config.log' for more details configure:4079: checking whether the C compiler works configure:4101: clang -g -O2 -fsanitize=fuzzer -Werror conftest.c >&5 /tmp/conftest-67bd49.o: In function `main': /root/ovs/conftest.c:14: multiple definition of `main' /usr/lib/llvm-8/lib/clang/8.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerMain.cpp.o):FuzzerMain.cpp:(.text.main+0x0): first defined here /usr/lib/llvm-8/lib/clang/8.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerMain.cpp.o): In function `main': FuzzerMain.cpp:(.text.main+0x12): undefined reference to `LLVMFuzzerTestOneInput' clang: error: linker command failed with exit code 1 (use -v to see invocation) configure:4105: $? = 1 configure:4143: result: no configure: failed program was: > > > $ make oss-fuzz-targets > > AFAIK, oss-fuzz-targets are for Google's oss-fuzz project and not for > local usage. We're thinking about adding more tests under tests/oss-fuzz/ so need to make it work locally first. William > > > fails due to "(.text+0x20): undefined reference to `main'" > > > > The patch fixes it by replacing "fuzzer-no-link" to "fuzzer" so the > > binary under tests/oss-fuzz/ can be generated. > > > > Cc: Bhargava Shastry <[email protected]> > > Cc: Yifeng Sun <[email protected]> > > Signed-off-by: William Tu <[email protected]> > > --- > > tests/oss-fuzz/automake.mk | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/tests/oss-fuzz/automake.mk b/tests/oss-fuzz/automake.mk > > index 2b116e7a51a1..66a5c3037f5d 100644 > > --- a/tests/oss-fuzz/automake.mk > > +++ b/tests/oss-fuzz/automake.mk > > @@ -8,6 +8,9 @@ OSS_FUZZ_TARGETS = \ > > EXTRA_PROGRAMS += $(OSS_FUZZ_TARGETS) > > oss-fuzz-targets: $(OSS_FUZZ_TARGETS) > > > > +CFLAGS_FUZZER:=$(CFLAGS:fuzzer-no-link=fuzzer) > > +override CFLAGS=$(CFLAGS_FUZZER) > > + > > tests_oss_fuzz_flow_extract_target_SOURCES = \ > > tests/oss-fuzz/flow_extract_target.c \ > > tests/oss-fuzz/fuzzer.h > > > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
