From d1a88510856c352db84d1b8ffa252c0a9ce30dec Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 17 Nov 2018 11:20:17 -0800 Subject: sys/targest: introduce target.BuildOS We can't cross-compile native binaries from just any OS to any other. For most OSes we can do only native compilation. Some can only be compiled from linux. To date we avoided this problem completely (mostly assumed linux build OS). Make this notion of what can build what explicit. --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8c931312f..1828ab1c5 100644 --- a/Makefile +++ b/Makefile @@ -110,10 +110,16 @@ target: # executor uses stacks of limited size, so no jumbo frames. executor: +ifeq ($(BUILDOS),$(NATIVEBUILDOS)) mkdir -p ./bin/$(TARGETOS)_$(TARGETARCH) $(CC) -o ./bin/$(TARGETOS)_$(TARGETARCH)/syz-executor$(EXE) executor/executor.cc \ -pthread -Wall -Wframe-larger-than=8192 -Wparentheses -Werror -O2 $(ADDCFLAGS) $(CFLAGS) \ -DGOOS_$(TARGETOS)=1 -DGOARCH_$(TARGETARCH)=1 -DGIT_REVISION=\"$(REV)\" +else + $(info ************************************************************************************) + $(info Building executor for ${TARGETOS} is not supported on ${BUILDOS}. Executor will not be built.) + $(info ************************************************************************************) +endif manager: GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(HOSTGO) build $(GOHOSTFLAGS) -o ./bin/syz-manager github.com/google/syzkaller/syz-manager @@ -268,7 +274,7 @@ arch_openbsd_amd64_target: arch_windows_amd64_target: env GOOG=windows GOARCH=amd64 $(GO) install ./syz-fuzzer - env TARGETOS=windows TARGETARCH=amd64 $(MAKE) fuzzer execprog stress + env TARGETOS=windows TARGETARCH=amd64 $(MAKE) target arch_test: env TARGETOS=test TARGETARCH=64 $(MAKE) executor -- cgit mrf-deployment