代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/authz 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 9588ffd7c133fd1b40b4a8f5841f3b9537a8466c Mon Sep 17 00:00:00 2001
From: zhangsong234 <[email protected]>
Date: Fri, 19 Mar 2021 14:52:35 +0800
Subject: [PATCH] fix safety build
Signed-off-by: zhangsong234 <[email protected]>
---
Makefile | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 6050a58..19e4af6 100644
--- a/Makefile
+++ b/Makefile
@@ -12,16 +12,30 @@
# Create: 2019-01-18
VERSION ?= v1.0.0
+TAGS="cgo static_build"
+BEP_DIR=/tmp/authz-build-bep
+BEP_FLAGS=-tmpdir=/tmp/authz-build-bep
-default: binary
+default: dep binary
-ENV = CGO_ENABLED=0
-GO_LDFLAGS = "-X main.version=$(VERSION)"
-GOMOD = "-mod=vendor"
+GO_LDFLAGS = "-buildid=IdByiSula $(BEP_FLAGS) -buildmode=pie -extldflags=-static -extldflags=-Wl,-z,relro,-z,now -X main.version=$(VERSION)"
+ifneq ($(GOPATH), )
+CUS_GOPATH=${GOPATH}:${PWD}
+ENV = GOPATH=${CUS_GOPATH} \
+ CGO_ENABLED=1 \
+ CGO_CFLAGS="-fstack-protector-strong -fPIE" \
+ CGO_LDFLAGS_ALLOW='-Wl,-z,relro,-z,now' \
+ CGO_LDFLAGS="-Wl,-z,relro,-z,now -Wl,-z,noexecstack"
+else
+ENV = CGO_ENABLED=1
+endif
+
+dep:
+ mkdir -p $(BEP_DIR)
binary:
mkdir -p bin/
- $(ENV) go build $(GOMOD) -o bin/authz-broker --ldflags $(GO_LDFLAGS) -a -installsuffix cgo ./main.go
+ $(ENV) go build -mod=vendor -tags ${TAGS} -ldflags $(GO_LDFLAGS) -o bin/authz-broker ./main.go
clean:
rm -rf bin/
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。