From 2f51be3749a50e9e256ce529f6a2db5a91dab9d6 Mon Sep 17 00:00:00 2001 From: vegbir Date: Mon, 19 Sep 2022 19:40:01 +0800 Subject: [PATCH] fix compile problem and make rubik real static --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index eff29bc..4e74663 100644 --- a/Makefile +++ b/Makefile @@ -26,17 +26,19 @@ LD_FLAGS := -ldflags '-buildid=none -tmpdir=$(TMP_DIR) \ -X isula.org/rubik/pkg/version.BuildTime=$(BUILD_TIME) \ -X isula.org/rubik/pkg/version.Version=$(VERSION) \ -X isula.org/rubik/pkg/version.Release=$(RELEASE) \ - -extldflags=-ftrapv \ - -extldflags=-Wl,-z,relro,-z,now -linkmode=external -extldflags=-static' + -buildmode=pie \ + -extldflags=-ftrapv -extldflags=-zrelro -extldflags=-znow \ + -linkmode=external \ + -extldflags "-static-pie -Wl,-z,now"' -export GO111MODULE=off +export GO111MODULE=on GO_BUILD=CGO_ENABLED=1 \ CGO_CFLAGS="-fstack-protector-strong -fPIE" \ CGO_CPPFLAGS="-fstack-protector-strong -fPIE" \ CGO_LDFLAGS_ALLOW='-Wl,-z,relro,-z,now' \ CGO_LDFLAGS="-Wl,-z,relro,-z,now -Wl,-z,noexecstack" \ - go build -buildmode=pie + go build -mod=vendor all: release -- Gitee