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?

>  $ make oss-fuzz-targets

AFAIK, oss-fuzz-targets are for Google's oss-fuzz project and not for
local usage.

> 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

Reply via email to