diff mbox series

[meta-python] python3-m2crypto: fix build with musl multilib

Message ID 20261120070831.2825518-1-mark.yang@lge.com
State Accepted
Headers show
Series [meta-python] python3-m2crypto: fix build with musl multilib | expand

Commit Message

mark.yang Nov. 20, 2026, 7:08 a.m. UTC
From: "mark.yang" <mark.yang@lge.com>

Fix this do_compile failure with musl multilib:

  openssl/configuration.h:19: Error: Unable to find 'bits/wordsize.h'
  openssl/configuration.h:43: Error: CPP #error ""Unknown __WORDSIZE
  detected""

oe-core f296632258 ("multilib_header_wrapper.h: support musl") detects
musl with __has_include. swig has no __has_include, so the wrapper
includes bits/wordsize.h as on glibc. musl does not have this header.

Pass -D__MHWORDSIZE to swig. The wrapper uses a predefined
__MHWORDSIZE as is (rule 1 in f296632258).

Signed-off-by: mark.yang <mark.yang@lge.com>
---
 meta-python/recipes-devtools/python/python3-m2crypto_0.51.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-m2crypto_0.51.0.bb b/meta-python/recipes-devtools/python/python3-m2crypto_0.51.0.bb
index edf38afd2a..a826dabfbc 100644
--- a/meta-python/recipes-devtools/python/python3-m2crypto_0.51.0.bb
+++ b/meta-python/recipes-devtools/python/python3-m2crypto_0.51.0.bb
@@ -30,7 +30,7 @@  RDEPENDS:${PN} += "\
 DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR} -I${STAGING_INCDIR}"
 DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR}"
 
-SWIG_FEATURES ?= "-D__${HOST_ARCH}__ ${@['-D__ILP32__','-D__LP64__'][d.getVar('SITEINFO_BITS') != '32']} -DOPENSSL_NO_FILENAMES"
+SWIG_FEATURES ?= "-D__${HOST_ARCH}__ ${@['-D__ILP32__','-D__LP64__'][d.getVar('SITEINFO_BITS') != '32']} -DOPENSSL_NO_FILENAMES -D__MHWORDSIZE=${SITEINFO_BITS}"
 
 SWIG_FEATURES:append:riscv64 = " -D__SIZEOF_POINTER__=${SITEINFO_BITS}/8 -D__riscv_xlen=${SITEINFO_BITS}"
 SWIG_FEATURES:append:riscv32 = " -D__SIZEOF_POINTER__=${SITEINFO_BITS}/8 -D__riscv_xlen=${SITEINFO_BITS}"