DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] config: compiler support check for machine arch flags
@ 2023-10-25 14:17 Sivaprasad Tummala
  2023-10-25 14:29 ` Bruce Richardson
  2023-10-26 18:13 ` [PATCH v2] config: verify machine arch flag Sivaprasad Tummala
  0 siblings, 2 replies; 4+ messages in thread
From: Sivaprasad Tummala @ 2023-10-25 14:17 UTC (permalink / raw)
  To: bruce.richardson; +Cc: david.marchand, dev, ferruh.yigit, neerav.parikh, thomas

Added additional checks for compiler support of specific cpu arch
flags to fix incorrect error reporting.

Without this patch, meson build reports '__SSE4_2__' not defined
error for x86 builds when the compiler does not support the specified
cpu_instruction_set (or) machine argument.

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
---
 config/meson.build | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index d56b0f9bce..e776870def 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -159,8 +159,13 @@ if not is_ms_compiler
     if host_machine.cpu_family().startswith('ppc')
         machine_args += '-mcpu=' + cpu_instruction_set
         machine_args += '-mtune=' + cpu_instruction_set
+        compiler_arch_support = cc.has_argument('-mcpu=' + cpu_instruction_set)
     else
         machine_args += '-march=' + cpu_instruction_set
+        compiler_arch_support = cc.has_argument('-march=' + cpu_instruction_set)
+    endif
+    if not compiler_arch_support
+        error('Compiler does not support "@0@" arch flag.'.format(cpu_instruction_set))
     endif
 endif
 
-- 
2.34.1


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

* Re: [PATCH] config: compiler support check for machine arch flags
  2023-10-25 14:17 [PATCH] config: compiler support check for machine arch flags Sivaprasad Tummala
@ 2023-10-25 14:29 ` Bruce Richardson
  2023-10-26 18:13 ` [PATCH v2] config: verify machine arch flag Sivaprasad Tummala
  1 sibling, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2023-10-25 14:29 UTC (permalink / raw)
  To: Sivaprasad Tummala
  Cc: david.marchand, dev, ferruh.yigit, neerav.parikh, thomas

On Wed, Oct 25, 2023 at 07:17:09AM -0700, Sivaprasad Tummala wrote:
> Added additional checks for compiler support of specific cpu arch
> flags to fix incorrect error reporting.
> 
> Without this patch, meson build reports '__SSE4_2__' not defined
> error for x86 builds when the compiler does not support the specified
> cpu_instruction_set (or) machine argument.
> 
> Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> ---
>  config/meson.build | 5 +++++
>  1 file changed, 5 insertions(+)
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* [PATCH v2] config: verify machine arch flag
  2023-10-25 14:17 [PATCH] config: compiler support check for machine arch flags Sivaprasad Tummala
  2023-10-25 14:29 ` Bruce Richardson
@ 2023-10-26 18:13 ` Sivaprasad Tummala
  2023-11-06 14:25   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Sivaprasad Tummala @ 2023-10-26 18:13 UTC (permalink / raw)
  To: bruce.richardson; +Cc: david.marchand, dev, ferruh.yigit, neerav.parikh, thomas

Added additional checks for compiler support of specific cpu arch
flags to fix incorrect error reporting.

Without this patch, meson build reports '__SSE4_2__' not defined
error for x86 builds when the compiler does not support the specified
cpu_instruction_set (or) machine argument.

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

---
v2:
- fix build issues on arm platforms
---
 config/meson.build | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index d56b0f9bce..bd0918bb62 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -159,8 +159,18 @@ if not is_ms_compiler
     if host_machine.cpu_family().startswith('ppc')
         machine_args += '-mcpu=' + cpu_instruction_set
         machine_args += '-mtune=' + cpu_instruction_set
+        compiler_arch_support = cc.has_argument('-mcpu=' + cpu_instruction_set)
     else
         machine_args += '-march=' + cpu_instruction_set
+        # arm manages generic/auto config in config/arm/meson.build
+        if cpu_instruction_set != 'generic' and cpu_instruction_set != 'auto'
+            compiler_arch_support = cc.has_argument('-march=' + cpu_instruction_set)
+        else
+            compiler_arch_support = true
+        endif
+    endif
+    if not compiler_arch_support
+        error('Compiler does not support "@0@" arch flag.'.format(cpu_instruction_set))
     endif
 endif
 
-- 
2.34.1


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

* Re: [PATCH v2] config: verify machine arch flag
  2023-10-26 18:13 ` [PATCH v2] config: verify machine arch flag Sivaprasad Tummala
@ 2023-11-06 14:25   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2023-11-06 14:25 UTC (permalink / raw)
  To: bruce.richardson, Sivaprasad Tummala
  Cc: dev, david.marchand, ferruh.yigit, neerav.parikh

26/10/2023 20:13, Sivaprasad Tummala:
> Added additional checks for compiler support of specific cpu arch
> flags to fix incorrect error reporting.
> 
> Without this patch, meson build reports '__SSE4_2__' not defined
> error for x86 builds when the compiler does not support the specified
> cpu_instruction_set (or) machine argument.
> 
> Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.



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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25 14:17 [PATCH] config: compiler support check for machine arch flags Sivaprasad Tummala
2023-10-25 14:29 ` Bruce Richardson
2023-10-26 18:13 ` [PATCH v2] config: verify machine arch flag Sivaprasad Tummala
2023-11-06 14:25   ` 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).