diff options
author | davkor <david@adalogics.com> | 2020-08-13 19:12:44 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-08-16 00:59:07 +0300 |
commit | 375b859428e1c525f0cc9d3c4324f51740316722 (patch) | |
tree | 6f193b56793b3ed58522ecee321d732a69b3c54b /node.gyp | |
parent | 5d179cb2eccac38205b6f03ecf6403df65deea51 (diff) |
build: add build flag for OSS-Fuzz integration
Refs: https://github.com/google/oss-fuzz/pull/3860
Fixes: https://github.com/nodejs/node/issues/33724
PR-URL: https://github.com/nodejs/node/pull/34761
Fixes: https://github.com/nodejs/node/issues/33724
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'node.gyp')
-rw-r--r-- | node.gyp | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -13,6 +13,7 @@ 'node_use_bundled_v8%': 'true', 'node_shared%': 'false', 'force_dynamic_crt%': 0, + 'ossfuzz' : 'false', 'node_module_version%': '', 'node_shared_brotli%': 'false', 'node_shared_zlib%': 'false', @@ -1170,6 +1171,38 @@ } ], ] }, # specialize_node_d + { # fuzz_url + 'target_name': 'fuzz_url', + 'type': 'executable', + 'dependencies': [ + '<(node_lib_target_name)', + ], + 'includes': [ + 'node.gypi' + ], + 'include_dirs': [ + 'src', + ], + 'defines': [ + 'NODE_ARCH="<(target_arch)"', + 'NODE_PLATFORM="<(OS)"', + 'NODE_WANT_INTERNALS=1', + ], + 'sources': [ + 'src/node_snapshot_stub.cc', + 'src/node_code_cache_stub.cc', + 'test/fuzzers/fuzz_url.cc', + ], + 'conditions': [ + ['OS=="linux"', { + 'ldflags': [ '-fsanitize=fuzzer' ] + }], + # Ensure that ossfuzz flag has been set and that we are on Linux + [ 'OS!="linux" or ossfuzz!="true"', { + 'type': 'none', + }], + ], + }, # fuzz_url { 'target_name': 'cctest', 'type': 'executable', |