From d7f68e9ee2182417e9124bace0890203f6993868 Mon Sep 17 00:00:00 2001 From: Ismael Luceno Date: Tue, 8 Dec 2020 22:39:38 +0100 Subject: [PATCH] Filter flags taken from LDFLAGS into CGO_LDFLAGS Make sure we take only flags compatible with cgo. Solves: https://github.com/cli/cli/issues/2577 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 22f3672b7..e29d67b07 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ CGO_CPPFLAGS ?= ${CPPFLAGS} export CGO_CPPFLAGS CGO_CFLAGS ?= ${CFLAGS} export CGO_CFLAGS -CGO_LDFLAGS ?= ${LDFLAGS} +CGO_LDFLAGS ?= $(filter -g -L% -l% -O%,${LDFLAGS}) export CGO_LDFLAGS GO_LDFLAGS := -X github.com/cli/cli/internal/build.Version=$(GH_VERSION) $(GO_LDFLAGS)