qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings
@ 2020-06-17  4:37 Richard Henderson
  2020-06-17  4:37 ` [PATCH v3 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning Richard Henderson
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Richard Henderson @ 2020-06-17  4:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Three of these patches are for cleaning up warnings vs clang-10.

The -Wtautological-type-limit-compare patch has been improved
as suggested by Eric Blake.

The final patch is for a "new" warning from gcc-9 on aarch64 hosts.
Our build box has been upgraded from bionic, so the warning is new
to me, anyway.

Changes since v2:
  * Adjustments to "Clean up warning flag lists" (eblake).
  * Add -Wpsabi to tests/plugins (ajb).


r~


Philippe Mathieu-Daudé (1):
  fpu/softfloat: Silence 'bitwise negation of boolean expression'
    warning

Richard Henderson (3):
  configure: Clean up warning flag lists
  configure: Disable -Wtautological-type-limit-compare
  configure: Add -Wno-psabi

Wei Wang (1):
  migration: fix xbzrle encoding rate calculation

 configure             | 44 +++++++++++++++++++++++++++++++++----------
 fpu/softfloat.c       | 33 +++++++++++++++++++++++---------
 migration/ram.c       |  4 +---
 tests/plugin/Makefile |  2 +-
 4 files changed, 60 insertions(+), 23 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v3 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning
  2020-06-17  4:37 [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings Richard Henderson
@ 2020-06-17  4:37 ` Richard Henderson
  2020-06-17 10:37   ` Alex Bennée
  2020-06-17  4:37 ` [PATCH v3 2/5] migration: fix xbzrle encoding rate calculation Richard Henderson
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Richard Henderson @ 2020-06-17  4:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Thomas Huth, alex.bennee

From: Philippe Mathieu-Daudé <philmd@redhat.com>

When building with clang version 10.0.0-4ubuntu1, we get:

    CC      lm32-softmmu/fpu/softfloat.o
  fpu/softfloat.c:3365:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
      absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  fpu/softfloat.c:3423:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
          absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven );
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  ...

  fpu/softfloat.c:4273:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
          zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven );
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix by rewriting the fishy bitwise AND of two bools as an int.

Suggested-by: Eric Blake <eblake@redhat.com>
Buglink: https://bugs.launchpad.net/bugs/1881004
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200528155420.9802-1-philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 fpu/softfloat.c | 33 ++++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 6c8f2d597a..5e9746c287 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -3362,7 +3362,9 @@ static int32_t roundAndPackInt32(bool zSign, uint64_t absZ,
     }
     roundBits = absZ & 0x7F;
     absZ = ( absZ + roundIncrement )>>7;
-    absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
+    if (!(roundBits ^ 0x40) && roundNearestEven) {
+        absZ &= ~1;
+    }
     z = absZ;
     if ( zSign ) z = - z;
     if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) {
@@ -3420,7 +3422,9 @@ static int64_t roundAndPackInt64(bool zSign, uint64_t absZ0, uint64_t absZ1,
     if ( increment ) {
         ++absZ0;
         if ( absZ0 == 0 ) goto overflow;
-        absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven );
+        if (!(absZ1 << 1) && roundNearestEven) {
+            absZ0 &= ~1;
+        }
     }
     z = absZ0;
     if ( zSign ) z = - z;
@@ -3480,7 +3484,9 @@ static int64_t roundAndPackUint64(bool zSign, uint64_t absZ0,
             float_raise(float_flag_invalid, status);
             return UINT64_MAX;
         }
-        absZ0 &= ~(((uint64_t)(absZ1<<1) == 0) & roundNearestEven);
+        if (!(absZ1 << 1) && roundNearestEven) {
+            absZ0 &= ~1;
+        }
     }
 
     if (zSign && absZ0) {
@@ -3603,7 +3609,9 @@ static float32 roundAndPackFloat32(bool zSign, int zExp, uint32_t zSig,
         status->float_exception_flags |= float_flag_inexact;
     }
     zSig = ( zSig + roundIncrement )>>7;
-    zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
+    if (!(roundBits ^ 0x40) && roundNearestEven) {
+        zSig &= ~1;
+    }
     if ( zSig == 0 ) zExp = 0;
     return packFloat32( zSign, zExp, zSig );
 
@@ -3757,7 +3765,9 @@ static float64 roundAndPackFloat64(bool zSign, int zExp, uint64_t zSig,
         status->float_exception_flags |= float_flag_inexact;
     }
     zSig = ( zSig + roundIncrement )>>10;
-    zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven );
+    if (!(roundBits ^ 0x200) && roundNearestEven) {
+        zSig &= ~1;
+    }
     if ( zSig == 0 ) zExp = 0;
     return packFloat64( zSign, zExp, zSig );
 
@@ -3983,8 +3993,9 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecision, bool zSign,
             }
             if ( increment ) {
                 ++zSig0;
-                zSig0 &=
-                    ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven );
+                if (!(zSig1 << 1) && roundNearestEven) {
+                    zSig0 &= ~1;
+                }
                 if ( (int64_t) zSig0 < 0 ) zExp = 1;
             }
             return packFloatx80( zSign, zExp, zSig0 );
@@ -4000,7 +4011,9 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecision, bool zSign,
             zSig0 = UINT64_C(0x8000000000000000);
         }
         else {
-            zSig0 &= ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven );
+            if (!(zSig1 << 1) && roundNearestEven) {
+                zSig0 &= ~1;
+            }
         }
     }
     else {
@@ -4270,7 +4283,9 @@ static float128 roundAndPackFloat128(bool zSign, int32_t zExp,
     }
     if ( increment ) {
         add128( zSig0, zSig1, 0, 1, &zSig0, &zSig1 );
-        zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven );
+        if ((zSig2 + zSig2 == 0) && roundNearestEven) {
+            zSig1 &= ~1;
+        }
     }
     else {
         if ( ( zSig0 | zSig1 ) == 0 ) zExp = 0;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 2/5] migration: fix xbzrle encoding rate calculation
  2020-06-17  4:37 [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings Richard Henderson
  2020-06-17  4:37 ` [PATCH v3 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning Richard Henderson
@ 2020-06-17  4:37 ` Richard Henderson
  2020-06-17 10:25   ` Philippe Mathieu-Daudé
  2020-06-17 10:54   ` Alex Bennée
  2020-06-17  4:37 ` [PATCH v3 3/5] configure: Clean up warning flag lists Richard Henderson
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 15+ messages in thread
From: Richard Henderson @ 2020-06-17  4:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Wei Wang, alex.bennee, Dr . David Alan Gilbert

From: Wei Wang <wei.w.wang@intel.com>

It's reported an error of implicit conversion from "unsigned long" to
"double" when compiling with Clang 10. Simply make the encoding rate 0
when the encoded_size is 0.

Fixes: e460a4b1a4
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 migration/ram.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/migration/ram.c b/migration/ram.c
index 41cc530d9d..069b6e30bc 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -913,10 +913,8 @@ static void migration_update_rates(RAMState *rs, int64_t end_time)
         unencoded_size = (xbzrle_counters.pages - rs->xbzrle_pages_prev) *
                          TARGET_PAGE_SIZE;
         encoded_size = xbzrle_counters.bytes - rs->xbzrle_bytes_prev;
-        if (xbzrle_counters.pages == rs->xbzrle_pages_prev) {
+        if (xbzrle_counters.pages == rs->xbzrle_pages_prev || !encoded_size) {
             xbzrle_counters.encoding_rate = 0;
-        } else if (!encoded_size) {
-            xbzrle_counters.encoding_rate = UINT64_MAX;
         } else {
             xbzrle_counters.encoding_rate = unencoded_size / encoded_size;
         }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 3/5] configure: Clean up warning flag lists
  2020-06-17  4:37 [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings Richard Henderson
  2020-06-17  4:37 ` [PATCH v3 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning Richard Henderson
  2020-06-17  4:37 ` [PATCH v3 2/5] migration: fix xbzrle encoding rate calculation Richard Henderson
@ 2020-06-17  4:37 ` Richard Henderson
  2020-06-17  7:11   ` Philippe Mathieu-Daudé
  2020-06-17 10:56   ` Alex Bennée
  2020-06-17  4:37 ` [PATCH v3 4/5] configure: Disable -Wtautological-type-limit-compare Richard Henderson
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 15+ messages in thread
From: Richard Henderson @ 2020-06-17  4:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Use a helper function to tidy the assembly of gcc_flags.
Separate flags that disable warnings from those that enable,
and sort the disable warnings to the end.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 configure | 42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)

diff --git a/configure b/configure
index b01b5e3bed..a8bef95282 100755
--- a/configure
+++ b/configure
@@ -97,6 +97,11 @@ do_cxx() {
     do_compiler "$cxx" "$@"
 }
 
+# Append $2 to the variable named $1, with space separation
+add_to() {
+    eval $1=\${$1:+\"\$$1 \"}\$2
+}
+
 update_cxxflags() {
     # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those
     # options which some versions of GCC's C++ compiler complain about
@@ -2024,16 +2029,33 @@ if ! compile_prog "" "" ; then
     error_exit "You need at least GCC v4.8 or Clang v3.4 (or XCode Clang v5.1)"
 fi
 
-gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
-gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
-gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
-gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
-gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags"
-gcc_flags="-Wno-string-plus-int -Wno-typedef-redefinition $gcc_flags"
-# Note that we do not add -Werror to gcc_flags here, because that would
-# enable it for all configure tests. If a configure test failed due
-# to -Werror this would just silently disable some features,
-# so it's too error prone.
+# Accumulate -Wfoo and -Wno-bar separately.
+# We will list all of the enable flags first, and the disable flags second.
+# Note that we do not add -Werror, because that would enable it for all
+# configure tests. If a configure test failed due to -Werror this would
+# just silently disable some features, so it's too error prone.
+
+warn_flags=
+add_to warn_flags -Wold-style-declaration
+add_to warn_flags -Wold-style-definition
+add_to warn_flags -Wtype-limits
+add_to warn_flags -Wformat-security
+add_to warn_flags -Wformat-y2k
+add_to warn_flags -Winit-self
+add_to warn_flags -Wignored-qualifiers
+add_to warn_flags -Wempty-body
+add_to warn_flags -Wnested-externs
+add_to warn_flags -Wendif-labels
+add_to warn_flags -Wexpansion-to-defined
+
+nowarn_flags=
+add_to nowarn_flags -Wno-initializer-overrides
+add_to nowarn_flags -Wno-missing-include-dirs
+add_to nowarn_flags -Wno-shift-negative-value
+add_to nowarn_flags -Wno-string-plus-int
+add_to nowarn_flags -Wno-typedef-redefinition
+
+gcc_flags="$warn_flags $nowarn_flags"
 
 cc_has_warning_flag() {
     write_c_skeleton;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 4/5] configure: Disable -Wtautological-type-limit-compare
  2020-06-17  4:37 [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings Richard Henderson
                   ` (2 preceding siblings ...)
  2020-06-17  4:37 ` [PATCH v3 3/5] configure: Clean up warning flag lists Richard Henderson
@ 2020-06-17  4:37 ` Richard Henderson
  2020-06-17  4:37 ` [PATCH v3 5/5] configure: Add -Wno-psabi Richard Henderson
  2020-06-17  5:15 ` [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings no-reply
  5 siblings, 0 replies; 15+ messages in thread
From: Richard Henderson @ 2020-06-17  4:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth, alex.bennee, Philippe Mathieu-Daudé

Clang 10 enables this by default with -Wtype-limit.

All of the instances flagged by this Werror so far have been
cases in which we really do want the compiler to optimize away
the test completely.  Disabling the warning will avoid having
to add ifdefs to work around this.

Cc: Eric Blake <eblake@redhat.com>
Fixes: https://bugs.launchpad.net/qemu/+bug/1878628
Acked-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
v2: Use the new add_to function.
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index a8bef95282..5e27229f58 100755
--- a/configure
+++ b/configure
@@ -2054,6 +2054,7 @@ add_to nowarn_flags -Wno-missing-include-dirs
 add_to nowarn_flags -Wno-shift-negative-value
 add_to nowarn_flags -Wno-string-plus-int
 add_to nowarn_flags -Wno-typedef-redefinition
+add_to nowarn_flags -Wno-tautological-type-limit-compare
 
 gcc_flags="$warn_flags $nowarn_flags"
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 5/5] configure: Add -Wno-psabi
  2020-06-17  4:37 [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings Richard Henderson
                   ` (3 preceding siblings ...)
  2020-06-17  4:37 ` [PATCH v3 4/5] configure: Disable -Wtautological-type-limit-compare Richard Henderson
@ 2020-06-17  4:37 ` Richard Henderson
  2020-06-17  6:50   ` Philippe Mathieu-Daudé
  2020-06-17 11:02   ` Alex Bennée
  2020-06-17  5:15 ` [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings no-reply
  5 siblings, 2 replies; 15+ messages in thread
From: Richard Henderson @ 2020-06-17  4:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, alex.bennee

On aarch64, gcc 9.3 is generating

qemu/exec.c: In function ‘address_space_translate_iommu’:
qemu/exec.c:431:28: note: parameter passing for argument of type \
  ‘MemTxAttrs’ {aka ‘struct MemTxAttrs’} changed in GCC 9.1

and many other reptitions.  This structure, and the functions
amongst which it is passed, are not part of a QEMU public API.
Therefore we do not care how the compiler passes the argument,
so long as the compiler is self-consistent.

The only portion of QEMU which does have a public api, and so
must have a stable abi, is "qemu/plugin.h".  We test this by
forcing -Wpsabi in tests/plugin/Makefile.

Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 configure             | 1 +
 tests/plugin/Makefile | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 5e27229f58..ba88fd1824 100755
--- a/configure
+++ b/configure
@@ -2055,6 +2055,7 @@ add_to nowarn_flags -Wno-shift-negative-value
 add_to nowarn_flags -Wno-string-plus-int
 add_to nowarn_flags -Wno-typedef-redefinition
 add_to nowarn_flags -Wno-tautological-type-limit-compare
+add_to nowarn_flags -Wno-psabi
 
 gcc_flags="$warn_flags $nowarn_flags"
 
diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile
index b3250e2504..3a50451428 100644
--- a/tests/plugin/Makefile
+++ b/tests/plugin/Makefile
@@ -17,7 +17,7 @@ NAMES += lockstep
 
 SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
 
-QEMU_CFLAGS += -fPIC
+QEMU_CFLAGS += -fPIC -Wpsabi
 QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu
 
 all: $(SONAMES)
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings
  2020-06-17  4:37 [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings Richard Henderson
                   ` (4 preceding siblings ...)
  2020-06-17  4:37 ` [PATCH v3 5/5] configure: Add -Wno-psabi Richard Henderson
@ 2020-06-17  5:15 ` no-reply
  5 siblings, 0 replies; 15+ messages in thread
From: no-reply @ 2020-06-17  5:15 UTC (permalink / raw)
  To: richard.henderson; +Cc: alex.bennee, qemu-devel

Patchew URL: https://patchew.org/QEMU/20200617043757.1623337-1-richard.henderson@linaro.org/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  GEN     tools/virtiofsd/50-qemu-virtiofsd.json
  CC      contrib/vhost-user-input/main.o
  LINK    tests/qemu-iotests/socket_scm_helper
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  GEN     docs/interop/qemu-qmp-ref.html
  GEN     docs/interop/qemu-qmp-ref.txt
  GEN     docs/interop/qemu-qmp-ref.7
---
  AR      libqemuutil.a
  SIGN    pc-bios/optionrom/kvmvapic.bin
  LINK    elf2dmp
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  CC      qemu-img.o
  AR      libvhost-user.a
  GEN     docs/interop/qemu-ga-ref.html
---
  GEN     docs/interop/qemu-ga-ref.7
  LINK    qemu-keymap
  LINK    ivshmem-client
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    ivshmem-server
  LINK    qemu-nbd
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-storage-daemon
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-io
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-edid
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    fsdev/virtfs-proxy-helper
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    scsi/qemu-pr-helper
  LINK    qemu-bridge-helper
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    virtiofsd
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    vhost-user-input
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-ga
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-img
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  GEN     x86_64-softmmu/hmp-commands-info.h
  GEN     x86_64-softmmu/config-target.h
  GEN     x86_64-softmmu/config-devices.h
---
  CC      x86_64-softmmu/gdbstub-xml.o
  CC      x86_64-softmmu/trace/generated-helpers.o
  LINK    x86_64-softmmu/qemu-system-x86_64
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
common.rc: line 50: test: check: binary operator expected
(printf '#define QEMU_PKGVERSION ""\n'; printf '#define QEMU_FULL_VERSION "5.0.50"\n'; ) > qemu-version.h.tmp
make -C /tmp/qemu-test/src/slirp BUILD_DIR="/tmp/qemu-test/build/slirp" PKG_CONFIG="pkg-config" CC="clang" AR="ar"      LD="ld" RANLIB="ranlib" CFLAGS="-I/usr/include/pixman-1   -Werror -fsanitize=undefined -fsanitize=address  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99  -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong   -I/usr/include/p11-kit-1   -DSTRUCT_IOVEC_DEFINED  -I/usr/include/libpng16  -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pixman-1   -I/tmp/qemu-test/src/tests -I/tmp/qemu-test/src/tests/qtest -g " LDFLAGS="-Wl,--warn-common -fsanitize=undefined -fsanitize=address -Wl,-z,relro -Wl,-z,now -pie -m64  -fstack-protector-strong"
---
clang -iquote /tmp/qemu-test/build/tests -iquote tests -iquote /tmp/qemu-test/src/tcg/i386 -isystem /tmp/qemu-test/src/linux-headers -isystem /tmp/qemu-test/build/linux-headers -iquote . -iquote /tmp/qemu-test/src -iquote /tmp/qemu-test/src/accel/tcg -iquote /tmp/qemu-test/src/include -iquote /tmp/qemu-test/src/disas/libvixl -I/usr/include/pixman-1   -Werror -fsanitize=undefined -fsanitize=address  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99  -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong   -I/usr/include/p11-kit-1   -DSTRUCT_IOVEC_DEFINED  -I/usr/include/libpng16  -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pixman-1   -I/tmp/qemu-test/src/tests -I/tmp/qemu-test/src/tests/qtest -MMD -MP -MT tests/crypto-tls-x509-helpers.o -MF tests/crypto-tls-x509-helpers.d -g   -c -o tests/crypto-tls-x509-helpers.o /tmp/qemu-test/src/tests/crypto-tls-x509-helpers.c
clang -iquote /tmp/qemu-test/build/tests -iquote tests -iquote /tmp/qemu-test/src/tcg/i386 -isystem /tmp/qemu-test/src/linux-headers -isystem /tmp/qemu-test/build/linux-headers -iquote . -iquote /tmp/qemu-test/src -iquote /tmp/qemu-test/src/accel/tcg -iquote /tmp/qemu-test/src/include -iquote /tmp/qemu-test/src/disas/libvixl -I/usr/include/pixman-1   -Werror -fsanitize=undefined -fsanitize=address  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99  -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong   -I/usr/include/p11-kit-1   -DSTRUCT_IOVEC_DEFINED  -I/usr/include/libpng16  -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pixman-1   -I/tmp/qemu-test/src/tests -I/tmp/qemu-test/src/tests/qtest -MMD -MP -MT tests/pkix_asn1_tab.o -MF tests/pkix_asn1_tab.d -g   -c -o tests/pkix_asn1_tab.o /tmp/qemu-test/src/tests/pkix_asn1_tab.c
clang -iquote /tmp/qemu-test/build/tests -iquote tests -iquote /tmp/qemu-test/src/tcg/i386 -isystem /tmp/qemu-test/src/linux-headers -isystem /tmp/qemu-test/build/linux-headers -iquote . -iquote /tmp/qemu-test/src -iquote /tmp/qemu-test/src/accel/tcg -iquote /tmp/qemu-test/src/include -iquote /tmp/qemu-test/src/disas/libvixl -I/usr/include/pixman-1   -Werror -fsanitize=undefined -fsanitize=address  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99  -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong   -I/usr/include/p11-kit-1   -DSTRUCT_IOVEC_DEFINED  -I/usr/include/libpng16  -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pixman-1   -I/tmp/qemu-test/src/tests -I/tmp/qemu-test/src/tests/qtest -MMD -MP -MT tests/test-crypto-tlssession.o -MF tests/test-crypto-tlssession.d -g   -c -o tests/test-crypto-tlssession.o /tmp/qemu-test/src/tests/test-crypto-tlssession.c
/tmp/qemu-test/src/tests/qht-bench.c:287:29: error: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
        *threshold = rate * UINT64_MAX;
                          ~ ^~~~~~~~~~
/usr/include/stdint.h:130:23: note: expanded from macro 'UINT64_MAX'
---
18446744073709551615UL
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [/tmp/qemu-test/src/rules.mak:69: tests/qht-bench.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 669, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=73b66c7ca22247a89bca7a0ee5b06ced', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-mwal_v_k/src/docker-src.2020-06-17-01.10.12.2117:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=73b66c7ca22247a89bca7a0ee5b06ced
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-mwal_v_k/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    5m38.294s
user    0m8.473s


The full log is available at
http://patchew.org/logs/20200617043757.1623337-1-richard.henderson@linaro.org/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 5/5] configure: Add -Wno-psabi
  2020-06-17  4:37 ` [PATCH v3 5/5] configure: Add -Wno-psabi Richard Henderson
@ 2020-06-17  6:50   ` Philippe Mathieu-Daudé
  2020-06-17  7:10     ` Philippe Mathieu-Daudé
  2020-06-17 11:02   ` Alex Bennée
  1 sibling, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-06-17  6:50 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: Peter Maydell, alex.bennee

On 6/17/20 6:37 AM, Richard Henderson wrote:
> On aarch64, gcc 9.3 is generating
> 
> qemu/exec.c: In function ‘address_space_translate_iommu’:
> qemu/exec.c:431:28: note: parameter passing for argument of type \
>   ‘MemTxAttrs’ {aka ‘struct MemTxAttrs’} changed in GCC 9.1
> 
> and many other reptitions.  This structure, and the functions

Typo "repetitions".

> amongst which it is passed, are not part of a QEMU public API.
> Therefore we do not care how the compiler passes the argument,
> so long as the compiler is self-consistent.
> 
> The only portion of QEMU which does have a public api, and so
> must have a stable abi, is "qemu/plugin.h".  We test this by
> forcing -Wpsabi in tests/plugin/Makefile.
> 
> Cc: Alex Bennée <alex.bennee@linaro.org>
> Cc: Peter Maydell <peter.maydell@linaro.org>

Buglink: https://bugs.launchpad.net/qemu/+bug/1881552

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  configure             | 1 +
>  tests/plugin/Makefile | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 5e27229f58..ba88fd1824 100755
> --- a/configure
> +++ b/configure
> @@ -2055,6 +2055,7 @@ add_to nowarn_flags -Wno-shift-negative-value
>  add_to nowarn_flags -Wno-string-plus-int
>  add_to nowarn_flags -Wno-typedef-redefinition
>  add_to nowarn_flags -Wno-tautological-type-limit-compare
> +add_to nowarn_flags -Wno-psabi
>  
>  gcc_flags="$warn_flags $nowarn_flags"
>  
> diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile
> index b3250e2504..3a50451428 100644
> --- a/tests/plugin/Makefile
> +++ b/tests/plugin/Makefile
> @@ -17,7 +17,7 @@ NAMES += lockstep
>  
>  SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
>  
> -QEMU_CFLAGS += -fPIC
> +QEMU_CFLAGS += -fPIC -Wpsabi
>  QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu
>  
>  all: $(SONAMES)
> 



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 5/5] configure: Add -Wno-psabi
  2020-06-17  6:50   ` Philippe Mathieu-Daudé
@ 2020-06-17  7:10     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-06-17  7:10 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: Peter Maydell, alex.bennee

On 6/17/20 8:50 AM, Philippe Mathieu-Daudé wrote:
> On 6/17/20 6:37 AM, Richard Henderson wrote:
>> On aarch64, gcc 9.3 is generating
>>
>> qemu/exec.c: In function ‘address_space_translate_iommu’:
>> qemu/exec.c:431:28: note: parameter passing for argument of type \
>>   ‘MemTxAttrs’ {aka ‘struct MemTxAttrs’} changed in GCC 9.1
>>
>> and many other reptitions.  This structure, and the functions
> 
> Typo "repetitions".
> 
>> amongst which it is passed, are not part of a QEMU public API.
>> Therefore we do not care how the compiler passes the argument,
>> so long as the compiler is self-consistent.
>>
>> The only portion of QEMU which does have a public api, and so
>> must have a stable abi, is "qemu/plugin.h".  We test this by
>> forcing -Wpsabi in tests/plugin/Makefile.
>>
>> Cc: Alex Bennée <alex.bennee@linaro.org>
>> Cc: Peter Maydell <peter.maydell@linaro.org>
> 
> Buglink: https://bugs.launchpad.net/qemu/+bug/1881552
> 
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Err I meant:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> 
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>  configure             | 1 +
>>  tests/plugin/Makefile | 2 +-
>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index 5e27229f58..ba88fd1824 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2055,6 +2055,7 @@ add_to nowarn_flags -Wno-shift-negative-value
>>  add_to nowarn_flags -Wno-string-plus-int
>>  add_to nowarn_flags -Wno-typedef-redefinition
>>  add_to nowarn_flags -Wno-tautological-type-limit-compare
>> +add_to nowarn_flags -Wno-psabi
>>  
>>  gcc_flags="$warn_flags $nowarn_flags"
>>  
>> diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile
>> index b3250e2504..3a50451428 100644
>> --- a/tests/plugin/Makefile
>> +++ b/tests/plugin/Makefile
>> @@ -17,7 +17,7 @@ NAMES += lockstep
>>  
>>  SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
>>  
>> -QEMU_CFLAGS += -fPIC
>> +QEMU_CFLAGS += -fPIC -Wpsabi
>>  QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu
>>  
>>  all: $(SONAMES)
>>
> 



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 3/5] configure: Clean up warning flag lists
  2020-06-17  4:37 ` [PATCH v3 3/5] configure: Clean up warning flag lists Richard Henderson
@ 2020-06-17  7:11   ` Philippe Mathieu-Daudé
  2020-06-17 10:56   ` Alex Bennée
  1 sibling, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-06-17  7:11 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: alex.bennee

On 6/17/20 6:37 AM, Richard Henderson wrote:
> Use a helper function to tidy the assembly of gcc_flags.
> Separate flags that disable warnings from those that enable,
> and sort the disable warnings to the end.
> 
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  configure | 42 ++++++++++++++++++++++++++++++++----------
>  1 file changed, 32 insertions(+), 10 deletions(-)
> 
> diff --git a/configure b/configure
> index b01b5e3bed..a8bef95282 100755
> --- a/configure
> +++ b/configure
> @@ -97,6 +97,11 @@ do_cxx() {
>      do_compiler "$cxx" "$@"
>  }
>  
> +# Append $2 to the variable named $1, with space separation
> +add_to() {
> +    eval $1=\${$1:+\"\$$1 \"}\$2
> +}

Nice trick Eric!

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> +
>  update_cxxflags() {
>      # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those
>      # options which some versions of GCC's C++ compiler complain about
> @@ -2024,16 +2029,33 @@ if ! compile_prog "" "" ; then
>      error_exit "You need at least GCC v4.8 or Clang v3.4 (or XCode Clang v5.1)"
>  fi
>  
> -gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
> -gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
> -gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
> -gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
> -gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags"
> -gcc_flags="-Wno-string-plus-int -Wno-typedef-redefinition $gcc_flags"
> -# Note that we do not add -Werror to gcc_flags here, because that would
> -# enable it for all configure tests. If a configure test failed due
> -# to -Werror this would just silently disable some features,
> -# so it's too error prone.
> +# Accumulate -Wfoo and -Wno-bar separately.
> +# We will list all of the enable flags first, and the disable flags second.
> +# Note that we do not add -Werror, because that would enable it for all
> +# configure tests. If a configure test failed due to -Werror this would
> +# just silently disable some features, so it's too error prone.
> +
> +warn_flags=
> +add_to warn_flags -Wold-style-declaration
> +add_to warn_flags -Wold-style-definition
> +add_to warn_flags -Wtype-limits
> +add_to warn_flags -Wformat-security
> +add_to warn_flags -Wformat-y2k
> +add_to warn_flags -Winit-self
> +add_to warn_flags -Wignored-qualifiers
> +add_to warn_flags -Wempty-body
> +add_to warn_flags -Wnested-externs
> +add_to warn_flags -Wendif-labels
> +add_to warn_flags -Wexpansion-to-defined
> +
> +nowarn_flags=
> +add_to nowarn_flags -Wno-initializer-overrides
> +add_to nowarn_flags -Wno-missing-include-dirs
> +add_to nowarn_flags -Wno-shift-negative-value
> +add_to nowarn_flags -Wno-string-plus-int
> +add_to nowarn_flags -Wno-typedef-redefinition
> +
> +gcc_flags="$warn_flags $nowarn_flags"
>  
>  cc_has_warning_flag() {
>      write_c_skeleton;
> 



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 2/5] migration: fix xbzrle encoding rate calculation
  2020-06-17  4:37 ` [PATCH v3 2/5] migration: fix xbzrle encoding rate calculation Richard Henderson
@ 2020-06-17 10:25   ` Philippe Mathieu-Daudé
  2020-06-17 10:54   ` Alex Bennée
  1 sibling, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-06-17 10:25 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel
  Cc: Wei Wang, cota, alex.bennee, Dr . David Alan Gilbert

On 6/17/20 6:37 AM, Richard Henderson wrote:
> From: Wei Wang <wei.w.wang@intel.com>
> 
> It's reported an error of implicit conversion from "unsigned long" to
> "double" when compiling with Clang 10. Simply make the encoding rate 0
> when the encoded_size is 0.

There is a similar error in tests/qht-bench.c, see the asan log:
https://patchew.org/QEMU/20200617072539.32686-1-f4bug@amsat.org/

/tmp/qemu-test/src/tests/qht-bench.c:287:29: error: implicit conversion
from 'unsigned long' to 'double' changes value from 18446744073709551615
to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
        *threshold = rate * UINT64_MAX;
                          ~ ^~~~~~~~~~
/usr/include/stdint.h:130:23: note: expanded from macro 'UINT64_MAX'
# define UINT64_MAX             (__UINT64_C(18446744073709551615))
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/stdint.h:107:25: note: expanded from macro '__UINT64_C'
#  define __UINT64_C(c) c ## UL
                        ^~~~~~~
<scratch space>:33:1: note: expanded from here
18446744073709551615UL
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [/tmp/qemu-test/src/rules.mak:69: tests/qht-bench.o] Error 1

> 
> Fixes: e460a4b1a4
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Reported-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Wei Wang <wei.w.wang@intel.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  migration/ram.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 41cc530d9d..069b6e30bc 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -913,10 +913,8 @@ static void migration_update_rates(RAMState *rs, int64_t end_time)
>          unencoded_size = (xbzrle_counters.pages - rs->xbzrle_pages_prev) *
>                           TARGET_PAGE_SIZE;
>          encoded_size = xbzrle_counters.bytes - rs->xbzrle_bytes_prev;
> -        if (xbzrle_counters.pages == rs->xbzrle_pages_prev) {
> +        if (xbzrle_counters.pages == rs->xbzrle_pages_prev || !encoded_size) {
>              xbzrle_counters.encoding_rate = 0;
> -        } else if (!encoded_size) {
> -            xbzrle_counters.encoding_rate = UINT64_MAX;
>          } else {
>              xbzrle_counters.encoding_rate = unencoded_size / encoded_size;
>          }
> 



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning
  2020-06-17  4:37 ` [PATCH v3 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning Richard Henderson
@ 2020-06-17 10:37   ` Alex Bennée
  0 siblings, 0 replies; 15+ messages in thread
From: Alex Bennée @ 2020-06-17 10:37 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Thomas Huth, Philippe Mathieu-Daudé, qemu-devel


Richard Henderson <richard.henderson@linaro.org> writes:

> From: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> When building with clang version 10.0.0-4ubuntu1, we get:
>
>     CC      lm32-softmmu/fpu/softfloat.o
>   fpu/softfloat.c:3365:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
>       absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
>               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>   fpu/softfloat.c:3423:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
>           absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven );
>                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>   ...
>
>   fpu/softfloat.c:4273:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
>           zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven );
>                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fix by rewriting the fishy bitwise AND of two bools as an int.
>
> Suggested-by: Eric Blake <eblake@redhat.com>
> Buglink: https://bugs.launchpad.net/bugs/1881004
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Message-Id: <20200528155420.9802-1-philmd@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 2/5] migration: fix xbzrle encoding rate calculation
  2020-06-17  4:37 ` [PATCH v3 2/5] migration: fix xbzrle encoding rate calculation Richard Henderson
  2020-06-17 10:25   ` Philippe Mathieu-Daudé
@ 2020-06-17 10:54   ` Alex Bennée
  1 sibling, 0 replies; 15+ messages in thread
From: Alex Bennée @ 2020-06-17 10:54 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Wei Wang, qemu-devel, Dr . David Alan Gilbert


Richard Henderson <richard.henderson@linaro.org> writes:

> From: Wei Wang <wei.w.wang@intel.com>
>
> It's reported an error of implicit conversion from "unsigned long" to
> "double" when compiling with Clang 10. Simply make the encoding rate 0
> when the encoded_size is 0.
>
> Fixes: e460a4b1a4
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Reported-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Wei Wang <wei.w.wang@intel.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 3/5] configure: Clean up warning flag lists
  2020-06-17  4:37 ` [PATCH v3 3/5] configure: Clean up warning flag lists Richard Henderson
  2020-06-17  7:11   ` Philippe Mathieu-Daudé
@ 2020-06-17 10:56   ` Alex Bennée
  1 sibling, 0 replies; 15+ messages in thread
From: Alex Bennée @ 2020-06-17 10:56 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel


Richard Henderson <richard.henderson@linaro.org> writes:

> Use a helper function to tidy the assembly of gcc_flags.
> Separate flags that disable warnings from those that enable,
> and sort the disable warnings to the end.
>
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 5/5] configure: Add -Wno-psabi
  2020-06-17  4:37 ` [PATCH v3 5/5] configure: Add -Wno-psabi Richard Henderson
  2020-06-17  6:50   ` Philippe Mathieu-Daudé
@ 2020-06-17 11:02   ` Alex Bennée
  1 sibling, 0 replies; 15+ messages in thread
From: Alex Bennée @ 2020-06-17 11:02 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Peter Maydell, qemu-devel


Richard Henderson <richard.henderson@linaro.org> writes:

> On aarch64, gcc 9.3 is generating
>
> qemu/exec.c: In function ‘address_space_translate_iommu’:
> qemu/exec.c:431:28: note: parameter passing for argument of type \
>   ‘MemTxAttrs’ {aka ‘struct MemTxAttrs’} changed in GCC 9.1
>
> and many other reptitions.  This structure, and the functions
> amongst which it is passed, are not part of a QEMU public API.
> Therefore we do not care how the compiler passes the argument,
> so long as the compiler is self-consistent.
>
> The only portion of QEMU which does have a public api, and so
> must have a stable abi, is "qemu/plugin.h".  We test this by
> forcing -Wpsabi in tests/plugin/Makefile.
>
> Cc: Alex Bennée <alex.bennee@linaro.org>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  configure             | 1 +
>  tests/plugin/Makefile | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 5e27229f58..ba88fd1824 100755
> --- a/configure
> +++ b/configure
> @@ -2055,6 +2055,7 @@ add_to nowarn_flags -Wno-shift-negative-value
>  add_to nowarn_flags -Wno-string-plus-int
>  add_to nowarn_flags -Wno-typedef-redefinition
>  add_to nowarn_flags -Wno-tautological-type-limit-compare
> +add_to nowarn_flags -Wno-psabi
>  
>  gcc_flags="$warn_flags $nowarn_flags"
>  
> diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile
> index b3250e2504..3a50451428 100644
> --- a/tests/plugin/Makefile
> +++ b/tests/plugin/Makefile
> @@ -17,7 +17,7 @@ NAMES += lockstep
>  
>  SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
>  
> -QEMU_CFLAGS += -fPIC
> +QEMU_CFLAGS += -fPIC -Wpsabi
>  QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu
>

It's a shame api.c includes enough headers to get tripped up but
hopefully this will catch enough of the breakage if/when it comes.

Anyway:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-06-17 11:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17  4:37 [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings Richard Henderson
2020-06-17  4:37 ` [PATCH v3 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning Richard Henderson
2020-06-17 10:37   ` Alex Bennée
2020-06-17  4:37 ` [PATCH v3 2/5] migration: fix xbzrle encoding rate calculation Richard Henderson
2020-06-17 10:25   ` Philippe Mathieu-Daudé
2020-06-17 10:54   ` Alex Bennée
2020-06-17  4:37 ` [PATCH v3 3/5] configure: Clean up warning flag lists Richard Henderson
2020-06-17  7:11   ` Philippe Mathieu-Daudé
2020-06-17 10:56   ` Alex Bennée
2020-06-17  4:37 ` [PATCH v3 4/5] configure: Disable -Wtautological-type-limit-compare Richard Henderson
2020-06-17  4:37 ` [PATCH v3 5/5] configure: Add -Wno-psabi Richard Henderson
2020-06-17  6:50   ` Philippe Mathieu-Daudé
2020-06-17  7:10     ` Philippe Mathieu-Daudé
2020-06-17 11:02   ` Alex Bennée
2020-06-17  5:15 ` [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings no-reply

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).