[dpdk-stable] [PATCH 20.11] config/arm: replace native machine args

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 19 11:57:40 CET 2021


From: Juraj Linkeš <juraj.linkes at pantheon.tech>

[ backported from upstream commit 9186e5a07f35ae74a1f7fa2d89671b5f77eae407 ]

There are compiler issues when building with -mcpu=native with popular
compilers, such as GCC-8.4:
In file included from ../lib/librte_eal/arm/include/rte_vect.h:11,
                 from ../lib/librte_net/net_crc_neon.c:10:
../lib/librte_net/net_crc_neon.c: In function ‘crcr32_folding_round’:
/usr/lib/gcc/aarch64-linux-gnu/8/include/arm_neon.h:26094:1: error:
inlining failed in call to always_inline ‘vmull_p64’:
target specific option mismatch
 vmull_p64 (poly64_t a, poly64_t b)
../lib/librte_net/net_crc_neon.c:50:20: note: called from here
  uint64x2_t tmp1 = vreinterpretq_u64_p128(vmull_p64(
    vgetq_lane_p64(vreinterpretq_p64_u64(fold), 0),
    vgetq_lane_p64(vreinterpretq_p64_u64(precomp), 1)));

and clang:
gcc -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
clang-9 -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
<no output> # no clang support

Fix this by always specifying the proper machine args and never using
the native flags.

Fixes: 78ac8eac7e8a ("config/arm: use native machine build arguments")

Signed-off-by: Juraj Linkeš <juraj.linkes at pantheon.tech>
Signed-off-by: Luca Boccassi <luca.boccassi at microsoft.com>
---
This is a crude backport, but it fixes the build for arm64. It's a
release blocker for 20.11.1, so I would appreciate a quick review.
Thanks!

 config/arm/meson.build | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42b4e43c74..8beae4a3f9 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -5,7 +5,6 @@
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
-arm_force_native_march = false
 arm_force_default_march = (machine == 'default')
 
 flags_common_default = [
@@ -92,7 +91,6 @@ flags_n1generic_extra = [
 
 machine_args_generic = [
 	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
 	['0xd07', ['-mcpu=cortex-a57']],
@@ -104,7 +102,6 @@ machine_args_generic = [
 
 machine_args_cavium = [
 	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
 	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
 	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
 	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
@@ -112,8 +109,7 @@ machine_args_cavium = [
 	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
 
 machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
@@ -167,9 +163,6 @@ else
 			cmd_output = cmd_generic
 		endif
 		impl_pn = cmd_output[3]
-		if arm_force_native_march == true
-			impl_pn = 'native'
-		endif
 	else
 		impl_id = meson.get_cross_property('implementor_id', 'generic')
 		impl_pn = meson.get_cross_property('implementor_pn', 'default')
-- 
2.29.2



More information about the stable mailing list