removed unused compiler
This commit is contained in:
parent
e1268fa200
commit
d7f59f3536
@ -1,88 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
script_dir = os.path.dirname(os.path.realpath(os.path.abspath(__file__)))
|
|
||||||
|
|
||||||
is_cxx = "++" in sys.argv[0]
|
|
||||||
|
|
||||||
def cc_exec(args):
|
|
||||||
if os.getenv("AFL_CC"):
|
|
||||||
cc_name = os.environ["AFL_CC"]
|
|
||||||
else:
|
|
||||||
cc_name = "clang"
|
|
||||||
if is_cxx:
|
|
||||||
if os.getenv("AFL_CXX"):
|
|
||||||
cc_name = os.environ["AFL_CXX"]
|
|
||||||
else:
|
|
||||||
cc_name = "clang++"
|
|
||||||
argv = [cc_name] + args
|
|
||||||
#print(" ".join(argv))
|
|
||||||
return subprocess.run(argv)
|
|
||||||
|
|
||||||
|
|
||||||
def common_opts():
|
|
||||||
return [
|
|
||||||
"-g",
|
|
||||||
]
|
|
||||||
|
|
||||||
def cc_mode():
|
|
||||||
args = common_opts()
|
|
||||||
args += sys.argv[1:]
|
|
||||||
|
|
||||||
args += ["-fsanitize-coverage=trace-pc-guard,trace-cmp"]
|
|
||||||
|
|
||||||
if os.getenv("AFL_USE_ASAN"):
|
|
||||||
args += ["-fsanitize=address"]
|
|
||||||
if os.getenv("AFL_USE_MSAN"):
|
|
||||||
args += ["-fsanitize=memory"]
|
|
||||||
if os.getenv("AFL_USE_UBSAN"):
|
|
||||||
args += [
|
|
||||||
"-fsanitize=undefined",
|
|
||||||
"-fsanitize-undefined-trap-on-error",
|
|
||||||
"-fno-sanitize-recover=all",
|
|
||||||
]
|
|
||||||
|
|
||||||
return cc_exec(args)
|
|
||||||
|
|
||||||
def ld_mode():
|
|
||||||
args = common_opts()
|
|
||||||
|
|
||||||
args += sys.argv[1:]
|
|
||||||
args += [
|
|
||||||
os.path.join(script_dir, "runtime", "rt.o"),
|
|
||||||
os.path.join(script_dir, "target", "release", "liblibfuzzer.a"),
|
|
||||||
]
|
|
||||||
|
|
||||||
args += ["-fsanitize-coverage=trace-pc-guard,trace-cmp"]
|
|
||||||
|
|
||||||
if os.getenv("AFL_USE_ASAN"):
|
|
||||||
args += ["-fsanitize=address"]
|
|
||||||
if os.getenv("AFL_USE_MSAN"):
|
|
||||||
args += ["-fsanitize=memory"]
|
|
||||||
if os.getenv("AFL_USE_UBSAN"):
|
|
||||||
args += [
|
|
||||||
"-fsanitize=undefined",
|
|
||||||
"-fsanitize-undefined-trap-on-error",
|
|
||||||
"-fno-sanitize-recover=all",
|
|
||||||
]
|
|
||||||
|
|
||||||
args += ["-pthread", "-ldl"] # for Rust
|
|
||||||
|
|
||||||
return cc_exec(args)
|
|
||||||
|
|
||||||
def is_ld_mode():
|
|
||||||
return not ("--version" in sys.argv or "--target-help" in sys.argv or
|
|
||||||
"-c" in sys.argv or "-E" in sys.argv or "-S" in sys.argv or
|
|
||||||
"-shared" in sys.argv)
|
|
||||||
|
|
||||||
#print("\x1b[0;36m" + os.path.basename(sys.argv[0]) + " 1.0a\x1b[0m by <andreafioraldi@gmail.com>")
|
|
||||||
|
|
||||||
if len(sys.argv) <= 1:
|
|
||||||
cc_exec(sys.argv[1:])
|
|
||||||
elif is_ld_mode():
|
|
||||||
ld_mode()
|
|
||||||
else:
|
|
||||||
cc_mode()
|
|
Loading…
x
Reference in New Issue
Block a user