Skip to contentSkip to conversation

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

PATCH Superseded Luca Boccassi 6 participants 16 messages Dec 24, 2018 – Apr 17, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: use generic march on arm64 when using 'default' machine

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 marchine=default at configuration time.

Fixes b1d48c41189a ("build: support ARM with meson")
---
 config/arm/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +6 -1
index dae55d6b2..fa21a2fd2 100644
@@ -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']],
@@ -105,7 +106,11 @@ 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
+		cmd_output = cmd_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(
Signature · 1 line
2.19.2
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Luca Boccassi

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 marchine=default

typo: marchine

Quoted 15 lines

at configuration time.

Fixes b1d48c41189a ("build: support ARM with meson")
---
 config/arm/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +0 -0
index dae55d6b2..fa21a2fd2 100644

config/arm/meson.build line 9

Quoted 4 lines
config/arm/meson.build +1 -0
@@ -6,6 +6,7 @@
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
+arm_force_default_march = machine == 'default'

Do we need a new variable here? Given it only seems to be used once below, I think just having the boolean expression directly in the if statement is clearer. If you do keep the variable, suggest putting braces around the comparison, otherwise at first glance it looks like a chained assignment like you get in C e.g. x = y = 0;

Quoted 19 lines
config/arm/meson.build +5 -1
 machine_args_generic = [
 	['default', ['-march=armv8-a+crc+crypto']],
@@ -105,7 +106,11 @@ 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
+		cmd_output = cmd_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(
Signature · 1 line
2.19.2

With these comments, looks ok to me from a meson viewpoint. I think an ack from the arm side would be good to get too though.

#2 lore raw
Quoted 65 lines · Bruce Richardson
Quoted 6 lines · Luca Boccassi

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 marchine=default

typo: marchine

Quoted 16 lines

at configuration time.

Fixes b1d48c41189a ("build: support ARM with meson")

---
 config/arm/meson.build | 7 ++++++-

 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +0 -0
index dae55d6b2..fa21a2fd2 100644
@@ -6,6 +6,7 @@
  march_opt = '-march=@0@'.format(machine)
Quoted 3 lines


 arm_force_native_march = false
+arm_force_default_march = machine == 'default'

Do we need a new variable here? Given it only seems to be used once below,
I think just having the boolean expression directly in the if statement is
clearer. If you do keep the variable, suggest putting braces around the
comparison, otherwise at first glance it looks like a chained assignment
like you get in C e.g. x = y = 0;

Quoted 13 lines


 machine_args_generic = [
  ['default', ['-march=armv8-a+crc+crypto']],

config/arm/meson.build +0 -0
@@ -105,7 +106,11 @@ else

  cmd_generic = ['generic', '', '', 'default', ''] cmd_output = cmd_generic # Set generic by default machine_args = [] # Clear previous machine args

config/arm/meson.build +5 -1
-	if not meson.is_cross_build()
+	if arm_force_default_march and not meson.is_cross_build()
+		machine = impl_generic
+		cmd_output = cmd_generic
+		impl_pn = 'default'
+	elif not meson.is_cross_build()
Quoted 7 lines

  # The script returns ['Implementer', 'Variant', 'Architecture',
  # 'Primary Part number', 'Revision'] detect_vendor = find_program(join_paths( --
2.19.2

With these comments, looks ok to me from a meson viewpoint. I think an ack
from the arm side would be good to get too though.

Quoted 1 line

Fixed typo, removed variable and added the arm maintainers to CC in v2, thanks.

Signature · 2 lines
Kind regards,
Luca Boccassi
#3 lore raw
In reply to Bruce Richardson
Quoted 31 lines · Bruce Richardson
Quoted 6 lines · Luca Boccassi

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 marchine=default

typo: marchine

Quoted 16 lines

at configuration time.

Fixes b1d48c41189a ("build: support ARM with meson")

---
 config/arm/meson.build | 7 ++++++-

 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +0 -0
index dae55d6b2..fa21a2fd2 100644
@@ -6,6 +6,7 @@
  march_opt = '-march=@0@'.format(machine)
Quoted 3 lines


 arm_force_native_march = false
+arm_force_default_march = machine == 'default'

Do we need a new variable here? Given it only seems to be used once

Quoted 8 lines

below,
I think just having the boolean expression directly in the if statement is
clearer. If you do keep the variable, suggest putting braces around the
comparison, otherwise at first glance it looks like a chained assignment
like you get in C e.g. x = y = 0;

Eheh it looks like I was a bit too hasty - I now remember that the main reason I added a new variable is that the "machine" variable gets overridden just before the if branch, so the original value is lost. I could refactor and rename, but that would be more intrusive so I had opted to just do what was already done for the other "force" case.

Signature · 2 lines
Kind regards,
Luca Boccassi
#4 lore raw

PATCH v2 1/1 build: use generic march on arm64 when using 'default' machine

In reply to Luca Boccassi

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

---
v2: fix typo in commit message, remove variable used only once

 config/arm/meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
config/arm/meson.build +5 -1
index dae55d6b2..f15ef6385 100644
@@ -105,7 +105,11 @@ 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 machine == 'default' and not meson.is_cross_build()
+		machine = impl_generic
+		cmd_output = cmd_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(
Signature · 1 line
2.20.1
#5 lore raw

PATCH v3 1/1 build: use generic march on arm64 when using 'default' machine

In reply to Luca Boccassi

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

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

 config/arm/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +6 -1
index dae55d6b2..614139534 100644
@@ -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']],
@@ -105,7 +106,11 @@ 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
+		cmd_output = cmd_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(
Signature · 1 line
2.20.1
#6 lore raw
Quoted 42 lines · Luca Boccassi

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

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

 config/arm/meson.build | 7 ++++++-

 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +0 -0
index dae55d6b2..614139534 100644
@@ -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']],

config/arm/meson.build +0 -0
@@ -105,7 +106,11 @@ else

  cmd_generic = ['generic', '', '', 'default', ''] cmd_output = cmd_generic # Set generic by default machine_args = [] # Clear previous machine args

config/arm/meson.build +5 -1
-	if not meson.is_cross_build()
+	if arm_force_default_march and not meson.is_cross_build()
+		machine = impl_generic
+		cmd_output = cmd_generic
+		impl_pn = 'default'
+	elif not meson.is_cross_build()
Quoted 4 lines

  # The script returns ['Implementer', 'Variant', 'Architecture',
  # 'Primary Part number', 'Revision'] detect_vendor = find_program(join_paths(

Any chance for a quick review from the arm maintainers/devs? Thanks!

Signature · 2 lines
Kind regards,
Luca Boccassi
#7 lore raw
Quoted 46 lines · Luca Boccassi

External Email

-------------------------------------------------------------------
---

Quoted 41 lines · Luca Boccassi

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

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

 config/arm/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +4 -1
index dae55d6b2..614139534 100644
@@ -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']],
@@ -105,7 +106,11 @@ 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
+		cmd_output = cmd_generic
Quoted 8 lines
Quoted 6 lines
config/arm/meson.build +2 -0
+		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(

Any chance for a quick review from the arm maintainers/devs? Thanks!

Looks good.

Could you please document the procedure to build generic image some where in the DPDK documentation.

I guess the procedure will be same for x86 and arm64. Right?

#8 lore raw
Quoted 59 lines · Jerin Jacob Kollanukkaran
Quoted 49 lines · Luca Boccassi

External Email

-------------------------------------------------------------------
---

Quoted 44 lines · Luca Boccassi

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

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

 config/arm/meson.build | 7 ++++++-

 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +0 -0
index dae55d6b2..614139534 100644
@@ -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']],

config/arm/meson.build +0 -0
@@ -105,7 +106,11 @@ else

  cmd_generic = ['generic', '', '', 'default', ''] cmd_output = cmd_generic # Set generic by default machine_args = [] # Clear previous machine args

config/arm/meson.build +1 -1
-	if not meson.is_cross_build()
+	if arm_force_default_march and not

meson.is_cross_build()

config/arm/meson.build +3 -0
+		machine = impl_generic
+		cmd_output = cmd_generic
+		impl_pn = 'default'
Quoted 8 lines
Quoted 5 lines
config/arm/meson.build +1 -0
+	elif not meson.is_cross_build()

  # The script returns ['Implementer', 'Variant', 'Architecture',
  # 'Primary Part number', 'Revision'] detect_vendor = find_program(join_paths(

Any chance for a quick review from the arm maintainers/devs? Thanks!

Quoted 6 lines

Looks good.

Could you please document the procedure to build generic image some where in the DPDK documentation.

I guess the procedure will be same for x86 and arm64. Right?

The "machine" meson option is already described in meson_options.txt, is that enough?

Signature · 2 lines
Kind regards,
Luca Boccassi
#9 lore raw
Quoted 64 lines · Luca Boccassi
Quoted 63 lines · Jerin Jacob Kollanukkaran
Quoted 51 lines · Luca Boccassi

External Email

---------------------------------------------------------------
----
---

Quoted 45 lines · Luca Boccassi

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

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

 config/arm/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +5 -1
index dae55d6b2..614139534 100644
@@ -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']],
@@ -105,7 +106,11 @@ 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
+		cmd_output = cmd_generic
+		impl_pn = 'default'
Quoted 8 lines

config/arm/meson.build else · line 116

Quoted 5 lines
config/arm/meson.build +1 -0
+	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant',
 'Architecture',
config/arm/meson.build +0 -0
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(

Any chance for a quick review from the arm maintainers/devs? Thanks!

Looks good.

Quoted 7 lines
Quoted 4 lines

Could you please document the procedure to build generic image some where in the DPDK documentation.

I guess the procedure will be same for x86 and arm64. Right?

The "machine" meson option is already described in meson_options.txt, is that enough?

I meant, Documenting the steps to create the generic image i.e - Dmachine=default scheme to use generic build for meson based distribution build.

Is it same for x86 too?

meson configure -Dmachine=default
meson build
cd build
ninja
ninja install

Quoted 1 line
#10 lore raw
Quoted 84 lines · Jerin Jacob Kollanukkaran
Quoted 73 lines · Luca Boccassi
Quoted 72 lines · Jerin Jacob Kollanukkaran
Quoted 56 lines · Luca Boccassi

External Email

---------------------------------------------------------------
----
---

Quoted 50 lines · Luca Boccassi

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

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

 config/arm/meson.build | 7 ++++++-

 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +0 -0
index dae55d6b2..614139534 100644
@@ -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']],

config/arm/meson.build +0 -0
@@ -105,7 +106,11 @@ else

  cmd_generic = ['generic', '', '', 'default', ''] cmd_output = cmd_generic # Set generic by default machine_args = [] # Clear previous machine args

config/arm/meson.build +1 -1
-	if not meson.is_cross_build()
+	if arm_force_default_march and not

meson.is_cross_build()

config/arm/meson.build +4 -0
+		machine = impl_generic
+		cmd_output = cmd_generic
+		impl_pn = 'default'
+	elif not meson.is_cross_build()
Quoted 8 lines
Quoted 5 lines

  # The script returns ['Implementer', 'Variant',
'Architecture',
  # 'Primary Part number', 'Revision'] detect_vendor = find_program(join_paths(

Any chance for a quick review from the arm maintainers/devs? Thanks!

Looks good.

Could you please document the procedure to build generic image some
where in the DPDK documentation.

Quoted 5 lines
Quoted 1 line

I guess the procedure will be same for x86 and arm64. Right?

The "machine" meson option is already described in meson_options.txt,
is that enough?

I meant, Documenting the steps to create the generic image i.e - Dmachine=default scheme to use generic build for meson based distribution build.

Quoted 7 lines

Is it same for x86 too?

meson configure -Dmachine=default
meson build
cd build
ninja
ninja install

Yes that's correct, for any architecture "-Dmachine=default" will pick a stable baseline.
I can send a separate patch to update the doc with that command.

Signature · 2 lines
Kind regards,
Luca Boccassi
#11 lore raw
In reply to Luca Boccassi
Quoted 45 lines · Luca Boccassi

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

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

 config/arm/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +6 -1
index dae55d6b2..614139534 100644
@@ -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']],
@@ -105,7 +106,11 @@ 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
+		cmd_output = cmd_generic
+		impl_pn = 'default'
+	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant',
 'Architecture',
 		# 'Primary Part number', 'Revision']
Quoted 1 line

detect_vendor = find_program(join_paths(

Ping - anything else I can do for this patch? It's necessary for distro native builds, at least in Debian/Ubuntu. Thanks!

Signature · 2 lines
Kind regards,
Luca Boccassi
Acked-by on v3 1/1
#12 lore raw
In reply to Luca Boccassi
Quoted 33 lines · Luca Boccassi

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

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

 config/arm/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +1 -0
index dae55d6b2..614139534 100644
@@ -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']],

config/arm/meson.build else · line 107

Quoted 2 lines
config/arm/meson.build +0 -0
@@ -105,7 +106,11 @@ else
 	cmd_generic = ['generic', '', '', 'default', '']
 	cmd_output = cmd_generic # Set generic by default

^

config/arm/meson.build else · line 111

Quoted 5 lines
config/arm/meson.build +3 -1
 	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
+		cmd_output = cmd_generic

Isn't this assignment redundant as it is already done above?

Quoted 6 lines
config/arm/meson.build +2 -0
+		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(

#13 lore raw
Quoted 46 lines · Pavan Nikhilesh Bhagavatula
Quoted 34 lines · Luca Boccassi

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

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

 config/arm/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
config/arm/meson.build +1 -0
index dae55d6b2..614139534 100644
@@ -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']],

config/arm/meson.build else · line 107

Quoted 2 lines
config/arm/meson.build +0 -0
@@ -105,7 +106,11 @@ else
 	cmd_generic = ['generic', '', '', 'default', '']
 	cmd_output = cmd_generic # Set generic by default

^

config/arm/meson.build else · line 111

Quoted 5 lines
config/arm/meson.build +3 -1
 	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
+		cmd_output = cmd_generic

Isn't this assignment redundant as it is already done above?

Quoted 1 line

Removed in v4, thanks.

Signature · 2 lines
Kind regards,
Luca Boccassi
#14 lore raw

PATCH v4 1/1 build: use generic march on arm64 when using 'default' machine

In reply to Luca Boccassi

From: Luca Boccassi <[email protected]>

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

---
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(-)
config/arm/meson.build +5 -1
index 8e892fa77..dddec4e04 100644
@@ -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(
Signature · 1 line
2.20.1
#15 lore raw

20/03/2019 14:18, [email protected]:

Quoted 8 lines

From: Luca Boccassi <[email protected]>

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.

Quoted 6 lines
Fixes b1d48c41189a ("build: support ARM with meson")

Applied, thanks