mirror of
https://github.com/containers/skopeo.git
synced 2025-08-28 19:11:58 +00:00
Merge pull request #408 from cyphar/use-buildmode-pie
makefile: use -buildmode=pie
This commit is contained in:
commit
88cff614ed
6
Makefile
6
Makefile
@ -29,6 +29,10 @@ ifeq ($(DEBUG), 1)
|
|||||||
override GOGCFLAGS += -N -l
|
override GOGCFLAGS += -N -l
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(shell go env GOOS), linux)
|
||||||
|
GO_DYN_FLAGS="-buildmode=pie"
|
||||||
|
endif
|
||||||
|
|
||||||
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
||||||
DOCKER_IMAGE := skopeo-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
|
DOCKER_IMAGE := skopeo-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
|
||||||
# set env like gobuildtag?
|
# set env like gobuildtag?
|
||||||
@ -71,7 +75,7 @@ binary-static: cmd/skopeo
|
|||||||
|
|
||||||
# Build w/o using Docker containers
|
# Build w/o using Docker containers
|
||||||
binary-local:
|
binary-local:
|
||||||
$(GPGME_ENV) $(GO) build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o skopeo ./cmd/skopeo
|
$(GPGME_ENV) $(GO) build ${GO_DYN_FLAGS} -ldflags "-X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o skopeo ./cmd/skopeo
|
||||||
|
|
||||||
binary-local-static:
|
binary-local-static:
|
||||||
$(GPGME_ENV) $(GO) build -ldflags "-extldflags \"-static\" -X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o skopeo ./cmd/skopeo
|
$(GPGME_ENV) $(GO) build -ldflags "-extldflags \"-static\" -X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o skopeo ./cmd/skopeo
|
||||||
|
Loading…
Reference in New Issue
Block a user