From df648d77d5d1006a6a048db68f7d6a8fe7d21843 Mon Sep 17 00:00:00 2001 From: Mikhail Kashkarov Date: Fri, 13 Jul 2018 20:44:40 +0300 Subject: [PATCH] Repair glibc make check with -Wformat options enabled. With -Wformat options enabled there are test fails: cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security] cc1: all warnings being treated as errors ../o-iterator.mk:9: recipe for target '/home/abuild/rpmbuild/BUILD/glibc-2.24/cc-base/time/test_time.o' failed As some targets disables -Wformat explicitly: (time/Makefile): # Don't warn about Y2k problem in strftime format string. CFLAGS-test_time.c = -Wno-format Change-Id: Ic0f8b6bb07ea7875a75b994584ac10cec6515827 --- packaging/glibc.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packaging/glibc.spec b/packaging/glibc.spec index fd7882a..0094a7f 100644 --- a/packaging/glibc.spec +++ b/packaging/glibc.spec @@ -257,6 +257,11 @@ BuildFlags=$(echo %{optflags} | sed -e "s/-Wp,-D_FORTIFY_SOURCE=2//g" | sed -e " BuildFlags="$BuildFlags -O2 -g -U_FORTIFY_SOURCE" BuildFlags="$(echo $BuildFlags | sed -e 's#-fstack-protector##' -e 's#-ffortify=[0-9]*##')" BuildFlags="$(echo $BuildFlags | sed -e 's/-Wa,-mimplicit-it=thumb//g' | sed -e 's/-mthumb//g')" +# Turn off all -Wformat enable flags as there are glibc tests that explicitly +# append -Wno-format and with enabled Wformat options that produced warnings +# that turns into errors. Remove -Wformat=1|2 or -Wformat-..-arg +BuildFlags="$(echo $BuildFlags | sed -re 's/-Wformat((=[1-2])|((-\w+)+))?(\s|$)//g')" + BuildCC="%__cc" BuildCCplus="%__cxx" add_ons=",libidn" -- 2.7.4