config/ppc: fix build with GCC >= 10

Message ID 20210915050812.12798-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series config/ppc: fix build with GCC >= 10 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-spell-check-testing warning Testing issues
ci/github-robot: build success github build: passed
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing fail Testing issues
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

David Marchand Sept. 15, 2021, 5:08 a.m. UTC
  Like for python, multiline statements in meson must either use a
backslash character (explicit continuation) or be enclosed in ()
(implicit continuation).

python PEP8 recommends the latter [1], and it looks like meson had
an issue with backslash before 0.50 [2].

1: https://www.python.org/dev/peps/pep-0008/#multiline-if-statements
2: https://github.com/mesonbuild/meson/commit/90c9b868b20b

Fixes: 394407f50c90 ("config/ppc: ignore GCC 11 psabi warnings")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 config/ppc/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit Sept. 15, 2021, 8:14 a.m. UTC | #1
On 9/15/2021 6:08 AM, David Marchand wrote:
> Like for python, multiline statements in meson must either use a
> backslash character (explicit continuation) or be enclosed in ()
> (implicit continuation).
> 
> python PEP8 recommends the latter [1], and it looks like meson had
> an issue with backslash before 0.50 [2].
> 
> 1: https://www.python.org/dev/peps/pep-0008/#multiline-if-statements
> 2: https://github.com/mesonbuild/meson/commit/90c9b868b20b
> 
> Fixes: 394407f50c90 ("config/ppc: ignore GCC 11 psabi warnings")
> 
> Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  config/ppc/meson.build | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/config/ppc/meson.build b/config/ppc/meson.build
> index 0b1948fc7c..aa1327a595 100644
> --- a/config/ppc/meson.build
> +++ b/config/ppc/meson.build
> @@ -20,8 +20,8 @@ endif
>  
>  # Suppress the gcc warning "note: the layout of aggregates containing
>  # vectors with 4-byte alignment has changed in GCC 5".
> -if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') and
> -        cc.version().version_compare('<12.0') and cc.has_argument('-Wno-psabi')
> +if (cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') and
> +        cc.version().version_compare('<12.0') and cc.has_argument('-Wno-psabi'))
>      add_project_arguments('-Wno-psabi', language: 'c')
>  endif
>  
> 

Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Bruce Richardson Sept. 15, 2021, 9:08 a.m. UTC | #2
On Wed, Sep 15, 2021 at 09:14:34AM +0100, Ferruh Yigit wrote:
> On 9/15/2021 6:08 AM, David Marchand wrote:
> > Like for python, multiline statements in meson must either use a
> > backslash character (explicit continuation) or be enclosed in ()
> > (implicit continuation).
> > 
> > python PEP8 recommends the latter [1], and it looks like meson had
> > an issue with backslash before 0.50 [2].
> > 
> > 1: https://www.python.org/dev/peps/pep-0008/#multiline-if-statements
> > 2: https://github.com/mesonbuild/meson/commit/90c9b868b20b
> > 
> > Fixes: 394407f50c90 ("config/ppc: ignore GCC 11 psabi warnings")
> > 
> > Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> >  config/ppc/meson.build | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/config/ppc/meson.build b/config/ppc/meson.build
> > index 0b1948fc7c..aa1327a595 100644
> > --- a/config/ppc/meson.build
> > +++ b/config/ppc/meson.build
> > @@ -20,8 +20,8 @@ endif
> >  
> >  # Suppress the gcc warning "note: the layout of aggregates containing
> >  # vectors with 4-byte alignment has changed in GCC 5".
> > -if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') and
> > -        cc.version().version_compare('<12.0') and cc.has_argument('-Wno-psabi')
> > +if (cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') and
> > +        cc.version().version_compare('<12.0') and cc.has_argument('-Wno-psabi'))
> >      add_project_arguments('-Wno-psabi', language: 'c')
> >  endif
> >  
> > 
> 
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
David Marchand Sept. 15, 2021, 3:10 p.m. UTC | #3
On Wed, Sep 15, 2021 at 11:08 AM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> On Wed, Sep 15, 2021 at 09:14:34AM +0100, Ferruh Yigit wrote:
> > On 9/15/2021 6:08 AM, David Marchand wrote:
> > > Like for python, multiline statements in meson must either use a
> > > backslash character (explicit continuation) or be enclosed in ()
> > > (implicit continuation).
> > >
> > > python PEP8 recommends the latter [1], and it looks like meson had
> > > an issue with backslash before 0.50 [2].
> > >
> > > 1: https://www.python.org/dev/peps/pep-0008/#multiline-if-statements
> > > 2: https://github.com/mesonbuild/meson/commit/90c9b868b20b
> > >
> > > Fixes: 394407f50c90 ("config/ppc: ignore GCC 11 psabi warnings")
> > >
> > > Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.
  

Patch

diff --git a/config/ppc/meson.build b/config/ppc/meson.build
index 0b1948fc7c..aa1327a595 100644
--- a/config/ppc/meson.build
+++ b/config/ppc/meson.build
@@ -20,8 +20,8 @@  endif
 
 # Suppress the gcc warning "note: the layout of aggregates containing
 # vectors with 4-byte alignment has changed in GCC 5".
-if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') and
-        cc.version().version_compare('<12.0') and cc.has_argument('-Wno-psabi')
+if (cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') and
+        cc.version().version_compare('<12.0') and cc.has_argument('-Wno-psabi'))
     add_project_arguments('-Wno-psabi', language: 'c')
 endif