From eecefab32c6f158629abd2ac7f6cb0b070f88b4a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 26 Jun 2018 18:59:07 +0200 Subject: Makefile: fix fuchsia build --- Makefile | 5 ++--- sys/targets/targets.go | 10 ++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 46fdc1514..7afef95cc 100644 --- a/Makefile +++ b/Makefile @@ -43,14 +43,13 @@ export CGO_ENABLED=0 ifeq ("$(TARGETOS)", "fuchsia") # SOURCEDIR should point to fuchsia checkout. - GO = $(SOURCEDIR)/buildtools/go + GO = $(SOURCEDIR)/third_party/go/bin/go + export GOROOT=$(SOURCEDIR)/third_party/go export CGO_ENABLED=1 ifeq ("$(TARGETARCH)", "amd64") - export GOROOT=$(SOURCEDIR)/out/debug-x64/goroot # Required by the goroot. export ZIRCON_BUILD_DIR=$(SOURCEDIR)/out/build-zircon/build-x64 else ifeq ("$(TARGETARCH)", "arm64") - export GOROOT=$(SOURCEDIR)/out/debug-arm64/goroot # Required by the goroot. export ZIRCON_BUILD_DIR=$(SOURCEDIR)/out/build-zircon/build-arm64 endif diff --git a/sys/targets/targets.go b/sys/targets/targets.go index 2325f17c3..18fa08583 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -148,12 +148,16 @@ var List = map[string]map[string]*Target{ PageSize: 4 << 10, CArch: []string{"__x86_64__"}, KernelHeaderArch: "x64", - CCompiler: os.ExpandEnv("${SOURCEDIR}/buildtools/linux-x64/clang/bin/clang"), + CCompiler: os.ExpandEnv("${SOURCEDIR}/buildtools/linux-x64/clang/bin/clang++"), CrossCFlags: []string{ + "-Wno-deprecated", + "-Wno-error", "--target=x86_64-fuchsia", "-lfdio", "-lzircon", "--sysroot", os.ExpandEnv("${SOURCEDIR}/out/build-zircon/build-x64/sysroot"), + "-L", "${SOURCEDIR}/out/x64/x64-shared", + "-L", "${SOURCEDIR}/out/x64/sdks/zircon_sysroot/sysroot/lib", }, }, "arm64": { @@ -161,8 +165,10 @@ var List = map[string]map[string]*Target{ PageSize: 4 << 10, CArch: []string{"__aarch64__"}, KernelHeaderArch: "arm64", - CCompiler: os.ExpandEnv("${SOURCEDIR}/buildtools/linux-x64/clang/bin/clang"), + CCompiler: os.ExpandEnv("${SOURCEDIR}/buildtools/linux-x64/clang/bin/clang++"), CrossCFlags: []string{ + "-Wno-deprecated", + "-Wno-error", "--target=aarch64-fuchsia", "-lfdio", "-lzircon", -- cgit mrf-deployment