!5 [sync] PR-4: 增加 PIE, BIND_NOW, RELRO 安全编译选项

From: @openeuler-sync-bot 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
This commit is contained in:
openeuler-ci-bot 2023-02-09 11:43:53 +00:00 committed by Gitee
commit b347dc2a8c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -2,7 +2,7 @@
Name: k3s-plugins
Version: 1.1.1
Release: 1
Release: 2
Summary: some standard networking plugins, maintained by the CNI team
URL : https://github.com/rancher/plugins
Source0: https://github.com/rancher/plugins/archive/refs/tags/v%{version}-%{tagname}.tar.gz
@ -70,7 +70,7 @@ popd
OutputDir=`pwd`/.gopath/cni
GOPATH=`pwd`/.gopath
pushd .gopath/src/github.com/containernetworking/plugins
GO111MODULE=off GOPATH=$GOPATH CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -ldflags "$VERSIONFLAGS $LDFLAGS" -o $OutputDir
GO111MODULE=off GOPATH=$GOPATH CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -buildmode=pie -ldflags "$VERSIONFLAGS $LDFLAGS -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now ' " -o $OutputDir
popd
%install
@ -81,5 +81,8 @@ install -p -m 755 ./.gopath/cni $RPM_BUILD_ROOT/%{_datadir}/k3s/
%{_datadir}/k3s/
%changelog
* Thu Feb 9 2023 liyanan <liyanan32@h-partners.com> - 1.1.1-2
- Add PIE, BIND_NOW, RELRO secure compilation options
* Mon Oct 10 2022 Ge Wang <wangge20@h-partners.com> - 1.1.1-1
- Init package