From a70d64c948f589337c0ffeb0e72da54224ab0dec Mon Sep 17 00:00:00 2001 From: y00841556 Date: Fri, 24 Nov 2023 17:24:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=8F=82=E6=95=B0=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- k8s-mpam-controller/Makefile | 4 ++-- k8s-mpam-controller/build.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k8s-mpam-controller/Makefile b/k8s-mpam-controller/Makefile index 6193c49..2a84899 100644 --- a/k8s-mpam-controller/Makefile +++ b/k8s-mpam-controller/Makefile @@ -1,6 +1,6 @@ all: -# go get -d -v ./... - go install -ldflags "-s -w" ./cmd/* + go get -d -v ./... + CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2" go install -buildmode=pie -ldflags "-s -linkmode 'external' -extldflags '-Wl,-z,now'" ./cmd/* # To build in docker envrionment you can run following cmd directly docker: diff --git a/k8s-mpam-controller/build.sh b/k8s-mpam-controller/build.sh index c2f7909..6a292b8 100755 --- a/k8s-mpam-controller/build.sh +++ b/k8s-mpam-controller/build.sh @@ -1,2 +1,2 @@ go get -d -v ./... -go install -ldflags "-s -w" ./cmd/* +CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2" go install -buildmode=pie -ldflags "-s -linkmode 'external' -extldflags '-Wl,-z,now'" ./cmd/* -- Gitee