From 3f0cea4fe170b5c4d5d207d61b2087acf270ba70 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Mon, 7 Dec 2020 14:55:44 -0500 Subject: [PATCH] -fcf-protection not for centos <= 7 Signed-off-by: Lokesh Mandvekar --- buildah.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/buildah.spec b/buildah.spec index 0c54f20..421a7db 100644 --- a/buildah.spec +++ b/buildah.spec @@ -115,9 +115,12 @@ mv vendor src export GOPATH=$(pwd)/_build:$(pwd) export BUILDTAGS='seccomp selinux' -export CGO_CFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -ffat-lto-objects -fexceptions -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' +export CGO_CFLAGS="-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -ffat-lto-objects -fexceptions -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" %ifarch x86_64 -export CGO_CFLAGS="$CGO_CFLAGS -m64 -mtune=generic -fcf-protection" +export CGO_CFLAGS="$CGO_CFLAGS -m64 -mtune=generic" +%if 0%{?fedora} || 0%{?centos} >= 8 +export CGO_CFLAGS="$CGO_CFLAGS -fcf-protection" +%endif %endif # These extra flags present in %%{optflags} have been skipped for now as they break the build #export CGO_CFLAGS="$CGO_CFLAGS -flto=auto -Wp,D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1"