From e4ee13ea3d39847e5d9ba7d54255e50da27de9b2 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 10 Dec 2020 15:41:00 -0700 Subject: [PATCH] Work around more gcc-11 false positive diagnostics --- gcc-11.patch | 21 +++++++++++++++++++++ strace.spec | 11 ++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/gcc-11.patch b/gcc-11.patch index bbd12a8..553579c 100644 --- a/gcc-11.patch +++ b/gcc-11.patch @@ -18,4 +18,25 @@ index e25e32a..d23715c 100644 +#pragma GCC diagnostic pop } + static void +diff --git a/mmsghdr.c b/mmsghdr.c +index 3fede19..5db35d8 100644 +--- a/mmsghdr.c ++++ b/mmsghdr.c +@@ -78,6 +78,8 @@ static void + save_mmsgvec_namelen(struct tcb *const tcp, kernel_ulong_t addr, + unsigned int len, const char *const timeout) + { ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Warray-bounds" + if (len > IOV_MAX) + len = IOV_MAX; + +@@ -99,6 +101,7 @@ save_mmsgvec_namelen(struct tcb *const tcp, kernel_ulong_t addr, + data->count = i; + + set_tcb_priv_data(tcp, data, free_mmsgvec_data); ++#pragma GCC diagnostic pop + } + static void diff --git a/strace.spec b/strace.spec index 4f0bf6f..d472427 100644 --- a/strace.spec +++ b/strace.spec @@ -1,7 +1,7 @@ Summary: Tracks and displays system calls associated with a running process Name: strace Version: 5.9 -Release: 2%{?dist} +Release: 3%{?dist} # The test suite is GPLv2+, all the rest is LGPLv2.1+. License: LGPL-2.1+ and GPL-2.0+ # Some distros require Group tag to be present, @@ -100,6 +100,12 @@ done wait %check +# The tests are riddled with an idiom that triggers a false positives +# from gcc-11. Out of bounds issues in the testsuite are not +# particularly important, so we just make them non-fatal +sed -i "s/-Werror$/-Werror -Wno-error=array-bounds -Wno-error=stringop-overread/" tests/Makefile +sed -i "s/-Werror$/-Werror -Wno-error=array-bounds -Wno-error=stringop-overread/" tests-m32/Makefile +sed -i "s/-Werror$/-Werror -Wno-error=array-bounds -Wno-error=stringop-overread/" tests-mx32/Makefile %{buildroot}%{_bindir}/strace -V %make_build -k check VERBOSE=1 echo 'BEGIN OF TEST SUITE INFORMATION' @@ -116,6 +122,9 @@ echo 'END OF TEST SUITE INFORMATION' %{_mandir}/man1/* %changelog +* Wed Oct 21 2020 Eugene Syromyatnikov - 5.9-3 +- Work around more gcc-11 false positive diagnostics + * Wed Oct 21 2020 Eugene Syromyatnikov - 5.9-2 - Mark even more tests as XFAIL so the build succeedes (references: #1886468, #1886480).