diff options
author | davkor <david@adalogics.com> | 2020-08-13 19:12:44 +0300 |
---|---|---|
committer | Beth Griggs <Bethany.Griggs@uk.ibm.com> | 2020-08-20 17:05:18 +0300 |
commit | bdf26aebb429dc87d24ac1a7a2596862d0f5dacd (patch) | |
tree | 8523a012e1ce5dc30a150cf48c5fdba158212a48 /node.gyp | |
parent | 952f233e392d651240a6614fdb0269eb3cbac9d6 (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
@@ -12,6 +12,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', @@ -1125,6 +1126,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', |