Skip to contentSkip to conversation

acl: fix missing flags when compiling without AVX2

PATCH In review Andrius Sirvys 3 participants 3 messages Mar 11, 2019 – Mar 27, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 acl: fix missing flags when compiling without AVX2

When compiling the ACL library on a system without AVX2 support, the flags used to compile the AVX2-specific code for later run-time use were not based on the regular cflags for the rest of the library. This can cause errors due to symbols being missed/undefined due to incorrect flags. For example,
when testing compilation on Alpine linux, we got:
error: unknown type name 'cpu_set_t'
due to _GNU_SOURCE not being defined in the cflags.

This issue can be fixed by appending "-mavx2" to
the cflags rather than replacing them with it.

Fixes 5b9656b157d3 ("lib: build with meson")

---
Cc: [email protected]

v2: fixed spelling errors in code

---
 lib/librte_acl/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_acl/meson.build +1 -1
index aec792f..58d346a 100644
@@ -23,7 +23,7 @@ if arch_subdir == 'x86'
 		avx2_tmplib = static_library('avx2_tmp',
 				'acl_run_avx2.c',
 				dependencies: static_rte_eal,
-				c_args: '-mavx2')
+				c_args: cflags +  ['-mavx2'])
 		objs += avx2_tmplib.extract_objects('acl_run_avx2.c')
 		cflags += '-DCC_AVX2_SUPPORT'
 	endif
Signature · 1 line
2.7.4
Acked-by on v2 1/1
#1 lore raw
Quoted 29 lines · Andrius Sirvys

When compiling the ACL library on a system without AVX2 support, the flags used to compile the AVX2-specific code for later run-time use were not based on the regular cflags for the rest of the library. This can cause errors due to symbols being missed/undefined due to incorrect flags. For example,
when testing compilation on Alpine linux, we got:
error: unknown type name 'cpu_set_t'
due to _GNU_SOURCE not being defined in the cflags.

This issue can be fixed by appending "-mavx2" to
the cflags rather than replacing them with it.

Fixes 5b9656b157d3 ("lib: build with meson")

---
Cc: [email protected]

v2: fixed spelling errors in code

---
 lib/librte_acl/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_acl/meson.build +0 -0
index aec792f..58d346a 100644

lib/librte_acl/meson.build if arch_subdir == 'x86' · line 29

Quoted 8 lines
lib/librte_acl/meson.build +1 -1
@@ -23,7 +23,7 @@ if arch_subdir == 'x86'
 		avx2_tmplib = static_library('avx2_tmp',
 				'acl_run_avx2.c',
 				dependencies: static_rte_eal,
-				c_args: '-mavx2')
+				c_args: cflags +  ['-mavx2'])
 		objs += avx2_tmplib.extract_objects('acl_run_avx2.c')
 		cflags += '-DCC_AVX2_SUPPORT'
 	endif

Looks to be 2 spaces rather than 1 before the opening "[", but not a big deal and can be fixed on apply if necessary.

#2 lore raw

11/03/2019 17:31, Bruce Richardson:

Quoted 26 lines · Andrius Sirvys
Quoted 19 lines

When compiling the ACL library on a system without AVX2 support, the flags used to compile the AVX2-specific code for later run-time use were not based on the regular cflags for the rest of the library. This can cause errors due to symbols being missed/undefined due to incorrect flags. For example,
when testing compilation on Alpine linux, we got:
error: unknown type name 'cpu_set_t'
due to _GNU_SOURCE not being defined in the cflags.

This issue can be fixed by appending "-mavx2" to
the cflags rather than replacing them with it.

Fixes 5b9656b157d3 ("lib: build with meson")

---

lib/librte_acl/meson.build if arch_subdir == 'x86' · line 26

Quoted 2 lines
lib/librte_acl/meson.build +1 -1
-				c_args: '-mavx2')
+				c_args: cflags +  ['-mavx2'])

Looks to be 2 spaces rather than 1 before the opening "[", but not a big deal and can be fixed on apply if necessary.

Quoted 1 line

Applied (without double space), thanks