# HG changeset patch # User Christoph Diehl # Date 1521306478 -3600 # Node ID d5efd6828875d575758b84481499888cefdc207e # Parent 6c0306f9bce1d81746e6abd43d64ce932057d862 Bug 1446583: Update location for setting trace-pc coverage flags for LibFuzzer r=drno diff --git a/media/mtransport/build/moz.build b/media/mtransport/build/moz.build --- a/media/mtransport/build/moz.build +++ b/media/mtransport/build/moz.build @@ -23,14 +23,20 @@ EXPORTS.mtransport += [ '../transportlayerdtls.h', '../transportlayerice.h', '../transportlayerlog.h', '../transportlayerloopback.h', ] include('../common.build') +if CONFIG['FUZZING']: + if CONFIG['LIBFUZZER']: + # Add trace-pc coverage for LibFuzzer + CFLAGS += ['-fsanitize-coverage=trace-pc-guard'] + CXXFLAGS += ['-fsanitize-coverage=trace-pc-guard'] + # These files cannot be built in unified mode because of the redefinition of # getLogModule, UNIMPLEMENTED, nr_socket_long_term_violation_time, # nr_socket_short_term_violation_time. SOURCES += mtransport_cppsrcs FINAL_LIBRARY = 'xul' diff --git a/media/mtransport/fuzztest/moz.build b/media/mtransport/fuzztest/moz.build --- a/media/mtransport/fuzztest/moz.build +++ b/media/mtransport/fuzztest/moz.build @@ -17,13 +17,19 @@ LOCAL_INCLUDES += [ '/media/mtransport/third_party/nrappkit/src/log', '/media/mtransport/third_party/nrappkit/src/plugin', '/media/mtransport/third_party/nrappkit/src/port/darwin/include', '/media/mtransport/third_party/nrappkit/src/share', '/media/mtransport/third_party/nrappkit/src/stats', '/media/mtransport/third_party/nrappkit/src/util/libekr', ] +if CONFIG['FUZZING']: + if CONFIG['LIBFUZZER']: + # Add trace-pc coverage for LibFuzzer + CFLAGS += ['-fsanitize-coverage=trace-pc-guard'] + CXXFLAGS += ['-fsanitize-coverage=trace-pc-guard'] + SOURCES += [ 'stun_parser_libfuzz.cpp', ] FINAL_LIBRARY = 'xul-gtest' diff --git a/media/mtransport/moz.build b/media/mtransport/moz.build --- a/media/mtransport/moz.build +++ b/media/mtransport/moz.build @@ -12,16 +12,16 @@ include("/ipc/chromium/chromium-config.m DIRS += [ '/media/mtransport/third_party', '/media/mtransport/build', '/media/mtransport/ipc', ] if CONFIG['FUZZING']: if CONFIG['LIBFUZZER']: - # Add trace-pc coverage for libfuzzer + # Add trace-pc coverage for LibFuzzer CFLAGS += ['-fsanitize-coverage=trace-pc-guard'] CXXFLAGS += ['-fsanitize-coverage=trace-pc-guard'] if CONFIG['FUZZING_INTERFACES']: TEST_DIRS += [ 'fuzztest' ] diff --git a/media/webrtc/moz.build b/media/webrtc/moz.build --- a/media/webrtc/moz.build +++ b/media/webrtc/moz.build @@ -110,16 +110,16 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']: if CONFIG['ENABLE_TESTS']: TEST_DIRS += [ 'signaling/gtest', 'trunk/gtest', ] if CONFIG['FUZZING']: if CONFIG['LIBFUZZER']: - # Add trace-pc coverage for libfuzzer + # Add trace-pc coverage for LibFuzzer CFLAGS += ['-fsanitize-coverage=trace-pc-guard'] CXXFLAGS += ['-fsanitize-coverage=trace-pc-guard'] if CONFIG['FUZZING_INTERFACES']: TEST_DIRS += [ 'signaling/fuzztest' ] diff --git a/media/webrtc/signaling/fuzztest/moz.build b/media/webrtc/signaling/fuzztest/moz.build --- a/media/webrtc/signaling/fuzztest/moz.build +++ b/media/webrtc/signaling/fuzztest/moz.build @@ -9,13 +9,19 @@ Library('FuzzingSdp') LOCAL_INCLUDES += [ '/ipc/chromium/src', '/media/mtransport', '/media/webrtc/', '/media/webrtc/signaling/src/common/time_profiling', '/media/webrtc/signaling/src/peerconnection', ] +if CONFIG['FUZZING']: + if CONFIG['LIBFUZZER']: + # Add trace-pc coverage and trace-cmp for LibFuzzer + CFLAGS += ['-fsanitize-coverage=trace-pc-guard', '-fsanitize-coverage=trace-cmp'] + CXXFLAGS += ['-fsanitize-coverage=trace-pc-guard', '-fsanitize-coverage=trace-cmp'] + SOURCES += [ 'sdp_parser_libfuzz.cpp', ] FINAL_LIBRARY = 'xul-gtest' diff --git a/media/webrtc/signaling/src/sdp/moz.build b/media/webrtc/signaling/src/sdp/moz.build --- a/media/webrtc/signaling/src/sdp/moz.build +++ b/media/webrtc/signaling/src/sdp/moz.build @@ -14,16 +14,21 @@ elif CONFIG['OS_TARGET'] == 'Darwin': 'sipcc/sdp_services_unix.c', ] else: DEFINES['SIP_OS_LINUX'] = True SOURCES += [ 'sipcc/sdp_services_unix.c', ] +if CONFIG['FUZZING']: + if CONFIG['LIBFUZZER']: + # Add trace-pc coverage and trace-cmp for LibFuzzer + CFLAGS += ['-fsanitize-coverage=trace-pc-guard', '-fsanitize-coverage=trace-cmp'] + CXXFLAGS += ['-fsanitize-coverage=trace-pc-guard', '-fsanitize-coverage=trace-cmp'] LOCAL_INCLUDES += [ '/media/mtransport', '/media/webrtc', '/media/webrtc/signaling/src/common/browser_logging', '/media/webrtc/trunk', ]