Add PIE, BIND_NOW, RELRO secure compilation options

(cherry picked from commit bb3fcc8611dd5ab5532eaacfa9e51883e1e2efd2)
This commit is contained in:
lyn1001 2023-02-09 15:20:26 +08:00 committed by openeuler-sync-bot
parent 3156a507da
commit e596f89f0a

View File

@ -2,7 +2,7 @@
Name: k3s-plugins Name: k3s-plugins
Version: 1.1.1 Version: 1.1.1
Release: 1 Release: 2
Summary: some standard networking plugins, maintained by the CNI team Summary: some standard networking plugins, maintained by the CNI team
URL : https://github.com/rancher/plugins URL : https://github.com/rancher/plugins
Source0: https://github.com/rancher/plugins/archive/refs/tags/v%{version}-%{tagname}.tar.gz Source0: https://github.com/rancher/plugins/archive/refs/tags/v%{version}-%{tagname}.tar.gz
@ -70,7 +70,7 @@ popd
OutputDir=`pwd`/.gopath/cni OutputDir=`pwd`/.gopath/cni
GOPATH=`pwd`/.gopath GOPATH=`pwd`/.gopath
pushd .gopath/src/github.com/containernetworking/plugins 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 popd
%install %install
@ -81,5 +81,8 @@ install -p -m 755 ./.gopath/cni $RPM_BUILD_ROOT/%{_datadir}/k3s/
%{_datadir}/k3s/ %{_datadir}/k3s/
%changelog %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 * Mon Oct 10 2022 Ge Wang <wangge20@h-partners.com> - 1.1.1-1
- Init package - Init package