From a2d1f4cfb459ef614b6e1d25426e71eee974a813 Mon Sep 17 00:00:00 2001 From: Evan Lezar <7723350-elezar@users.noreply.gitlab.com> Date: Fri, 10 Feb 2023 14:17:53 +0000 Subject: [PATCH] Merge branch 'update-ldflags' into 'main' Update ldflags for cgo See merge request nvidia/container-toolkit/container-toolkit!290 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a9fc1ffe..7f7d375b 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ cmd-%: COMMAND_BUILD_OPTIONS = -o $(PREFIX)/$(*) endif cmds: $(CMD_TARGETS) $(CMD_TARGETS): cmd-%: - GOOS=$(GOOS) go build -ldflags "-s -w -X $(CLI_VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) -X $(CLI_VERSION_PACKAGE).version=$(CLI_VERSION)" $(COMMAND_BUILD_OPTIONS) $(MODULE)/cmd/$(*) + GOOS=$(GOOS) go build -ldflags "-extldflags=-Wl,-z,lazy -s -w -X $(CLI_VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) -X $(CLI_VERSION_PACKAGE).version=$(CLI_VERSION)" $(COMMAND_BUILD_OPTIONS) $(MODULE)/cmd/$(*) build: GOOS=$(GOOS) go build ./...