[Skiboot] skiboot + AFL fuzz test for 'libstb' unit tests

Stewart Smith stewart at linux.vnet.ibm.com
Wed Oct 26 19:05:33 AEDT 2016


Nageswara R Sastry <rnsastry at linux.vnet.ibm.com> writes:
> On 2016-10-26 12:48, Stewart Smith wrote:
>
>>> make HOSTCC=$HOME/afl/afl-clang-fast        # this built all the
>>> binaries, except 'extract-gcov’.
>>> make check CC=$HOME/afl/afl-clang-fast       # Here have to use CC, 
>>> with
>>> HOSTCC make check didn’t work.
>>> 
>>> make check couldn’t compile the following. But compiled ‘libstb’
>>> unit tests. So proceeding further.
>>> ...
>>> ~skiboot/test/hello_world/Makefile.check:21: recipe for target
>>> 'test/hello_world/hello_kernel/hello_kernel.o' failed
>>> make: *** [test/hello_world/hello_kernel/hello_kernel.o] Error 1
>> 
>> So, for 'make check' it also uses HOSTCC, as we build a couple of 
>> things
>> for the target for tests, one of them being the best Operating System 
>> OF
>> ALL TIME, the hello_kernel.
>> 
>> So you'll need to pass HOSTCC to 'make check' to get the unit tests
>> built using that compiler.
>> 
>
> Stewart, Thanks for your reply.
>
> When I tried with HOSTCC seeing the following
> $ make check HOSTCC=$HOME/afl/afl-clang-fast
> 	[ HOSTCC ] ccan/check_type/test/run.c
> afl-clang-fast 2.35b by <lszekeres at google.com>
> error: unknown warning option '-Wjump-misses-init' 
> [-Werror,-Wunknown-warning-option]
> error: unknown warning option '-Wsuggest-attribute=const' 
> [-Werror,-Wunknown-warning-option]
> error: unknown warning option '-Wsuggest-attribute=noreturn' 
> [-Werror,-Wunknown-warning-option]
> error: unknown warning option '-Wstack-usage=1024'; did you mean 
> '-Wtype-safety'? [-Werror,-Wunknown-warning-option]
> skiboot/ccan/Makefile.check:28: recipe for target 
> 'ccan/check_type/test/run' failed
> make: *** [ccan/check_type/test/run] Error 1
>
> seems afl-clang is not understanding gcc related compile options.

Ahh yep.. hrm... maybe the try-cflag macro is buggy (see Makefile.main).

Perhaps just try changing "HOSTCC=gcc" to "HOSTCC=afl-clang-fast"  in
Makefile.main ?

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list