Skip to content

Commit

Permalink
Added oss-fuzz flag
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamKorcz committed Dec 8, 2020
1 parent d9e0ecb commit c132763
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jerry-main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ endmacro()
# Jerry with libfuzzer support
if(JERRY_LIBFUZZER)
jerry_create_executable("jerry-libfuzzer" "libfuzzer.c")
target_link_libraries("jerry-libfuzzer" jerry-port-default)
if(OSS_FUZZ)
target_link_libraries("jerry-libfuzzer" jerry-port-default)
else()
target_link_libraries("jerry-libfuzzer" jerry-port-default -fsanitize=fuzzer)
endif()
endif()

# Jerry standalones
Expand Down
3 changes: 3 additions & 0 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def devhelp(helpstring):
help=devhelp('build test version of the jerry command line tool (%(choices)s)'))
compgrp.add_argument('--libfuzzer', metavar='X', choices=['ON', 'OFF'], type=str.upper,
help=devhelp('build jerry with libfuzzer support (%(choices)s)'))
compgrp.add_argument('--oss-fuzz', metavar='X', choices=['ON', 'OFF'], type=str.upper,
help=devhelp('build jerry to run on OSS-fuzz (%(choices)s)'))
compgrp.add_argument('--jerry-ext', metavar='X', choices=['ON', 'OFF'], type=str.upper,
help='build jerry-ext (%(choices)s)')
compgrp.add_argument('--jerry-libm', metavar='X', choices=['ON', 'OFF'], type=str.upper,
Expand Down Expand Up @@ -188,6 +190,7 @@ def build_options_append(cmakeopt, cliarg):
build_options_append('JERRY_CMDLINE_SNAPSHOT', arguments.jerry_cmdline_snapshot)
build_options_append('JERRY_CMDLINE_TEST', arguments.jerry_cmdline_test)
build_options_append('JERRY_LIBFUZZER', arguments.libfuzzer)
build_options_append('OSS_FUZZ', arguments.oss_fuzz)
build_options_append('JERRY_EXT', arguments.jerry_ext)
build_options_append('JERRY_LIBM', arguments.jerry_libm)
build_options_append('JERRY_PORT_DEFAULT', arguments.jerry_port_default)
Expand Down

0 comments on commit c132763

Please sign in to comment.