diff --git a/etcd.spec b/etcd.spec index 5ea7282515636b2f48de53b67b491aaead7ef27e..8147312f1ce077d8ba56ef3040f86bc57d2dfa4e 100644 --- a/etcd.spec +++ b/etcd.spec @@ -29,7 +29,7 @@ system.} %define debug_package %{nil} Name: etcd -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -144,9 +144,19 @@ mkdir -p man/man1 cp ../man-%{man_version}/*.1 man/man1/. %build -GO111MODULE=on GOFLAGS=-mod=vendor go build -o %{gobuilddir}/bin/etcd %{goipath} +CGO_CFLAGS="-fstack-protector-strong -fPIE -D_FORTIFY_SOURCE=2 -O2" \ +CGO_LDFLAGS_ALLOW="-Wl,-z,relro,-z,now" \ +CGO_LDFLAGS="-Wl,-z,relro,-z,now -Wl,-z,noexecstack" \ +GO111MODULE=on GOFLAGS=-mod=vendor \ +go build -buildmode=pie -ldflags "-linkmode=external -w -s" \ +-o %{gobuilddir}/bin/etcd %{goipath} for cmd in etcdctl; do - GO111MODULE=on GOFLAGS=-mod=vendor go build -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd + CGO_CFLAGS="-fstack-protector-strong -fPIE -D_FORTIFY_SOURCE=2 -O2" \ + CGO_LDFLAGS_ALLOW="-Wl,-z,relro,-z,now" \ + CGO_LDFLAGS="-Wl,-z,relro,-z,now -Wl,-z,noexecstack" \ + GO111MODULE=on GOFLAGS=-mod=vendor \ + go build -buildmode=pie -ldflags "-linkmode=external -w -s" \ + -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done # make -C docs help @@ -216,5 +226,8 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ #%gopkgfiles %changelog +* Wed Sep 2021 jikui - 3.4.7-2 +- modify build flags for secure compilation options + * Thu Aug 13 2020 jiangxinyu - 3.4.7-1 - Init etcd project