From 3643446b235e5636416447f26ef65a9a06b4b73f Mon Sep 17 00:00:00 2001
From: Jens Petersen <petersen@redhat.com>
Date: Fri, 10 Nov 2017 12:12:46 +0900
Subject: [PATCH] -Werror=format-security fails without -Wall

---
 ghc-rpm-macros.spec | 5 ++++-
 macros.ghc          | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index 8fd6e06..97dbb2d 100644
--- a/ghc-rpm-macros.spec
+++ b/ghc-rpm-macros.spec
@@ -11,7 +11,7 @@
 
 Name:           ghc-rpm-macros
 Version:        1.6.50
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        RPM macros for building Haskell packages for GHC
 
 License:        GPLv3+
@@ -161,6 +161,9 @@ EOF
 
 
 %changelog
+* Fri Nov 10 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-5
+- -Werror=format-security fails without -Wall
+
 * Fri Nov 10 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-4
 - do not set -Wall on aarch64 and s390x since -Wunused-label is extremely noisy
 
diff --git a/macros.ghc b/macros.ghc
index c87883e..90a540d 100644
--- a/macros.ghc
+++ b/macros.ghc
@@ -28,7 +28,7 @@ fi
 %global _hardened_ldflags %{nil}\
 # -Wunused-label is extremely noisy\
 %ifarch aarch64 s390x\
-CFLAGS="${CFLAGS:-$(echo %optflags | sed -e s/-Wall//)}"\
+CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall -Werror=format-security //')}"\
 %else\
 CFLAGS="${CFLAGS:-%optflags}"\
 %endif\