Lines Matching +full:- +full:tzip

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.
79 CFLAGS = os.environ.get('CFLAGS', '-O3')
82 MFLAGS = os.environ.get('MFLAGS', '-j')
87 AFL_FUZZ = os.environ.get('AFL_FUZZ', 'afl-fuzz')
155 san_flags = ','.join(re.findall('-fsanitize=((?:[a-z]+,?)+)', flags))
156 nosan_flags = ','.join(re.findall('-fno-sanitize=((?:[a-z]+,?)+)', flags))
160 raise RuntimeError('-fno-sanitize={s} and -fsanitize={s} passed'.
185 cc_version_bytes = subprocess.check_output([cc, "--version"])
186 cxx_version_bytes = subprocess.check_output([cxx, "--version"])
189 print("{} --version:\n{}".format(cc, cc_version_bytes.decode('ascii')))
197 version_regex = b'([0-9]+)\.([0-9]+)\.([0-9]+)'
206 return ['-fno-sanitize=signed-integer-overflow']
208 return ['-fno-sanitize=pointer-overflow']
218 Enable sanitizers with --enable-*san.
220 For libFuzzer set LIB_FUZZING_ENGINE and pass --enable-coverage.
226 '--lib-fuzzing-engine',
235 '--enable-coverage',
238 help='Enable coverage instrumentation (-fsanitize-coverage)')
240 '--enable-fuzzer',
243 help=('Enable clang fuzzer (-fsanitize=fuzzer). When enabled '
248 '--enable-asan', dest='asan', action='store_true', help='Enable UBSAN')
250 '--enable-ubsan',
255 '--disable-ubsan-pointer-overflow',
260 '--enable-msan', dest='msan', action='store_true', help='Enable MSAN')
262 '--enable-msan-track-origins', dest='msan_track_origins',
265 '--msan-extra-cppflags',
272 '--msan-extra-cflags',
279 '--msan-extra-cxxflags',
286 '--msan-extra-ldflags',
293 '--enable-sanitize-recover',
296 help='Non-fatal sanitizer errors where possible')
298 '--debug',
304 '--force-memory-access',
310 '--fuzz-rng-seed-size',
316 '--disable-fuzzing-mode',
321 '--enable-stateful-fuzzing',
326 '--custom-seq-prod',
332 '--cc',
338 '--cxx',
344 '--cppflags',
350 '--cflags',
356 '--cxxflags',
362 '--ldflags',
368 '--mflags',
387 raise RuntimeError('--enable-msan-track-origins requires MSAN')
389 raise RuntimeError('--enable-sanitize-recover but no sanitizers used')
411 '-Werror',
412 '-Wno-error=declaration-after-statement',
413 '-Wno-error=c++-compat',
414 '-Wno-error=deprecated' # C files are sometimes compiled with CXX
418 '-DDEBUGLEVEL={}'.format(args.debug),
419 '-DMEM_FORCE_MEMORY_ACCESS={}'.format(args.memory_access),
420 '-DFUZZ_RNG_SEED_SIZE={}'.format(args.fuzz_rng_seed_size),
427 '-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp'
430 common_flags += ['-fsanitize=fuzzer']
436 recover_flags = ['-fsanitize-recover=all']
438 recover_flags = ['-fno-sanitize-recover=all']
443 msan_flags = ['-fsanitize=memory']
445 msan_flags += ['-fsanitize-memory-track-origins']
454 common_flags += ['-fsanitize=address']
457 ubsan_flags = ['-fsanitize=undefined']
463 cppflags += ['-DSTATEFUL_FUZZING']
466 cppflags += ['-DFUZZ_THIRD_PARTY_SEQ_PROD']
470 cppflags += ['-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION']
502 '-j',
524 '-merge=1'.
528 '--corpora',
533 '--artifact',
536 abs_join(CORPORA_DIR, 'TARGET-crash')))
538 '--seed',
541 abs_join(CORPORA_DIR, 'TARGET-seed')))
559 artifact = abs_join(CORPORA_DIR, '{}-crash'.format(target))
561 seed = abs_join(CORPORA_DIR, '{}-seed'.format(target))
575 cmd = [target, '-artifact_prefix={}/'.format(artifact)]
593 Runs an afl-fuzz job.
594 Passes all extra arguments to afl-fuzz.
602 '--corpora',
607 '--output',
610 abs_join(CORPORA_DIR, 'TARGET-afl')))
612 '--afl-fuzz',
629 args.output = abs_join(CORPORA_DIR, '{}-afl'.format(args.TARGET))
645 cmd = [args.afl_fuzz, '-i', corpora, '-o', output] + args.extra
685 '--number',
686 '-n',
691 '--max-size-log',
696 '--seed',
699 abs_join(CORPORA_DIR, 'TARGET-seed')))
701 '--decodecorpus',
707 '--zstd',
712 '--fuzz-rng-seed-size',
728 args.seed = abs_join(CORPORA_DIR, '{}-seed'.format(args.TARGET))
731 raise RuntimeError("{} is not a file run 'make -C {} decodecorpus'".
754 '-n{}'.format(args.number),
755 '-p{}/'.format(compressed),
756 '-o{}'.format(decompressed),
761 '--gen-blocks',
762 '--max-block-size-log={}'.format(min(args.max_size_log, 17))
765 cmd += ['--max-content-size-log={}'.format(args.max_size_log)]
786 '--train',
787 '-r', decompressed,
788 '--maxdict={}'.format(dict_size),
789 '-o', abs_join(dict, '{}.zstd-dict'.format(dict_size))
811 Runs a libfuzzer fuzzer with -merge=1 to build a minimal corpus in
823 extra_args = [corpus, "-merge=1"] + args.extra
827 crashes = abs_join(CORPORA_DIR, '{}-crash'.format(target))
848 cmd = ["zip", "-r", "-q", "-j", "-9", zip_file, "."]
864 print("\tfuzzing helpers (select a command and pass -h for help)\n")
866 print("\t-h, --help\tPrint this message")
875 print("\tzip\t\tZip the minimized corpora up")
884 if args[1] == '-h' or args[1] == '--help' or args[1] == '-H':
906 print("Error: No such command {} (pass -h for help)".format(command))