Skip to contentSkip to conversation

build: fix invalid characters in toolchain definitions

PATCH Applied Bruce Richardson 4 participants 5 messages Feb 7, 2023 – Feb 20, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: fix invalid characters in toolchain definitions

When using "icx" (Intel(R) oneAPI DPC++/C++ Compiler) to build DPDK, meson reports the toolchain as "intel-llvm"[1]. This value is used directly to define the RTE_TOOLCHAIN macros, which means that we end up with the invalid macro name "RTE_TOOLCHAIN_INTEL-LLVM", and getting the compiler warning:

./rte_build_config.h:422:28: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions]

This can be fixed, and the macro generation made more robust generally, by adding "underscorify()" on the string. This replaces the "-", and any other invalid characters, with "_" [2].

[1] https://mesonbuild.com/Reference-tables.html#compiler-ids
[2] https://mesonbuild.com/Reference-manual_elementary_str.html#strunderscorify

Fixes afd18fa21b5e ("build: set toolchain info during meson configure")
---
 config/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/meson.build +1 -1
index 26f3168bc9..fc3ac99a32 100644
@@ -139,7 +139,7 @@ endif
 
 toolchain = cc.get_id()
 dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain)
-dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper(), 1)
+dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper().underscorify(), 1)
 
 dpdk_conf.set('RTE_ARCH_64', cc.sizeof('void *') == 8)
 dpdk_conf.set('RTE_ARCH_32', cc.sizeof('void *') == 4)
Signature · 1 line
2.37.2
Acked-by on v1 1/1
#1 lore raw

________________________________________
From: Richardson, Bruce <[email protected]>
Sent: Tuesday, February 7, 2023 9:22 AM
To: [email protected]
Cc: Richardson, Bruce; [email protected]; Wiles, Keith
Subject: [PATCH] build: fix invalid characters in toolchain definitions

When using "icx" (Intel(R) oneAPI DPC++/C++ Compiler) to build DPDK, meson reports the toolchain as "intel-llvm"[1]. This value is used directly to define the RTE_TOOLCHAIN macros, which means that we end up with the invalid macro name "RTE_TOOLCHAIN_INTEL-LLVM", and getting the compiler warning:

./rte_build_config.h:422:28: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions]

This can be fixed, and the macro generation made more robust generally, by adding "underscorify()" on the string. This replaces the "-", and any other invalid characters, with "_" [2].

[1] https://mesonbuild.com/Reference-tables.html#compiler-ids
[2] https://mesonbuild.com/Reference-manual_elementary_str.html#strunderscorify

Fixes afd18fa21b5e ("build: set toolchain info during meson configure")
---
 config/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/meson.build +1 -1
index 26f3168bc9..fc3ac99a32 100644
@@ -139,7 +139,7 @@ endif
 
 toolchain = cc.get_id()
 dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain)
-dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper(), 1)
+dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper().underscorify(), 1)
 
 dpdk_conf.set('RTE_ARCH_64', cc.sizeof('void *') == 8)
 dpdk_conf.set('RTE_ARCH_32', cc.sizeof('void *') == 4)

--
2.37.2

author Acked-by Keith Wiles on v1 1/1
#2 lore raw
In reply to Bruce Richardson
Quoted 15 lines · Bruce Richardson

When using "icx" (Intel(R) oneAPI DPC++/C++ Compiler) to build DPDK, meson reports the toolchain as "intel-llvm"[1]. This value is used directly to define the RTE_TOOLCHAIN macros, which means that we end up with the invalid macro name "RTE_TOOLCHAIN_INTEL-LLVM", and getting the compiler warning:

./rte_build_config.h:422:28: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions]

This can be fixed, and the macro generation made more robust generally, by adding "underscorify()" on the string. This replaces the "-", and any other invalid characters, with "_" [2].

[1] https://mesonbuild.com/Reference-tables.html#compiler-ids
[2] https://mesonbuild.com/Reference-manual_elementary_str.html#strunderscorify

Quoted 6 lines
Fixes afd18fa21b5e ("build: set toolchain info during meson configure")

---

Resending Keith's ack, since patchwork doesn't seem to have picked it up from Keith's email.

Acked-by on v1 1/1
#3 lore raw
In reply to Bruce Richardson
Quoted 12 lines · Bruce Richardson

When using "icx" (Intel(R) oneAPI DPC++/C++ Compiler) to build DPDK, meson reports the toolchain as "intel-llvm"[1]. This value is used directly to define the RTE_TOOLCHAIN macros, which means that we end up with the invalid macro name "RTE_TOOLCHAIN_INTEL-LLVM", and getting the compiler warning:

./rte_build_config.h:422:28: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions]

This can be fixed, and the macro generation made more robust generally, by adding "underscorify()" on the string. This replaces the "-", and any other invalid characters, with "_" [2].

Quoted 8 lines

[1] https://mesonbuild.com/Reference-tables.html#compiler-ids
[2] https://mesonbuild.com/Reference-manual_elementary_str.html#strunderscorify

Fixes afd18fa21b5e ("build: set toolchain info during meson configure")
#4 lore raw

08/02/2023 19:08, Tyler Retzlaff:

Quoted 16 lines · Bruce Richardson
Quoted 15 lines

When using "icx" (Intel(R) oneAPI DPC++/C++ Compiler) to build DPDK, meson reports the toolchain as "intel-llvm"[1]. This value is used directly to define the RTE_TOOLCHAIN macros, which means that we end up with the invalid macro name "RTE_TOOLCHAIN_INTEL-LLVM", and getting the compiler warning:

./rte_build_config.h:422:28: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions]

This can be fixed, and the macro generation made more robust generally, by adding "underscorify()" on the string. This replaces the "-", and any other invalid characters, with "_" [2].

[1] https://mesonbuild.com/Reference-tables.html#compiler-ids
[2] https://mesonbuild.com/Reference-manual_elementary_str.html#strunderscorify

Quoted 7 lines
Quoted 5 lines
Fixes afd18fa21b5e ("build: set toolchain info during meson configure")

Applied, thanks.