DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] config/arm: update aarch32 build with gcc13
@ 2023-09-21  9:59 Juraj Linkeš
  2023-10-09  9:53 ` [PATCH v2] " Juraj Linkeš
  0 siblings, 1 reply; 9+ messages in thread
From: Juraj Linkeš @ 2023-09-21  9:59 UTC (permalink / raw)
  To: thomas, Honnappa.Nagarahalli, bruce.richardson, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

The aarch32 with gcc13 fails with:

Compiler for C supports arguments -march=armv8-a: NO

../config/arm/meson.build:714:12: ERROR: Problem encountered: No
suitable armv8 march version found.

This is because we test -march=armv8-a without the -mpfu option, which
is required for aarch32 build with gcc13.

On top of that, the most recent recommendation from the compiler team to
build with -march=armv8-a+simd -mfpu=auto.

We can address this by first testing compiler options and only test the
march after that (coupled with supported options). This doesn't fully
work though, as just -march=armv8 in not enough to be accepted with
-mfpu=auto. To address this other issue, add the force_march parameter
to part number config which will force the configured march to be used,
even if the compiler doesn't support the particular combination of march
and other compiler options, such as mfpu. This then allows the check to
proceed to the -march=armv8-a+simd -mfpu=auto, which is valid.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 3f22d8a2fc..0b42d74876 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -43,7 +43,9 @@ implementer_generic = {
         },
         'generic_aarch32': {
             'march': 'armv8-a',
-            'compiler_options': ['-mfpu=neon'],
+            'force_march': true,
+            'march_features': ['simd'],
+            'compiler_options': ['-mfpu=auto'],
             'flags': [
                 ['RTE_ARCH_ARM_NEON_MEMCPY', false],
                 ['RTE_ARCH_STRICT_ALIGN', true],
@@ -692,6 +694,19 @@ if update_flags
 
     machine_args = [] # Clear previous machine args
 
+    # test supported compiler options
+    compiler_options = []
+    if part_number_config.has_key('compiler_options')
+        foreach flag: part_number_config['compiler_options']
+            if cc.has_argument(flag)
+                compiler_options += flag
+            else
+                warning('Configuration compiler option ' +
+                        '@0@ isn\'t supported.'.format(flag))
+            endif
+        endforeach
+    endif
+
     # probe supported archs and their features
     candidate_march = ''
     if part_number_config.has_key('march')
@@ -704,14 +719,18 @@ if update_flags
                 check_compiler_support = true
             endif
             if (check_compiler_support and
-                cc.has_argument('-march=' + supported_march))
+                cc.has_multi_arguments('-march=' + supported_march, compiler_options))
                 candidate_march = supported_march
                 # highest supported march version found
                 break
             endif
         endforeach
         if candidate_march == ''
-            error('No suitable armv8 march version found.')
+            if part_number_config.get('force_march', false)
+                candidate_march = part_number_config['march']
+            else
+                error('No suitable armv8 march version found.')
+            endif
         endif
         if candidate_march != part_number_config['march']
             warning('Configuration march version is ' +
@@ -728,27 +747,16 @@ if update_flags
             march_features += soc_config['extra_march_features']
         endif
         foreach feature: march_features
-            if cc.has_argument('+'.join([candidate_march, feature]))
+            if cc.has_multi_arguments('+'.join([candidate_march, feature]), compiler_options)
                 candidate_march = '+'.join([candidate_march, feature])
             else
                 warning('The compiler does not support feature @0@'
                     .format(feature))
             endif
         endforeach
-        machine_args += candidate_march
     endif
 
-    # apply supported compiler options
-    if part_number_config.has_key('compiler_options')
-        foreach flag: part_number_config['compiler_options']
-            if cc.has_argument(flag)
-                machine_args += flag
-            else
-                warning('Configuration compiler option ' +
-                        '@0@ isn\'t supported.'.format(flag))
-            endif
-        endforeach
-    endif
+    machine_args += [candidate_march] + compiler_options
 
     # apply flags
     foreach flag: dpdk_flags
-- 
2.34.1


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

* [PATCH v2] config/arm: update aarch32 build with gcc13
  2023-09-21  9:59 [PATCH v1] config/arm: update aarch32 build with gcc13 Juraj Linkeš
@ 2023-10-09  9:53 ` Juraj Linkeš
  2023-10-10  2:55   ` Ruifeng Wang
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Juraj Linkeš @ 2023-10-09  9:53 UTC (permalink / raw)
  To: thomas, Honnappa.Nagarahalli, bruce.richardson, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

The aarch32 with gcc13 fails with:

Compiler for C supports arguments -march=armv8-a: NO

../config/arm/meson.build:714:12: ERROR: Problem encountered: No
suitable armv8 march version found.

This is because we test -march=armv8-a alone (without the -mpfu option),
which is no longer supported in gcc13 aarch32 builds.

The most recent recommendation from the compiler team is to build with
-march=armv8-a+simd -mfpu=auto, which should work for compilers old and
new. The suggestion is to first check -march=armv8-a+simd and only then
check -mfpu=auto.

To address this, add a way to force the architecture (the value of
the -march option).

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 3f22d8a2fc..5303d0e969 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -43,7 +43,9 @@ implementer_generic = {
         },
         'generic_aarch32': {
             'march': 'armv8-a',
-            'compiler_options': ['-mfpu=neon'],
+            'force_march': true,
+            'march_features': ['simd'],
+            'compiler_options': ['-mfpu=auto'],
             'flags': [
                 ['RTE_ARCH_ARM_NEON_MEMCPY', false],
                 ['RTE_ARCH_STRICT_ALIGN', true],
@@ -711,7 +713,11 @@ if update_flags
             endif
         endforeach
         if candidate_march == ''
-            error('No suitable armv8 march version found.')
+            if part_number_config.get('force_march', false)
+                candidate_march = part_number_config['march']
+            else
+                error('No suitable armv8 march version found.')
+            endif
         endif
         if candidate_march != part_number_config['march']
             warning('Configuration march version is ' +
@@ -741,7 +747,7 @@ if update_flags
     # apply supported compiler options
     if part_number_config.has_key('compiler_options')
         foreach flag: part_number_config['compiler_options']
-            if cc.has_argument(flag)
+            if cc.has_multi_arguments(machine_args + [flag])
                 machine_args += flag
             else
                 warning('Configuration compiler option ' +
-- 
2.34.1


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

* RE: [PATCH v2] config/arm: update aarch32 build with gcc13
  2023-10-09  9:53 ` [PATCH v2] " Juraj Linkeš
@ 2023-10-10  2:55   ` Ruifeng Wang
  2023-10-12 12:40   ` Paul Szczepanek
  2023-10-25 12:57   ` [PATCH v3] " Juraj Linkeš
  2 siblings, 0 replies; 9+ messages in thread
From: Ruifeng Wang @ 2023-10-10  2:55 UTC (permalink / raw)
  To: Juraj Linkeš, thomas, Honnappa Nagarahalli, bruce.richardson; +Cc: dev, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Monday, October 9, 2023 5:53 PM
> To: thomas@monjalon.net; Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v2] config/arm: update aarch32 build with gcc13
> 
> The aarch32 with gcc13 fails with:
> 
> Compiler for C supports arguments -march=armv8-a: NO
> 
> ../config/arm/meson.build:714:12: ERROR: Problem encountered: No suitable armv8 march
> version found.
> 
> This is because we test -march=armv8-a alone (without the -mpfu option), which is no
> longer supported in gcc13 aarch32 builds.
> 
> The most recent recommendation from the compiler team is to build with -march=armv8-a+simd
> -mfpu=auto, which should work for compilers old and new. The suggestion is to first check
> -march=armv8-a+simd and only then check -mfpu=auto.
> 
> To address this, add a way to force the architecture (the value of the -march option).
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index 3f22d8a2fc..5303d0e969
> 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -43,7 +43,9 @@ implementer_generic = {
>          },
>          'generic_aarch32': {
>              'march': 'armv8-a',
> -            'compiler_options': ['-mfpu=neon'],
> +            'force_march': true,
> +            'march_features': ['simd'],
> +            'compiler_options': ['-mfpu=auto'],
>              'flags': [
>                  ['RTE_ARCH_ARM_NEON_MEMCPY', false],
>                  ['RTE_ARCH_STRICT_ALIGN', true], @@ -711,7 +713,11 @@ if update_flags
>              endif
>          endforeach
>          if candidate_march == ''
> -            error('No suitable armv8 march version found.')
> +            if part_number_config.get('force_march', false)
> +                candidate_march = part_number_config['march']
> +            else
> +                error('No suitable armv8 march version found.')
> +            endif
>          endif
>          if candidate_march != part_number_config['march']
>              warning('Configuration march version is ' + @@ -741,7 +747,7 @@ if
> update_flags
>      # apply supported compiler options
>      if part_number_config.has_key('compiler_options')
>          foreach flag: part_number_config['compiler_options']
> -            if cc.has_argument(flag)
> +            if cc.has_multi_arguments(machine_args + [flag])
>                  machine_args += flag
>              else
>                  warning('Configuration compiler option ' +
> --
> 2.34.1

Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>


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

* Re: [PATCH v2] config/arm: update aarch32 build with gcc13
  2023-10-09  9:53 ` [PATCH v2] " Juraj Linkeš
  2023-10-10  2:55   ` Ruifeng Wang
@ 2023-10-12 12:40   ` Paul Szczepanek
  2023-10-13  7:35     ` Juraj Linkeš
  2023-10-25 12:57   ` [PATCH v3] " Juraj Linkeš
  2 siblings, 1 reply; 9+ messages in thread
From: Paul Szczepanek @ 2023-10-12 12:40 UTC (permalink / raw)
  To: Juraj Linkeš,
	thomas, Honnappa.Nagarahalli, bruce.richardson, Ruifeng.Wang
  Cc: nd, dev


On 09/10/2023 10:53, Juraj Linkeš wrote:
> The aarch32 with gcc13 fails with:
>
> Compiler for C supports arguments -march=armv8-a: NO
>
> ../config/arm/meson.build:714:12: ERROR: Problem encountered: No
> suitable armv8 march version found.
>
> This is because we test -march=armv8-a alone (without the -mpfu option),
> which is no longer supported in gcc13 aarch32 builds.
>
> The most recent recommendation from the compiler team is to build with
> -march=armv8-a+simd -mfpu=auto, which should work for compilers old and
> new. The suggestion is to first check -march=armv8-a+simd and only then
> check -mfpu=auto.
>
> To address this, add a way to force the architecture (the value of
> the -march option).
>
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
>   config/arm/meson.build | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index 3f22d8a2fc..5303d0e969 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -43,7 +43,9 @@ implementer_generic = {
>           },
>           'generic_aarch32': {
>               'march': 'armv8-a',
> -            'compiler_options': ['-mfpu=neon'],
> +            'force_march': true,
> +            'march_features': ['simd'],
> +            'compiler_options': ['-mfpu=auto'],
>               'flags': [
>                   ['RTE_ARCH_ARM_NEON_MEMCPY', false],
>                   ['RTE_ARCH_STRICT_ALIGN', true],
> @@ -711,7 +713,11 @@ if update_flags
>               endif
>           endforeach
>           if candidate_march == ''
> -            error('No suitable armv8 march version found.')
> +            if part_number_config.get('force_march', false)
> +                candidate_march = part_number_config['march']
> +            else
> +                error('No suitable armv8 march version found.')
> +            endif
This section is only used when no candidate is found, this would make it 
not really be a forced arch but more a fallback arch. If we want the 
user to be able to really force the march string we'd need to put the 
"is forced?" check higher. Am I reading the code right?
>           endif
>           if candidate_march != part_number_config['march']
>               warning('Configuration march version is ' +
> @@ -741,7 +747,7 @@ if update_flags
>       # apply supported compiler options
>       if part_number_config.has_key('compiler_options')
>           foreach flag: part_number_config['compiler_options']
> -            if cc.has_argument(flag)
> +            if cc.has_multi_arguments(machine_args + [flag])
>                   machine_args += flag
>               else
>                   warning('Configuration compiler option ' +

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

* Re: [PATCH v2] config/arm: update aarch32 build with gcc13
  2023-10-12 12:40   ` Paul Szczepanek
@ 2023-10-13  7:35     ` Juraj Linkeš
  0 siblings, 0 replies; 9+ messages in thread
From: Juraj Linkeš @ 2023-10-13  7:35 UTC (permalink / raw)
  To: Paul Szczepanek
  Cc: thomas, Honnappa.Nagarahalli, bruce.richardson, Ruifeng.Wang, nd, dev

On Thu, Oct 12, 2023 at 2:40 PM Paul Szczepanek <paul.szczepanek@arm.com> wrote:
>
>
> On 09/10/2023 10:53, Juraj Linkeš wrote:
> > The aarch32 with gcc13 fails with:
> >
> > Compiler for C supports arguments -march=armv8-a: NO
> >
> > ../config/arm/meson.build:714:12: ERROR: Problem encountered: No
> > suitable armv8 march version found.
> >
> > This is because we test -march=armv8-a alone (without the -mpfu option),
> > which is no longer supported in gcc13 aarch32 builds.
> >
> > The most recent recommendation from the compiler team is to build with
> > -march=armv8-a+simd -mfpu=auto, which should work for compilers old and
> > new. The suggestion is to first check -march=armv8-a+simd and only then
> > check -mfpu=auto.
> >
> > To address this, add a way to force the architecture (the value of
> > the -march option).
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > ---
> >   config/arm/meson.build | 12 +++++++++---
> >   1 file changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > index 3f22d8a2fc..5303d0e969 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -43,7 +43,9 @@ implementer_generic = {
> >           },
> >           'generic_aarch32': {
> >               'march': 'armv8-a',
> > -            'compiler_options': ['-mfpu=neon'],
> > +            'force_march': true,
> > +            'march_features': ['simd'],
> > +            'compiler_options': ['-mfpu=auto'],
> >               'flags': [
> >                   ['RTE_ARCH_ARM_NEON_MEMCPY', false],
> >                   ['RTE_ARCH_STRICT_ALIGN', true],
> > @@ -711,7 +713,11 @@ if update_flags
> >               endif
> >           endforeach
> >           if candidate_march == ''
> > -            error('No suitable armv8 march version found.')
> > +            if part_number_config.get('force_march', false)
> > +                candidate_march = part_number_config['march']
> > +            else
> > +                error('No suitable armv8 march version found.')
> > +            endif
> This section is only used when no candidate is found, this would make it
> not really be a forced arch but more a fallback arch. If we want the
> user to be able to really force the march string we'd need to put the
> "is forced?" check higher. Am I reading the code right?

Yes, you are right. The name should be a bit different to really reflect this.

The question now is what logic do we want. Either this "fallback after
fallback" when the regular fallback doesn't work OR a real forced
march where the regular fallback won't be used at all.

> >           endif
> >           if candidate_march != part_number_config['march']
> >               warning('Configuration march version is ' +
> > @@ -741,7 +747,7 @@ if update_flags
> >       # apply supported compiler options
> >       if part_number_config.has_key('compiler_options')
> >           foreach flag: part_number_config['compiler_options']
> > -            if cc.has_argument(flag)
> > +            if cc.has_multi_arguments(machine_args + [flag])
> >                   machine_args += flag
> >               else
> >                   warning('Configuration compiler option ' +

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

* [PATCH v3] config/arm: update aarch32 build with gcc13
  2023-10-09  9:53 ` [PATCH v2] " Juraj Linkeš
  2023-10-10  2:55   ` Ruifeng Wang
  2023-10-12 12:40   ` Paul Szczepanek
@ 2023-10-25 12:57   ` Juraj Linkeš
  2023-10-26  7:04     ` Ruifeng Wang
  2023-11-01 12:57     ` Paul Szczepanek
  2 siblings, 2 replies; 9+ messages in thread
From: Juraj Linkeš @ 2023-10-25 12:57 UTC (permalink / raw)
  To: thomas, Honnappa.Nagarahalli, bruce.richardson, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

The aarch32 with gcc13 fails with:

Compiler for C supports arguments -march=armv8-a: NO

../config/arm/meson.build:714:12: ERROR: Problem encountered: No
suitable armv8 march version found.

This is because we test -march=armv8-a alone (without the -mpfu option),
which is no longer supported in gcc13 aarch32 builds.

The most recent recommendation from the compiler team is to build with
-march=armv8-a+simd -mfpu=auto, which should work for compilers old and
new. The suggestion is to first check -march=armv8-a+simd and only then
check -mfpu=auto.

To address this, add a way to force the architecture (the value of
the -march option).

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 40 +++++++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 3f22d8a2fc..c3f763764a 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -43,7 +43,9 @@ implementer_generic = {
         },
         'generic_aarch32': {
             'march': 'armv8-a',
-            'compiler_options': ['-mfpu=neon'],
+            'force_march': true,
+            'march_features': ['simd'],
+            'compiler_options': ['-mfpu=auto'],
             'flags': [
                 ['RTE_ARCH_ARM_NEON_MEMCPY', false],
                 ['RTE_ARCH_STRICT_ALIGN', true],
@@ -695,21 +697,25 @@ if update_flags
     # probe supported archs and their features
     candidate_march = ''
     if part_number_config.has_key('march')
-        supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-a',
-                            'armv8.2-a', 'armv8.1-a', 'armv8-a']
-        check_compiler_support = false
-        foreach supported_march: supported_marchs
-            if supported_march == part_number_config['march']
-                # start checking from this version downwards
-                check_compiler_support = true
-            endif
-            if (check_compiler_support and
-                cc.has_argument('-march=' + supported_march))
-                candidate_march = supported_march
-                # highest supported march version found
-                break
-            endif
-        endforeach
+        if part_number_config.get('force_march', false)
+            candidate_march = part_number_config['march']
+        else
+            supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-a',
+                                'armv8.2-a', 'armv8.1-a', 'armv8-a']
+            check_compiler_support = false
+            foreach supported_march: supported_marchs
+                if supported_march == part_number_config['march']
+                    # start checking from this version downwards
+                    check_compiler_support = true
+                endif
+                if (check_compiler_support and
+                    cc.has_argument('-march=' + supported_march))
+                    candidate_march = supported_march
+                    # highest supported march version found
+                    break
+                endif
+            endforeach
+        endif
         if candidate_march == ''
             error('No suitable armv8 march version found.')
         endif
@@ -741,7 +747,7 @@ if update_flags
     # apply supported compiler options
     if part_number_config.has_key('compiler_options')
         foreach flag: part_number_config['compiler_options']
-            if cc.has_argument(flag)
+            if cc.has_multi_arguments(machine_args + [flag])
                 machine_args += flag
             else
                 warning('Configuration compiler option ' +
-- 
2.34.1


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

* RE: [PATCH v3] config/arm: update aarch32 build with gcc13
  2023-10-25 12:57   ` [PATCH v3] " Juraj Linkeš
@ 2023-10-26  7:04     ` Ruifeng Wang
  2023-11-01 12:57     ` Paul Szczepanek
  1 sibling, 0 replies; 9+ messages in thread
From: Ruifeng Wang @ 2023-10-26  7:04 UTC (permalink / raw)
  To: Juraj Linkeš, thomas, Honnappa Nagarahalli, bruce.richardson; +Cc: dev, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, October 25, 2023 8:57 PM
> To: thomas@monjalon.net; Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v3] config/arm: update aarch32 build with gcc13
> 
> The aarch32 with gcc13 fails with:
> 
> Compiler for C supports arguments -march=armv8-a: NO
> 
> ../config/arm/meson.build:714:12: ERROR: Problem encountered: No suitable armv8 march
> version found.
> 
> This is because we test -march=armv8-a alone (without the -mpfu option), which is no
> longer supported in gcc13 aarch32 builds.
> 
> The most recent recommendation from the compiler team is to build with -march=armv8-a+simd
> -mfpu=auto, which should work for compilers old and new. The suggestion is to first check
> -march=armv8-a+simd and only then check -mfpu=auto.
> 
> To address this, add a way to force the architecture (the value of the -march option).
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build | 40 +++++++++++++++++++++++-----------------
>  1 file changed, 23 insertions(+), 17 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index 3f22d8a2fc..c3f763764a
> 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -43,7 +43,9 @@ implementer_generic = {
>          },
>          'generic_aarch32': {
>              'march': 'armv8-a',
> -            'compiler_options': ['-mfpu=neon'],
> +            'force_march': true,
> +            'march_features': ['simd'],
> +            'compiler_options': ['-mfpu=auto'],
>              'flags': [
>                  ['RTE_ARCH_ARM_NEON_MEMCPY', false],
>                  ['RTE_ARCH_STRICT_ALIGN', true], @@ -695,21 +697,25 @@ if update_flags
>      # probe supported archs and their features
>      candidate_march = ''
>      if part_number_config.has_key('march')
> -        supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-a',
> -                            'armv8.2-a', 'armv8.1-a', 'armv8-a']
> -        check_compiler_support = false
> -        foreach supported_march: supported_marchs
> -            if supported_march == part_number_config['march']
> -                # start checking from this version downwards
> -                check_compiler_support = true
> -            endif
> -            if (check_compiler_support and
> -                cc.has_argument('-march=' + supported_march))
> -                candidate_march = supported_march
> -                # highest supported march version found
> -                break
> -            endif
> -        endforeach
> +        if part_number_config.get('force_march', false)
> +            candidate_march = part_number_config['march']
> +        else
> +            supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-a',
> +                                'armv8.2-a', 'armv8.1-a', 'armv8-a']
> +            check_compiler_support = false
> +            foreach supported_march: supported_marchs
> +                if supported_march == part_number_config['march']
> +                    # start checking from this version downwards
> +                    check_compiler_support = true
> +                endif
> +                if (check_compiler_support and
> +                    cc.has_argument('-march=' + supported_march))
> +                    candidate_march = supported_march
> +                    # highest supported march version found
> +                    break
> +                endif
> +            endforeach
> +        endif
>          if candidate_march == ''
>              error('No suitable armv8 march version found.')
>          endif
> @@ -741,7 +747,7 @@ if update_flags
>      # apply supported compiler options
>      if part_number_config.has_key('compiler_options')
>          foreach flag: part_number_config['compiler_options']
> -            if cc.has_argument(flag)
> +            if cc.has_multi_arguments(machine_args + [flag])
>                  machine_args += flag
>              else
>                  warning('Configuration compiler option ' +
> --
> 2.34.1

Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>


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

* Re: [PATCH v3] config/arm: update aarch32 build with gcc13
  2023-10-25 12:57   ` [PATCH v3] " Juraj Linkeš
  2023-10-26  7:04     ` Ruifeng Wang
@ 2023-11-01 12:57     ` Paul Szczepanek
  2023-11-06 14:22       ` Thomas Monjalon
  1 sibling, 1 reply; 9+ messages in thread
From: Paul Szczepanek @ 2023-11-01 12:57 UTC (permalink / raw)
  To: Juraj Linkeš,
	thomas, Honnappa.Nagarahalli, bruce.richardson, Ruifeng.Wang
  Cc: nd, dev


On 25/10/2023 13:57, Juraj Linkeš wrote:
> The aarch32 with gcc13 fails with:
>
> Compiler for C supports arguments -march=armv8-a: NO
>
> ../config/arm/meson.build:714:12: ERROR: Problem encountered: No
> suitable armv8 march version found.
>
> This is because we test -march=armv8-a alone (without the -mpfu option),
> which is no longer supported in gcc13 aarch32 builds.
>
> The most recent recommendation from the compiler team is to build with
> -march=armv8-a+simd -mfpu=auto, which should work for compilers old and
> new. The suggestion is to first check -march=armv8-a+simd and only then
> check -mfpu=auto.
>
> To address this, add a way to force the architecture (the value of
> the -march option).
>
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>   config/arm/meson.build | 40 +++++++++++++++++++++++-----------------
>   1 file changed, 23 insertions(+), 17 deletions(-)
>
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index 3f22d8a2fc..c3f763764a 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -43,7 +43,9 @@ implementer_generic = {
>           },
>           'generic_aarch32': {
>               'march': 'armv8-a',
> -            'compiler_options': ['-mfpu=neon'],
> +            'force_march': true,
> +            'march_features': ['simd'],
> +            'compiler_options': ['-mfpu=auto'],
>               'flags': [
>                   ['RTE_ARCH_ARM_NEON_MEMCPY', false],
>                   ['RTE_ARCH_STRICT_ALIGN', true],
> @@ -695,21 +697,25 @@ if update_flags
>       # probe supported archs and their features
>       candidate_march = ''
>       if part_number_config.has_key('march')
> -        supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-a',
> -                            'armv8.2-a', 'armv8.1-a', 'armv8-a']
> -        check_compiler_support = false
> -        foreach supported_march: supported_marchs
> -            if supported_march == part_number_config['march']
> -                # start checking from this version downwards
> -                check_compiler_support = true
> -            endif
> -            if (check_compiler_support and
> -                cc.has_argument('-march=' + supported_march))
> -                candidate_march = supported_march
> -                # highest supported march version found
> -                break
> -            endif
> -        endforeach
> +        if part_number_config.get('force_march', false)
> +            candidate_march = part_number_config['march']
> +        else
> +            supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-a',
> +                                'armv8.2-a', 'armv8.1-a', 'armv8-a']
> +            check_compiler_support = false
> +            foreach supported_march: supported_marchs
> +                if supported_march == part_number_config['march']
> +                    # start checking from this version downwards
> +                    check_compiler_support = true
> +                endif
> +                if (check_compiler_support and
> +                    cc.has_argument('-march=' + supported_march))
> +                    candidate_march = supported_march
> +                    # highest supported march version found
> +                    break
> +                endif
> +            endforeach
> +        endif
>           if candidate_march == ''
>               error('No suitable armv8 march version found.')
>           endif
> @@ -741,7 +747,7 @@ if update_flags
>       # apply supported compiler options
>       if part_number_config.has_key('compiler_options')
>           foreach flag: part_number_config['compiler_options']
> -            if cc.has_argument(flag)
> +            if cc.has_multi_arguments(machine_args + [flag])
>                   machine_args += flag
>               else
>                   warning('Configuration compiler option ' +


Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>


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

* Re: [PATCH v3] config/arm: update aarch32 build with gcc13
  2023-11-01 12:57     ` Paul Szczepanek
@ 2023-11-06 14:22       ` Thomas Monjalon
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2023-11-06 14:22 UTC (permalink / raw)
  To: Juraj Linkeš, Honnappa.Nagarahalli, Ruifeng.Wang, Paul Szczepanek
  Cc: bruce.richardson, dev, nd, stable

01/11/2023 13:57, Paul Szczepanek:
> 
> On 25/10/2023 13:57, Juraj Linkeš wrote:
> > The aarch32 with gcc13 fails with:
> >
> > Compiler for C supports arguments -march=armv8-a: NO
> >
> > ../config/arm/meson.build:714:12: ERROR: Problem encountered: No
> > suitable armv8 march version found.
> >
> > This is because we test -march=armv8-a alone (without the -mpfu option),
> > which is no longer supported in gcc13 aarch32 builds.
> >
> > The most recent recommendation from the compiler team is to build with
> > -march=armv8-a+simd -mfpu=auto, which should work for compilers old and
> > new. The suggestion is to first check -march=armv8-a+simd and only then
> > check -mfpu=auto.
> >
> > To address this, add a way to force the architecture (the value of
> > the -march option).
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >   config/arm/meson.build | 40 +++++++++++++++++++++++-----------------
> >   1 file changed, 23 insertions(+), 17 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > index 3f22d8a2fc..c3f763764a 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -43,7 +43,9 @@ implementer_generic = {
> >           },
> >           'generic_aarch32': {
> >               'march': 'armv8-a',
> > -            'compiler_options': ['-mfpu=neon'],
> > +            'force_march': true,
> > +            'march_features': ['simd'],
> > +            'compiler_options': ['-mfpu=auto'],
> >               'flags': [
> >                   ['RTE_ARCH_ARM_NEON_MEMCPY', false],
> >                   ['RTE_ARCH_STRICT_ALIGN', true],
> > @@ -695,21 +697,25 @@ if update_flags
> >       # probe supported archs and their features
> >       candidate_march = ''
> >       if part_number_config.has_key('march')
> > -        supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-a',
> > -                            'armv8.2-a', 'armv8.1-a', 'armv8-a']
> > -        check_compiler_support = false
> > -        foreach supported_march: supported_marchs
> > -            if supported_march == part_number_config['march']
> > -                # start checking from this version downwards
> > -                check_compiler_support = true
> > -            endif
> > -            if (check_compiler_support and
> > -                cc.has_argument('-march=' + supported_march))
> > -                candidate_march = supported_march
> > -                # highest supported march version found
> > -                break
> > -            endif
> > -        endforeach
> > +        if part_number_config.get('force_march', false)
> > +            candidate_march = part_number_config['march']
> > +        else
> > +            supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-a',
> > +                                'armv8.2-a', 'armv8.1-a', 'armv8-a']
> > +            check_compiler_support = false
> > +            foreach supported_march: supported_marchs
> > +                if supported_march == part_number_config['march']
> > +                    # start checking from this version downwards
> > +                    check_compiler_support = true
> > +                endif
> > +                if (check_compiler_support and
> > +                    cc.has_argument('-march=' + supported_march))
> > +                    candidate_march = supported_march
> > +                    # highest supported march version found
> > +                    break
> > +                endif
> > +            endforeach
> > +        endif
> >           if candidate_march == ''
> >               error('No suitable armv8 march version found.')
> >           endif
> > @@ -741,7 +747,7 @@ if update_flags
> >       # apply supported compiler options
> >       if part_number_config.has_key('compiler_options')
> >           foreach flag: part_number_config['compiler_options']
> > -            if cc.has_argument(flag)
> > +            if cc.has_multi_arguments(machine_args + [flag])
> >                   machine_args += flag
> >               else
> >                   warning('Configuration compiler option ' +
> 
> 
> Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
> 
> 

Applied with Cc: stable@dpdk.org, thanks.




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

end of thread, other threads:[~2023-11-06 14:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-21  9:59 [PATCH v1] config/arm: update aarch32 build with gcc13 Juraj Linkeš
2023-10-09  9:53 ` [PATCH v2] " Juraj Linkeš
2023-10-10  2:55   ` Ruifeng Wang
2023-10-12 12:40   ` Paul Szczepanek
2023-10-13  7:35     ` Juraj Linkeš
2023-10-25 12:57   ` [PATCH v3] " Juraj Linkeš
2023-10-26  7:04     ` Ruifeng Wang
2023-11-01 12:57     ` Paul Szczepanek
2023-11-06 14:22       ` Thomas Monjalon

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).