diff mbox series

[v3,5/5] configure: Add -Wno-psabi

Message ID 20200617043757.1623337-6-richard.henderson@linaro.org
State Superseded
Headers show
Series Vs clang-10 and gcc-9 warnings | expand

Commit Message

Richard Henderson June 17, 2020, 4:37 a.m. UTC
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(-)

-- 
2.25.1

Comments

Philippe Mathieu-Daudé June 17, 2020, 6:50 a.m. UTC | #1
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)

>
Philippe Mathieu-Daudé June 17, 2020, 7:10 a.m. UTC | #2
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)

>>

>
Alex Bennée June 17, 2020, 11:02 a.m. UTC | #3
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
diff mbox series

Patch

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)