From 10f48326f30ae89bea01124bdbab4702a21f3655 Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Thu, 3 Dec 2020 11:17:02 -0500 Subject: [PATCH] Suppress prototype warning for nss headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Miroslav Rezanina Message-id: <20201203111702.215084-1-mrezanin@redhat.com> Patchwork-id: 100201 O-Subject: [RHEL-7.9.z qemu-kvm PATCH] Suppress prototype warning for nss headers Bugzilla: 1884997 RH-Acked-by: Thomas Huth RH-Acked-by: Stefan Hajnoczi RH-Acked-by: Jon Maloy From: Miroslav Rezanina Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1884997 Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=33460150 branch: rhel79/master Upstream: n/a Rebase of nss introduced following warning when using it for building qemu-kvm: /usr/include/nss3/pk11pub.h:951:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes] int SECMOD_GetSystemFIPSEnabled(); This issue is tracked by https://bugzilla.redhat.com/show_bug.cgi?id=1885321. However, this issue is not important enough to fix (as discussed in the bugzilla). We have to hack qemu-kvm to live with this warning. To do it we add following hacks: 1) We disable using -Werror for nss test in configure. This allows configure to pass. 2) We disable -Werror=scrict-prototypes when including nss headers. This allows build to pass. Signed-off-by: Miroslav Rezanina Signed-off-by: Jon Maloy --- configure | 13 ++++++------- libcacard/vcard_emul_nss.c | 8 ++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 34e3accfdd..77c2f0a438 100755 --- a/configure +++ b/configure @@ -3246,13 +3246,11 @@ EOF libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" test_cflags="$libcacard_cflags" - # The header files in nss < 3.13.3 have a bug which causes them to - # emit a warning. If we're going to compile QEMU with -Werror, then - # test that the headers don't have this bug. Otherwise we would pass - # the configure test but fail to compile QEMU later. - if test "$werror" = "yes"; then - test_cflags="-Werror $test_cflags" - fi + # nss > 3.53 generates warning when including it's headers. This breaks the + # build so we have to disable -Werror for build test. + # See https://bugzilla.redhat.com/show_bug.cgi?id=1885321 + old_werror=$werror + werror=no if test -n "$libtool" && $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ compile_prog "$test_cflags" "$libcacard_libs"; then @@ -3266,6 +3264,7 @@ EOF fi smartcard_nss="no" fi + werror=$old_werror fi # check for libusb diff --git a/libcacard/vcard_emul_nss.c b/libcacard/vcard_emul_nss.c index 1a3e5683bc..f1aa51943b 100644 --- a/libcacard/vcard_emul_nss.c +++ b/libcacard/vcard_emul_nss.c @@ -17,8 +17,16 @@ /* avoid including prototypes.h that redefines uint32 */ #define NO_NSPR_10_SUPPORT +/* + * nss > 3.53 genererates prototype warning when including headers so we can't + * treat this warning ass error to allow build. + * See https://bugzilla.redhat.com/show_bug.cgi?id=1885321 + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-prototypes" #include #include +#pragma GCC diagnostic pop #include #include #include -- 2.18.2