diff --git a/examples/csmith/.gitignore b/examples/csmith/.gitignore index 2680092f2..402ddd3e4 100644 --- a/examples/csmith/.gitignore +++ b/examples/csmith/.gitignore @@ -4,3 +4,4 @@ *.c *.relf *.bir +platform.info diff --git a/examples/csmith/Makefile b/examples/csmith/Makefile index 9abb60750..fca709659 100644 --- a/examples/csmith/Makefile +++ b/examples/csmith/Makefile @@ -6,11 +6,12 @@ ADTS=$(addsuffix .adt,$(SOURCENAMES)) OUTS=$(addsuffix .out,$(SOURCENAMES)) CHECKSUMS=$(addsuffix .checksum,$(SOURCENAMES)) -CSMITH_HEADER ?= "/usr/include/csmith/" -CC=clang -target aarch64-linux-gnu +CSMITH_INCLUDE ?= /usr/include/csmith +CSMITH_HEADER = $(CSMITH_INCLUDE) +CC ?=clang -target aarch64-linux-gnu %.out : %.c - $(CC) $< -w -I $(CSMITH_HEADER) -o $@ + $(CC) $< -I$(CSMITH_HEADER) -w -o $@ %.relf : %.out readelf -s -r -w $< > $@ @@ -19,7 +20,7 @@ CC=clang -target aarch64-linux-gnu bap $< -d adt:$@ %.checksum : %.c - clang -w -I $(CSMITH_HEADER) $< -o $<.out && ./$<.out || true + $(CC) -w -I $(CSMITH_HEADER) $< -o $<.out && ./$<.out || true default : $(ADTS) $(RELFS) diff --git a/examples/csmith/gen.py b/examples/csmith/gen.py index 03b531475..5dd5caa1e 100644 --- a/examples/csmith/gen.py +++ b/examples/csmith/gen.py @@ -11,7 +11,6 @@ # produces programs that we can't handle # cmd = ["csmith", "--seed", str(seed), "--max-block-size", str(max_blocksize), "--max-funcs", str(max_funcs), "--output", f"{fname}.c"] -csmith_header = "/usr/include/csmith/" csmith_safe = "--no-arrays --no-bitfields --no-checksum --no-comma-operators --no-longlong --no-int8 --no-uint8 --no-float --no-math64 --no-inline-function --no-safe-math --no-packed-struct --no-pointers --no-structs --no-unions --no-volatile-pointers --no-const-pointers".split(" ") files = []