[v4] build: use generic march on arm64 when using 'default' machine

Message ID 20190320131801.28289-1-luca.boccassi@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v4] build: use generic march on arm64 when using 'default' machine |

Checks

Context Check Description
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Luca Boccassi March 20, 2019, 1:18 p.m. UTC
  From: Luca Boccassi <bluca@debian.org>

When building for generic distribution we need a stable baseline
architecture, or depending on the build worker the result will vary.

Force the default flags if the user explicitly sets machine=default
at configuration time.

Fixes: b1d48c41189a ("build: support ARM with meson")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
v2: fix typo in commit message, remove variable used only once
v3: put back temporary variable, as "machine" gets overwritten
    by the function and loses the original value before we need
    it.
v4: add acked-by, remove redundant assignment

 config/arm/meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Comments

Thomas Monjalon April 17, 2019, 8:27 p.m. UTC | #1
20/03/2019 14:18, luca.boccassi@gmail.com:
> From: Luca Boccassi <bluca@debian.org>
> 
> When building for generic distribution we need a stable baseline
> architecture, or depending on the build worker the result will vary.
> 
> Force the default flags if the user explicitly sets machine=default
> at configuration time.
> 
> Fixes: b1d48c41189a ("build: support ARM with meson")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Applied, thanks
  

Patch

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 8e892fa77..dddec4e04 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -6,6 +6,7 @@ 
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
+arm_force_default_march = (machine == 'default')
 
 machine_args_generic = [
 	['default', ['-march=armv8-a+crc+crypto']],
@@ -106,7 +107,10 @@  else
 	cmd_generic = ['generic', '', '', 'default', '']
 	cmd_output = cmd_generic # Set generic by default
 	machine_args = [] # Clear previous machine args
-	if not meson.is_cross_build()
+	if arm_force_default_march and not meson.is_cross_build()
+		machine = impl_generic
+		impl_pn = 'default'
+	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(