115 lines
3.4 KiB
Python
115 lines
3.4 KiB
Python
# Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
|
|
#source code may only be used and distributed under the Widevine License
|
|
#Agreement.
|
|
|
|
{
|
|
'variables': {
|
|
'boringssl_libcrypto_path%': '../../../third_party/boringssl/boringssl.gyp:crypto',
|
|
'boringssl_libssl_path%': '../../../third_party/boringssl/boringssl.gyp:ssl',
|
|
'oemcrypto_dir': '../..',
|
|
'platform_specific_dir': '../../../linux/src',
|
|
'privacy_crypto_impl%': 'boringssl',
|
|
# Flag used to generate source based code coverage reports.
|
|
'generate_code_coverage_report%': 'false',
|
|
'util_dir': '../../../util',
|
|
},
|
|
'sources': [
|
|
'../../odk/src/core_message_deserialize.cpp',
|
|
'../../odk/src/core_message_features.cpp',
|
|
'../../odk/src/core_message_serialize.cpp',
|
|
'../oec_device_features.cpp',
|
|
'../oec_key_deriver.cpp',
|
|
'../oemcrypto_corpus_generator_helper.cpp',
|
|
'../oec_session_util.cpp',
|
|
'../oemcrypto_corpus_generator_helper.cpp',
|
|
'oemcrypto_fuzz_helper.cc',
|
|
'../oemcrypto_session_tests_helper.cpp',
|
|
'<(platform_specific_dir)/file_store.cpp',
|
|
'<(platform_specific_dir)/log.cpp',
|
|
'<(util_dir)/src/platform.cpp',
|
|
'<(util_dir)/src/rw_lock.cpp',
|
|
'<(util_dir)/src/string_conversions.cpp',
|
|
'<(util_dir)/src/string_format.cpp',
|
|
'<(util_dir)/test/test_sleep.cpp',
|
|
'<(util_dir)/test/test_clock.cpp',
|
|
],
|
|
'include_dirs': [
|
|
'../../../third_party/fuzz',
|
|
'<(util_dir)/include',
|
|
'<(util_dir)/test',
|
|
'<(oemcrypto_dir)/include',
|
|
'<(oemcrypto_dir)/test',
|
|
'<(oemcrypto_dir)/test/fuzz_tests',
|
|
'<(oemcrypto_dir)/odk/include',
|
|
'<(oemcrypto_dir)/odk/src',
|
|
'<(oemcrypto_dir)/opk/oemcrypto_ta',
|
|
],
|
|
'includes': [
|
|
'../../../util/libssl_dependency.gypi',
|
|
],
|
|
'dependencies': [
|
|
'../../../third_party/googletest.gyp:gtest',
|
|
'../../../third_party/googletest.gyp:gmock',
|
|
'<(oemcrypto_dir)/util/oec_ref_util.gyp:oec_ref_util',
|
|
],
|
|
'defines': [
|
|
'OEMCRYPTO_FUZZ_TESTS',
|
|
],
|
|
'cflags': [
|
|
'-fPIC',
|
|
],
|
|
'cflags_c': [
|
|
'-std=c11',
|
|
'-D_POSIX_C_SOURCE=200809L',
|
|
],
|
|
'cflags_cc': [
|
|
'-std=c++17',
|
|
],
|
|
'ldflags': [
|
|
'-fPIC',
|
|
],
|
|
'libraries': [
|
|
'-lpthread',
|
|
],
|
|
'conditions': [
|
|
['generate_code_coverage_report=="false"', {
|
|
# Include flags to build fuzzer binaries for cluster fuzz.
|
|
'cflags': [
|
|
'-O0',
|
|
'-fno-omit-frame-pointer',
|
|
'-U_FORTIFY_SOURCE',
|
|
'-fsanitize=fuzzer,address,undefined',
|
|
'-fno-sanitize-recover=address,undefined',
|
|
# Need -g flag to include source line numbers in error stack trace.
|
|
'-g3',
|
|
],
|
|
'cflags_cc' : [
|
|
'-frtti',
|
|
],
|
|
'ldflags': [
|
|
# Sanitizers with link-time components must be repeated here.
|
|
'-fsanitize=fuzzer,address',
|
|
],
|
|
}],
|
|
['generate_code_coverage_report=="true"', {
|
|
# Include flags to build fuzzer binaries to generate source based code coverage reports.
|
|
'cflags': [
|
|
'-fprofile-instr-generate',
|
|
'-fcoverage-mapping',
|
|
],
|
|
'ldflags': [
|
|
'-fsanitize=fuzzer',
|
|
'-fprofile-instr-generate',
|
|
'-fcoverage-mapping',
|
|
],
|
|
}],
|
|
['oemcrypto_implementation_version=="opk"', {
|
|
# Include oemcrypto opk implementation code for building opk
|
|
# implementation fuzz binaries.
|
|
'dependencies': [
|
|
'<(oemcrypto_dir)/opk/ports/linux/ta/common/wtpi_impl/wtpi_test_impl.gyp:oemcrypto_ta_test_impl_no_ipc',
|
|
],
|
|
}],
|
|
], # conditions
|
|
}
|