Lines Matching +full:- +full:tzip

4 # Copyright (c) 2016-2020, Facebook, Inc.
7 # This source code is licensed under both the BSD-style license (found in the
10 # You may select, at your option, one of the above-listed licenses.
74 CFLAGS = os.environ.get('CFLAGS', '-O3')
77 MFLAGS = os.environ.get('MFLAGS', '-j')
81 AFL_FUZZ = os.environ.get('AFL_FUZZ', 'afl-fuzz')
149 san_flags = ','.join(re.findall('-fsanitize=((?:[a-z]+,?)+)', flags))
150 nosan_flags = ','.join(re.findall('-fno-sanitize=((?:[a-z]+,?)+)', flags))
154 raise RuntimeError('-fno-sanitize={s} and -fsanitize={s} passed'.
179 cc_version_bytes = subprocess.check_output([cc, "--version"])
180 cxx_version_bytes = subprocess.check_output([cxx, "--version"])
190 version_regex = b'([0-9])+\.([0-9])+\.([0-9])+'
199 return ['-fno-sanitize=signed-integer-overflow']
201 return ['-fno-sanitize=pointer-overflow']
211 Enable sanitizers with --enable-*san.
213 For libFuzzer set LIB_FUZZING_ENGINE and pass --enable-coverage.
219 '--lib-fuzzing-engine',
228 '--enable-coverage',
231 help='Enable coverage instrumentation (-fsanitize-coverage)')
233 '--enable-fuzzer',
236 help=('Enable clang fuzzer (-fsanitize=fuzzer). When enabled '
241 '--enable-asan', dest='asan', action='store_true', help='Enable UBSAN')
243 '--enable-ubsan',
248 '--enable-ubsan-pointer-overflow',
253 '--enable-msan', dest='msan', action='store_true', help='Enable MSAN')
255 '--enable-msan-track-origins', dest='msan_track_origins',
258 '--msan-extra-cppflags',
265 '--msan-extra-cflags',
272 '--msan-extra-cxxflags',
279 '--msan-extra-ldflags',
286 '--enable-sanitize-recover',
289 help='Non-fatal sanitizer errors where possible')
291 '--debug',
297 '--force-memory-access',
303 '--fuzz-rng-seed-size',
309 '--disable-fuzzing-mode',
314 '--enable-stateful-fuzzing',
319 '--cc',
325 '--cxx',
331 '--cppflags',
337 '--cflags',
343 '--cxxflags',
349 '--ldflags',
355 '--mflags',
374 raise RuntimeError('--enable-msan-track-origins requires MSAN')
376 raise RuntimeError('--enable-ubsan-pointer-overflow requires UBSAN')
378 raise RuntimeError('--enable-sanitize-recover but no sanitizers used')
402 '-DDEBUGLEVEL={}'.format(args.debug),
403 '-DMEM_FORCE_MEMORY_ACCESS={}'.format(args.memory_access),
404 '-DFUZZ_RNG_SEED_SIZE={}'.format(args.fuzz_rng_seed_size),
411 '-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp'
414 common_flags += ['-fsanitize=fuzzer']
420 recover_flags = ['-fsanitize-recover=all']
422 recover_flags = ['-fno-sanitize-recover=all']
427 msan_flags = ['-fsanitize=memory']
429 msan_flags += ['-fsanitize-memory-track-origins']
438 common_flags += ['-fsanitize=address']
441 ubsan_flags = ['-fsanitize=undefined']
447 cppflags += ['-DSTATEFUL_FUZZING']
450 cppflags += ['-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION']
503 '-merge=1'.
507 '--corpora',
512 '--artifact',
515 abs_join(CORPORA_DIR, 'TARGET-crash')))
517 '--seed',
520 abs_join(CORPORA_DIR, 'TARGET-seed')))
538 artifact = abs_join(CORPORA_DIR, '{}-crash'.format(target))
540 seed = abs_join(CORPORA_DIR, '{}-seed'.format(target))
554 cmd = [target, '-artifact_prefix={}/'.format(artifact)]
572 Runs an afl-fuzz job.
573 Passes all extra arguments to afl-fuzz.
581 '--corpora',
586 '--output',
589 abs_join(CORPORA_DIR, 'TARGET-afl')))
591 '--afl-fuzz',
608 args.output = abs_join(CORPORA_DIR, '{}-afl'.format(args.TARGET))
624 cmd = [args.afl_fuzz, '-i', corpora, '-o', output] + args.extra
664 '--number',
665 '-n',
670 '--max-size-log',
675 '--seed',
678 abs_join(CORPORA_DIR, 'TARGET-seed')))
680 '--decodecorpus',
686 '--zstd',
691 '--fuzz-rng-seed-size',
707 args.seed = abs_join(CORPORA_DIR, '{}-seed'.format(args.TARGET))
710 raise RuntimeError("{} is not a file run 'make -C {} decodecorpus'".
733 '-n{}'.format(args.number),
734 '-p{}/'.format(compressed),
735 '-o{}'.format(decompressed),
740 '--gen-blocks',
741 '--max-block-size-log={}'.format(min(args.max_size_log, 17))
744 cmd += ['--max-content-size-log={}'.format(args.max_size_log)]
765 '--train',
766 '-r', decompressed,
767 '--maxdict={}'.format(dict_size),
768 '-o', abs_join(dict, '{}.zstd-dict'.format(dict_size))
790 Runs a libfuzzer fuzzer with -merge=1 to build a minimal corpus in
802 extra_args = [corpus, "-merge=1"] + args.extra
806 crashes = abs_join(CORPORA_DIR, '{}-crash'.format(target))
827 cmd = ["zip", "-r", "-q", "-j", "-9", zip_file, "."]
843 print("\tfuzzing helpers (select a command and pass -h for help)\n")
845 print("\t-h, --help\tPrint this message")
854 print("\tzip\t\tZip the minimized corpora up")
863 if args[1] == '-h' or args[1] == '--help' or args[1] == '-H':
885 print("Error: No such command {} (pass -h for help)".format(command))