When add below config into local.conf
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE:virtclass-multilib-lib32 = "x86"

There comes below error:
$ bitbake dpdk

ERROR: ExpansionError during parsing /build/layers/meta-dpdk/recipes-extended/dpdk/dpdk_23.11.bb
   Traceback (most recent call last):
     File "Var <EXTRA_OEMESON>", line 1, in <module>
File "/build/layers/meta-dpdk/recipes-extended/dpdk/dpdk_23.11.bb", line 12, in get_cpu_instruction_set(bb=<module 'bb' from '/build/layers/oe-core/bitbake/lib/bb/__init__.py'>, d=<bb.data_smart.DataSmart object at 0x7f63569bb070>):
         import re
     >    march = re.search(r'-march=([^\s]*)', d.getVar('CC')).group(1)
         return march
bb.data_smart.ExpansionError: Failure expanding variable EXTRA_OEMESON, expression was -Dexamples=all -Dcpu_instruction_set=${@get_cpu_instruction_set(bb, d)} which triggered exception AttributeError: 'NoneType' object has no attribute 'group' The variable dependency chain for the failure is: EXTRA_OEMESON -> meson_do_configure

   ERROR: Parsing halted due to errors, see error messages above


Thanks,

On 12/7/23 15:38, Lee Chee Yang wrote:
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

From: Lee Chee Yang <[email protected]>

drop the dpdk-module, kni driver now dropped.
https://github.com/DPDK/dpdk/commit/f78c100bc87119c6a94130a6689d773afdaa9d98

EXTRA_OEMESON remove enable_kmods.

set the cpu_instruction_set through EXTRA_OEMESON.

Signed-off-by: Lee Chee Yang <[email protected]>
---
v2: dropped patch introduce in v1, replace with patch to set the 
cpu_instruction_set in meson.build.
get cpu_instruction_set from CC -march parameter.

  recipes-extended/dpdk/dpdk-module_23.07.bb    | 50 -------------------
  ...-cpu_instruction_set-from-meson-opti.patch | 32 ++++++++++++
  .../dpdk/{dpdk_23.07.bb => dpdk_23.11.bb}     | 19 +++----
  3 files changed, 42 insertions(+), 59 deletions(-)
  delete mode 100644 recipes-extended/dpdk/dpdk-module_23.07.bb
  create mode 100644 
recipes-extended/dpdk/dpdk/0001-config-meson-get-cpu_instruction_set-from-meson-opti.patch
  rename recipes-extended/dpdk/{dpdk_23.07.bb => dpdk_23.11.bb} (75%)

diff --git a/recipes-extended/dpdk/dpdk-module_23.07.bb 
b/recipes-extended/dpdk/dpdk-module_23.07.bb
deleted file mode 100644
index c76ed87..0000000
--- a/recipes-extended/dpdk/dpdk-module_23.07.bb
+++ /dev/null
@@ -1,50 +0,0 @@
-include dpdk.inc
-
-FILESEXTRAPATHS:prepend := "${THISDIR}/dpdk:"
-
-SRC_URI = "git://dpdk.org/git/dpdk;branch=${BRANCH};protocol=https \
-            file://0001-Makefile-add-makefile.patch \
-"
-
-BRANCH = "releases"
-SRCREV = "12fcafcd62286933e6b167b14856d21f642efa5f"
-S = "${WORKDIR}/git"
-
-inherit module
-
-#kernel module needs 'rte_build_config.h', which is generated at buid time
-DEPENDS += "dpdk"
-
-COMPATIBLE_MACHINE = "null"
-COMPATIBLE_HOST:libc-musl:class-target = "null"
-COMPATIBLE_HOST:linux-gnux32 = "null"
-
-export S
-export STAGING_KERNEL_DIR
-export STAGING_INCDIR
-export INSTALL_MOD_DIR="dpdk"
-
-do_configure[noexec] = "1"
-
-do_compile() {
-    cd ${S}/kernel/linux/kni
-    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-    oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR}   \
-           KERNEL_VERSION=${KERNEL_VERSION}    \
-           CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
-           AR="${KERNEL_AR}" \
-               O=${STAGING_KERNEL_BUILDDIR} \
-           KBUILD_EXTRA_SYMBOLS="${KBUILD_EXTRA_SYMBOLS}" \
-           ${MAKE_TARGETS}
-}
-
-do_install() {
-    cd ${S}/kernel/linux/kni
-    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-    oe_runmake DEPMOD=echo 
MODLIB="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}" \
-               INSTALL_FW_PATH="${D}${nonarch_base_libdir}/firmware" \
-               CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
-               O=${STAGING_KERNEL_BUILDDIR} \
-               ${MODULES_INSTALL_TARGET}
-}
-
diff --git 
a/recipes-extended/dpdk/dpdk/0001-config-meson-get-cpu_instruction_set-from-meson-opti.patch
 
b/recipes-extended/dpdk/dpdk/0001-config-meson-get-cpu_instruction_set-from-meson-opti.patch
new file mode 100644
index 0000000..92e3523
--- /dev/null
+++ 
b/recipes-extended/dpdk/dpdk/0001-config-meson-get-cpu_instruction_set-from-meson-opti.patch
@@ -0,0 +1,32 @@
+From 121e5d019f0bb6dec0ace2b361611edd10fc8ff8 Mon Sep 17 00:00:00 2001
+From: Lee Chee Yang <[email protected]>
+Date: Wed, 6 Dec 2023 16:58:10 +0800
+Subject: [PATCH] config/meson: get cpu_instruction_set from meson option
+
+Workaround error:
+| ../git/config/meson.build:178:8: ERROR: Problem encountered: Compiler
+does not support "x86_64" arch flag.
+
+Upstream-Status: Inappropriate [ yocto specific to set cpu_instruction_set ]
+
+Signed-off-by: Lee Chee Yang <[email protected]>
+---
+ config/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/meson.build b/config/meson.build
+index a9ccd56deb..f310c7adf6 100644
+--- a/config/meson.build
++++ b/config/meson.build
+@@ -105,7 +105,7 @@ platform = get_option('platform')
+
+ # set the cpu_instruction_set and cflags for it
+ if meson.is_cross_build()
+-    cpu_instruction_set = host_machine.cpu()
++    cpu_instruction_set = get_option('cpu_instruction_set')
+ else
+     cpu_instruction_set = get_option('cpu_instruction_set')
+     machine = get_option('machine')
+--
+2.37.3
+
diff --git a/recipes-extended/dpdk/dpdk_23.07.bb 
b/recipes-extended/dpdk/dpdk_23.11.bb
similarity index 75%
rename from recipes-extended/dpdk/dpdk_23.07.bb
rename to recipes-extended/dpdk/dpdk_23.11.bb
index 3a1b0a8..5f0f9ec 100644
--- a/recipes-extended/dpdk/dpdk_23.07.bb
+++ b/recipes-extended/dpdk/dpdk_23.11.bb
@@ -1,17 +1,18 @@
  include dpdk.inc

-SRC_URI = "git://dpdk.org/git/dpdk;branch=${BRANCH};protocol=https \
-           
file://0001-meson.build-march-and-mcpu-already-passed-by-Yocto-21.11.patch \
-"
+SRC_URI += " file://0001-config-meson-get-cpu_instruction_set-from-meson-opti.patch 
"

-BRANCH = "releases"
-SRCREV = "12fcafcd62286933e6b167b14856d21f642efa5f"
+STABLE = "-stable"
+BRANCH = "23.11"
+SRCREV = "eeb0605f118dae66e80faa44f7b3e88748032353"
  S = "${WORKDIR}/git"

-# kernel module is provide by dpdk-module recipe, so disable here
-EXTRA_OEMESON = " -Denable_kmods=false \
-                -Dexamples=all \
-"
+def get_cpu_instruction_set(bb, d):
+    import re
+    march = re.search(r'-march=([^\s]*)', d.getVar('CC')).group(1)
+    return march
+
+EXTRA_OEMESON = " -Dexamples=all 
-Dcpu_instruction_set=${@get_cpu_instruction_set(bb, d)} "

  COMPATIBLE_MACHINE = "null"
  COMPATIBLE_HOST:libc-musl:class-target = "null"
--
2.37.3





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8194): 
https://lists.yoctoproject.org/g/meta-intel/message/8194
Mute This Topic: https://lists.yoctoproject.org/mt/103030461/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to