From e0f9d7d415abb1810823fd316bdfdeafc0d23fda Mon Sep 17 00:00:00 2001 From: Piggy Date: Thu, 3 Mar 2022 11:56:18 +0800 Subject: [PATCH] disable Go compiler optimization for riscv64 (#2035) --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index de636187c04..b58998e5dd1 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,11 @@ GO_FLAGS += "-ldflags=-s -w" # Avoid embedding the build path in the executable for more reproducible builds GO_FLAGS += -trimpath +# Temporary workaround for golang/go#51101 before Go 1.18/1.17.8 is released +ifeq ($(GOARCH), riscv64) + GO_FLAGS += "-gcflags=all=-N -l" +endif + esbuild: cmd/esbuild/version.go cmd/esbuild/*.go pkg/*/*.go internal/*/*.go go.mod CGO_ENABLED=0 go build $(GO_FLAGS) ./cmd/esbuild