aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-08-26 07:09:25 +0200
committerDmitry Vyukov <dvyukov@google.com>2016-08-26 07:09:25 +0200
commit0d0fbbe73f5b02bfeac0aedd0b6b9e8417ab0b0f (patch)
treea412c7d3e6d9af44a29c35c6d3f1ecfe8067419f /Makefile
parent34120ddc6e1ab0de360d3467b0d678fa6693e4c9 (diff)
overhaul syscall description generation process
This splits generation process into two phases: 1. Extract values of constants from linux kernel sources. 2. Generate Go code. Constant values are checked in. The advantage is that the second phase is now completely independent from linux source files, kernel version, presence of headers for particular drivers, etc. This allows to change what Go code we generate any time without access to all kernel headers (which in future won't be limited to only upstream headers). Constant extraction process does require proper kernel sources, but this can be done only once by the person who added the driver and has access to the required sources. Then the constant values are checked in for others to use. Consant extraction process is per-file/per-arch. That is, if I am adding a driver that is not present upstream and that works only on a single arch, I will check in constants only for that driver and for that arch.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 9 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 46851d1ed..310c589c4 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ ifeq ($(NOSTATIC), 0)
STATIC_FLAG=-static
endif
-.PHONY: all format clean manager fuzzer executor execprog mutate prog2c stress generate
+.PHONY: all format clean manager fuzzer executor execprog mutate prog2c stress extract generate
all: manager fuzzer executor
@@ -39,14 +39,15 @@ stress:
upgrade:
go build -o ./bin/syz-upgrade github.com/google/syzkaller/tools/syz-upgrade
-SYSCALL_FILES=sys/sys.txt sys/socket.txt sys/tty.txt sys/perf.txt \
- sys/key.txt sys/bpf.txt sys/fuse.txt sys/dri.txt sys/kdbus.txt sys/sctp.txt \
- sys/kvm.txt sys/sndseq.txt sys/sndtimer.txt sys/sndcontrol.txt sys/input.txt \
- sys/netlink.txt sys/tun.txt sys/random.txt sys/kcm.txt sys/netrom.txt
-generate: bin/syz-sysgen $(SYSCALL_FILES)
- bin/syz-sysgen -linux=$(LINUX) -linuxbld=$(LINUXBLD) $(SYSCALL_FILES)
+extract: bin/syz-extract
+ LINUX=$(LINUX) LINUXBLD=$(LINUXBLD) ./extract.sh
+bin/syz-extract: ./syz-extract
+ go build -o $@ ./syz-extract
+
+generate: bin/syz-sysgen
+ bin/syz-sysgen
bin/syz-sysgen: sysgen/*.go
- go build -o $@ sysgen/*.go
+ go build -o $@ ./sysgen
format:
go fmt ./...