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.
77 CFLAGS = os.environ.get('CFLAGS', '-O3')
80 MFLAGS = os.environ.get('MFLAGS', '-j')
84 AFL_FUZZ = os.environ.get('AFL_FUZZ', 'afl-fuzz')
152 san_flags = ','.join(re.findall('-fsanitize=((?:[a-z]+,?)+)', flags))
153 nosan_flags = ','.join(re.findall('-fno-sanitize=((?:[a-z]+,?)+)', flags))
157 raise RuntimeError('-fno-sanitize={s} and -fsanitize={s} passed'.
182 cc_version_bytes = subprocess.check_output([cc, "--version"])
183 cxx_version_bytes = subprocess.check_output([cxx, "--version"])
186 print("{} --version:\n{}".format(cc, cc_version_bytes.decode('ascii')))
194 version_regex = b'([0-9]+)\.([0-9]+)\.([0-9]+)'
203 return ['-fno-sanitize=signed-integer-overflow']
205 return ['-fno-sanitize=pointer-overflow']
215 Enable sanitizers with --enable-*san.
217 For libFuzzer set LIB_FUZZING_ENGINE and pass --enable-coverage.
223 '--lib-fuzzing-engine',
232 '--enable-coverage',
235 help='Enable coverage instrumentation (-fsanitize-coverage)')
237 '--enable-fuzzer',
240 help=('Enable clang fuzzer (-fsanitize=fuzzer). When enabled '
245 '--enable-asan', dest='asan', action='store_true', help='Enable UBSAN')
247 '--enable-ubsan',
252 '--enable-ubsan-pointer-overflow',
257 '--enable-msan', dest='msan', action='store_true', help='Enable MSAN')
259 '--enable-msan-track-origins', dest='msan_track_origins',
262 '--msan-extra-cppflags',
269 '--msan-extra-cflags',
276 '--msan-extra-cxxflags',
283 '--msan-extra-ldflags',
290 '--enable-sanitize-recover',
293 help='Non-fatal sanitizer errors where possible')
295 '--debug',
301 '--force-memory-access',
307 '--fuzz-rng-seed-size',
313 '--disable-fuzzing-mode',
318 '--enable-stateful-fuzzing',
323 '--cc',
329 '--cxx',
335 '--cppflags',
341 '--cflags',
347 '--cxxflags',
353 '--ldflags',
359 '--mflags',
378 raise RuntimeError('--enable-msan-track-origins requires MSAN')
380 raise RuntimeError('--enable-ubsan-pointer-overflow requires UBSAN')
382 raise RuntimeError('--enable-sanitize-recover but no sanitizers used')
406 '-DDEBUGLEVEL={}'.format(args.debug),
407 '-DMEM_FORCE_MEMORY_ACCESS={}'.format(args.memory_access),
408 '-DFUZZ_RNG_SEED_SIZE={}'.format(args.fuzz_rng_seed_size),
415 '-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp'
418 common_flags += ['-fsanitize=fuzzer']
424 recover_flags = ['-fsanitize-recover=all']
426 recover_flags = ['-fno-sanitize-recover=all']
431 msan_flags = ['-fsanitize=memory']
433 msan_flags += ['-fsanitize-memory-track-origins']
442 common_flags += ['-fsanitize=address']
445 ubsan_flags = ['-fsanitize=undefined']
451 cppflags += ['-DSTATEFUL_FUZZING']
454 cppflags += ['-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION']
507 '-merge=1'.
511 '--corpora',
516 '--artifact',
519 abs_join(CORPORA_DIR, 'TARGET-crash')))
521 '--seed',
524 abs_join(CORPORA_DIR, 'TARGET-seed')))
542 artifact = abs_join(CORPORA_DIR, '{}-crash'.format(target))
544 seed = abs_join(CORPORA_DIR, '{}-seed'.format(target))
558 cmd = [target, '-artifact_prefix={}/'.format(artifact)]
576 Runs an afl-fuzz job.
577 Passes all extra arguments to afl-fuzz.
585 '--corpora',
590 '--output',
593 abs_join(CORPORA_DIR, 'TARGET-afl')))
595 '--afl-fuzz',
612 args.output = abs_join(CORPORA_DIR, '{}-afl'.format(args.TARGET))
628 cmd = [args.afl_fuzz, '-i', corpora, '-o', output] + args.extra
668 '--number',
669 '-n',
674 '--max-size-log',
679 '--seed',
682 abs_join(CORPORA_DIR, 'TARGET-seed')))
684 '--decodecorpus',
690 '--zstd',
695 '--fuzz-rng-seed-size',
711 args.seed = abs_join(CORPORA_DIR, '{}-seed'.format(args.TARGET))
714 raise RuntimeError("{} is not a file run 'make -C {} decodecorpus'".
737 '-n{}'.format(args.number),
738 '-p{}/'.format(compressed),
739 '-o{}'.format(decompressed),
744 '--gen-blocks',
745 '--max-block-size-log={}'.format(min(args.max_size_log, 17))
748 cmd += ['--max-content-size-log={}'.format(args.max_size_log)]
769 '--train',
770 '-r', decompressed,
771 '--maxdict={}'.format(dict_size),
772 '-o', abs_join(dict, '{}.zstd-dict'.format(dict_size))
794 Runs a libfuzzer fuzzer with -merge=1 to build a minimal corpus in
806 extra_args = [corpus, "-merge=1"] + args.extra
810 crashes = abs_join(CORPORA_DIR, '{}-crash'.format(target))
831 cmd = ["zip", "-r", "-q", "-j", "-9", zip_file, "."]
847 print("\tfuzzing helpers (select a command and pass -h for help)\n")
849 print("\t-h, --help\tPrint this message")
858 print("\tzip\t\tZip the minimized corpora up")
867 if args[1] == '-h' or args[1] == '--help' or args[1] == '-H':
889 print("Error: No such command {} (pass -h for help)".format(command))