Add buildmode=pie to makefile
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
8c77d9ac72
commit
b8c4d85564
@ -49,8 +49,6 @@ script:
|
|||||||
- export CGO_ENABLED=$TRAVIS_CGO_ENABLED
|
- export CGO_ENABLED=$TRAVIS_CGO_ENABLED
|
||||||
- GIT_CHECK_EXCLUDE="./vendor" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make dco
|
- GIT_CHECK_EXCLUDE="./vendor" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make dco
|
||||||
- make fmt
|
- make fmt
|
||||||
# FIXME: For non-linux GOOS, without running `go build -i`, vet fails with `vet: import failed: can't find import: fmt`...
|
|
||||||
# Note that `go build -i` requires write permission to GOROOT. (So it is not called in Makefile)
|
|
||||||
- go build -i .
|
- go build -i .
|
||||||
- make setup
|
- make setup
|
||||||
- make lint
|
- make lint
|
||||||
|
1
Makefile
1
Makefile
@ -45,6 +45,7 @@ GO_TAGS=$(if $(BUILDTAGS),-tags "$(BUILDTAGS)",)
|
|||||||
GO_LDFLAGS=-ldflags "-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) $(EXTRA_LDFLAGS)"
|
GO_LDFLAGS=-ldflags "-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) $(EXTRA_LDFLAGS)"
|
||||||
|
|
||||||
TESTFLAGS_RACE=
|
TESTFLAGS_RACE=
|
||||||
|
GO_GCFLAGS=
|
||||||
|
|
||||||
#Detect the target os
|
#Detect the target os
|
||||||
include Makefile.OS
|
include Makefile.OS
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
COMMANDS += containerd-shim
|
COMMANDS += containerd-shim
|
||||||
|
|
||||||
# amd64 supports go test -race
|
# amd64 supports go test -race
|
||||||
ifeq ("amd64", $(GOARCH))
|
ifeq ($(GOARCH),amd64)
|
||||||
TESTFLAGS_RACE= -race
|
TESTFLAGS_RACE= -race
|
||||||
endif
|
endif
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
COMMANDS += containerd-shim
|
COMMANDS += containerd-shim
|
||||||
|
|
||||||
# amd64 supports go test -race
|
# amd64 supports go test -race
|
||||||
ifeq ("amd64", $(GOARCH))
|
ifeq ($(GOARCH),amd64)
|
||||||
TESTFLAGS_RACE= -race
|
TESTFLAGS_RACE= -race
|
||||||
endif
|
endif
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
#linux specific settings
|
#linux specific settings
|
||||||
COMMANDS += containerd-shim
|
COMMANDS += containerd-shim
|
||||||
|
|
||||||
|
# check GOOS for cross compile builds
|
||||||
|
ifeq ($(GOOS),linux)
|
||||||
|
GO_GCFLAGS= -buildmode=pie
|
||||||
|
endif
|
||||||
|
|
||||||
# amd64 supports go test -race
|
# amd64 supports go test -race
|
||||||
ifeq ("amd64", $(GOARCH))
|
ifeq ($(GOARCH),amd64)
|
||||||
TESTFLAGS_RACE= -race
|
TESTFLAGS_RACE= -race
|
||||||
endif
|
endif
|
||||||
|
@ -6,6 +6,6 @@ FIX_PATH = $(subst /,\,$1)
|
|||||||
BINARY_SUFFIX=".exe"
|
BINARY_SUFFIX=".exe"
|
||||||
|
|
||||||
# amd64 supports go test -race
|
# amd64 supports go test -race
|
||||||
ifeq ("amd64", $(GOARCH))
|
ifeq ($(GOARCH),amd64)
|
||||||
TESTFLAGS_RACE= -race
|
TESTFLAGS_RACE= -race
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user