summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-15 16:19:10 -0400
committerGitHub <noreply@github.com>2021-06-15 16:19:10 -0400
commit0c204084b42e85349182eb353c17f77b5672e12b (patch)
treeeb508fb1cbb14eb825817d75d4fb8aef1654c19d /Makefile
parente405f1205378ab35d4e37eed3b94a683c26bb818 (diff)
parent5f2c0f63ad88680818e0d4a55da672d1c80c04bf (diff)
downloadpodman-0c204084b42e85349182eb353c17f77b5672e12b.tar.gz
podman-0c204084b42e85349182eb353c17f77b5672e12b.tar.bz2
podman-0c204084b42e85349182eb353c17f77b5672e12b.zip
Merge pull request #10679 from cevich/fix_static_build
Fix building static podman-remote
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 9 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 9b5dd34a5..53be33ea3 100644
--- a/Makefile
+++ b/Makefile
@@ -93,11 +93,14 @@ LIBPOD := ${PROJECT}/v3/libpod
GCFLAGS ?= all=-trimpath=$(CURDIR)
ASMFLAGS ?= all=-trimpath=$(CURDIR)
LDFLAGS_PODMAN ?= \
- -X $(LIBPOD)/define.gitCommit=$(GIT_COMMIT) \
- -X $(LIBPOD)/define.buildInfo=$(BUILD_INFO) \
- -X $(LIBPOD)/config._installPrefix=$(PREFIX) \
- -X $(LIBPOD)/config._etcDir=$(ETCDIR) \
- $(EXTRA_LDFLAGS)
+ -X $(LIBPOD)/define.gitCommit=$(GIT_COMMIT) \
+ -X $(LIBPOD)/define.buildInfo=$(BUILD_INFO) \
+ -X $(LIBPOD)/config._installPrefix=$(PREFIX) \
+ -X $(LIBPOD)/config._etcDir=$(ETCDIR) \
+ $(EXTRA_LDFLAGS)
+LDFLAGS_PODMAN_STATIC ?= \
+ $(LDFLAGS_PODMAN) \
+ -extldflags=-static
#Update to LIBSECCOMP_COMMIT should reflect in Dockerfile too.
LIBSECCOMP_COMMIT := v2.3.3
# Rarely if ever should integration tests take more than 50min,
@@ -314,7 +317,7 @@ $(SRCBINDIR)/podman$(BINSFX): $(SRCBINDIR) .gopathok $(SOURCES) go.mod go.sum
-o $@ ./cmd/podman
$(SRCBINDIR)/podman-remote-static: $(SRCBINDIR) .gopathok $(SOURCES) go.mod go.sum
- CGO_ENABLED=$(CGO_ENABLED) \
+ CGO_ENABLED=0 \
GOOS=$(GOOS) \
$(GO) build \
$(BUILDFLAGS) \