Skip to contentSkip to conversation

config/x86: enable compatibility with muon-build

PATCH Applied Bruce Richardson 3 participants 3 messages Feb 4 – Jul 12 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 config/x86: enable compatibility with muon-build

Muon[1] is a reimplementation of meson in C, and in some ways is rather stricter than meson in processing the build files. Make a few small changes to the meson.build files to improve muon compatibility without affecting meson:
* when checking a list of compiler args always use has_multi_arguments rather than has_argument, even if list only contains one item.
* when putting lists of compiler args in message output, explicitly convert to a string for output using ','.join().

[1] https://github.com/muon-build/muon

---
Note: after this patch, the majority of DPDK configures ok using muon on my x86 system. Some drivers have not been checked due to missing dependencies on my system, but one, ml/cnxk, I had to explicitly disable as it's using a feature not currently supported by muon (cmake_args parameter to "dependency()").
Despite this limitation, I think occasionally testing things with muon is useful to more rigorously check our build files.

---
 config/x86/meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
config/x86/meson.build +3 -3
index d2f4d5c02a..124b204847 100644
@@ -68,7 +68,7 @@ if is_linux or cc.get_id() == 'gcc'
 endif
 
 avx512_march_flag = ['-march=x86-64-v4']
-if not cc.has_argument(avx512_march_flag)
+if not cc.has_multi_arguments(avx512_march_flag)
     avx512_march_flag = ['-march=skylake-avx512']
 endif
 # workaround for older compilers, e.g. GCC 8.5 on RHEL 8.
@@ -99,9 +99,9 @@ if (binutils_ok and cc.has_multi_arguments(avx512_march_flag)
     endif
 endif
 if developer_mode and meson.version().version_compare('>=0.60.2')
-    message('Extra C flags needed for AVX2 output: @0@'.format(cc_avx2_flags))
+    message('Extra C flags needed for AVX2 output: [@0@]'.format(','.join(cc_avx2_flags)))
     if cc_has_avx512
-        message('Extra C flags needed for AVX512 output: @0@'.format(cc_avx512_flags))
+        message('Extra C flags needed for AVX512 output: [@0@]'.format(','.join(cc_avx512_flags)))
     endif
 endif
 
Signature · 1 line
2.51.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines

Subject: [PATCH] config/x86: enable compatibility with muon-build

Muon[1] is a reimplementation of meson in C, and in some ways is rather stricter than meson in processing the build files. Make a few small changes to the meson.build files to improve muon compatibility without affecting meson:
* when checking a list of compiler args always use has_multi_arguments rather than has_argument, even if list only contains one item.
* when putting lists of compiler args in message output, explicitly convert to a string for output using ','.join().

Quoted 3 lines

[1] https://github.com/muon-build/muon

I tested this out with both muon built from source and muon downloaded as a package ("muon-meson"). Only the version from source worked, as the package version was missing some features required for building DPDK. I encountered the same issue with the cnxk driver you flagged. Build was successful after disabling. I think it makes sense to make these changes.

Quoted 44 lines

---
Note: after this patch, the majority of DPDK configures ok using muon on my x86 system. Some drivers have not been checked due to missing dependencies on my system, but one, ml/cnxk, I had to explicitly disable as it's using a feature not currently supported by muon (cmake_args parameter to "dependency()").
Despite this limitation, I think occasionally testing things with muon is useful to more rigorously check our build files.

---
 config/x86/meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
config/x86/meson.build +2 -3
index d2f4d5c02a..124b204847 100644
@@ -68,7 +68,7 @@ if is_linux or cc.get_id() == 'gcc'
 endif
 
 avx512_march_flag = ['-march=x86-64-v4']
-if not cc.has_argument(avx512_march_flag)
+if not cc.has_multi_arguments(avx512_march_flag)
     avx512_march_flag = ['-march=skylake-avx512']
 endif
 # workaround for older compilers, e.g. GCC 8.5 on RHEL 8.
@@ -99,9 +99,9 @@ if (binutils_ok and
 cc.has_multi_arguments(avx512_march_flag)
     endif
 endif
 if developer_mode and meson.version().version_compare('>=0.60.2')
-    message('Extra C flags needed for AVX2 output:
 @0@'.format(cc_avx2_flags))
+    message('Extra C flags needed for AVX2 output:
 [@0@]'.format(','.join(cc_avx2_flags)))
     if cc_has_avx512
-        message('Extra C flags needed for AVX512 output:

@0@'.format(cc_avx512_flags))
+ message('Extra C flags needed for AVX512 output:
[@0@]'.format(','.join(cc_avx512_flags)))
endif
endif

--
2.51.0

#2 lore raw

22/04/2026 13:02, Loftus, Ciara:

Quoted 15 lines
Quoted 11 lines

Subject: [PATCH] config/x86: enable compatibility with muon-build

Muon[1] is a reimplementation of meson in C, and in some ways is rather stricter than meson in processing the build files. Make a few small changes to the meson.build files to improve muon compatibility without affecting meson:
* when checking a list of compiler args always use has_multi_arguments rather than has_argument, even if list only contains one item.
* when putting lists of compiler args in message output, explicitly convert to a string for output using ','.join().

Quoted 3 lines

[1] https://github.com/muon-build/muon

Quoted 8 lines

I tested this out with both muon built from source and muon downloaded as a package ("muon-meson"). Only the version from source worked, as the package version was missing some features required for building DPDK. I encountered the same issue with the cnxk driver you flagged. Build was successful after disabling. I think it makes sense to make these changes.

Applied, thanks.