From 1b0aeaa4e84be4449a73b24a0a57c04c02589a81 Mon Sep 17 00:00:00 2001 From: Marco Vanotti Date: Wed, 10 Jul 2019 17:54:20 -0700 Subject: Makefile: build fuchsia go binaries using the sdk This commit removes a dependency on fuchsia's tools/devshell/contrib/go, which was removed recently[0]. Now to build go binaries for fuchsia we are not relying on the fuchsia.git repo at all. The code just needs a copy of the fuchsia //third_party/go repository, the fuchsia sdk and a copy of clang. Users should download the sdk and clang beforehand (see documentation for links), and then run (with the correct environment variables): ``` $ make TARGETOS=fuchsia TARGETARCH=amd64 \ SOURCEDIR=$HOME/fuchsia \ FX_SDK_PATH=${HOME}/sdk/fuchsia-sdk \ CLANG_PATH=${HOME}/sdk/clang \ fuchsia_go ``` After that, they will be able to build the syzkaller go binaries by doing: ``` $ make TARGETOS=fuchsia TARGETARCH=amd64 \ SOURCEDIR=$HOME/fuchsia \ FX_SDK_PATH=${HOME}/sdk/fuchsia-sdk \ CLANG_PATH=${HOME}/sdk/clang ``` This commits adds two scripts to tools/fuchsia, one for building go in fuchsia (just calls the ./make.all script in fuchsia's go repo), and one that replaces the devshell/contrib/go script. Given that go is unsupported in fuchsia, this change might break at any point. [0]: https://fuchsia-review.googlesource.com/c/fuchsia/+/291631 --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5372a899f..4bf64a8a1 100644 --- a/Makefile +++ b/Makefile @@ -45,8 +45,9 @@ TARGETGOOS := $(TARGETOS) TARGETGOARCH := $(TARGETVMARCH) ifeq ("$(TARGETOS)", "fuchsia") - # SOURCEDIR should point to fuchsia checkout. - GO = "$(SOURCEDIR)/tools/devshell/contrib/go" +# SOURCEDIR should point to fuchsia checkout. +export FX_SRC_PATH=$(SOURCEDIR) + GO = "tools/fuchsia/go" endif GITREV=$(shell git rev-parse HEAD) @@ -202,6 +203,12 @@ ifeq ($(TARGETOS),fuchsia) else endif +fuchsia_go: +ifeq ($(TARGETOS),fuchsia) + ./tools/fuchsia/build-go.sh +else +endif + generate_trace2syz: (cd tools/syz-trace2syz/parser; ragel -Z -G2 -o lex.go straceLex.rl) (cd tools/syz-trace2syz/parser; goyacc -o strace.go -p Strace -v="" strace.y) -- cgit mrf-deployment