I've checked with the upstream of python3-m2crypto, and there's already an 
issue reported regarding this problem.
I'll wait for the fix to be implemented before resubmitting the upgrade patch 
for python3-m2crypto.

 --
Best Regards
---------------------------------------------------
Wang Mingyu
FUJITSU NANJING SOFTWARE TECHNOLOGY CO., LTD. (FNST)
No.6 Wenzhu Road, Nanjing, 210012, China
TEL:+86+25-86630566--8568
COINS: 79988548
FAX: +86+25-83317685
MAIL: [email protected]<mailto:[email protected]>

From: Khem Raj <[email protected]>
Sent: Monday, March 2, 2026 11:31 PM
To: Wang, Mingyu/王 鸣瑜 <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-python] [PATCH v2] python3-m2crypto: upgrade 0.46.2 -> 
0.47.0

fails to build now using clang

| INFO:mkpath:creating build/temp.linux-aarch64-cpython-314/src/SWIG
| INFO:spawn:aarch64-yoe-linux-clang -mcpu=cortex-a57+crc --dyld-prefix=/usr 
-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security 
-Werror=format-security -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 
-Wformat -Wformat-security -Werror=format-security 
--sysroot=/srv/build/yoe/build/tmp/work/cortexa57-yoe-linux/python3-m2crypto/0.47.0/recipe-sysroot
 -O2 -g 
-ffile-prefix-map=/srv/build/yoe/build/tmp/work/cortexa57-yoe-linux/python3-m2crypto/0.47.0/sources/m2crypto-0.47.0=/usr/src/debug/python3-m2crypto/0.47.0
 
-ffile-prefix-map=/srv/build/yoe/build/tmp/work/cortexa57-yoe-linux/python3-m2crypto/0.47.0/sources/m2crypto-0.47.0=/usr/src/debug/python3-m2crypto/0.47.0
 
-ffile-prefix-map=/srv/build/yoe/build/tmp/work/cortexa57-yoe-linux/python3-m2crypto/0.47.0/recipe-sysroot=
 
-ffile-prefix-map=/srv/build/yoe/build/tmp/work/cortexa57-yoe-linux/python3-m2crypto/0.47.0/recipe-sysroot-native=
 -pipe -fPIC 
-I/srv/build/yoe/build/tmp/work/cortexa57-yoe-linux/python3-m2crypto/0.47.0/recipe-sysroot/usr/include/python3.14
 
-I/srv/build/yoe/build/tmp/work/cortexa57-yoe-linux/python3-m2crypto/0.47.0/sources/m2crypto-0.47.0/src/SWIG
 -c src/SWIG/_m2crypto_wrap.c -o 
build/temp.linux-aarch64-cpython-314/src/SWIG/_m2crypto_wrap.o -DTHREADING 
-Wno-deprecated-declarations
| src/SWIG/_m2crypto_wrap.c:4455:1: error: unknown type name 
'PRAGMA_IGNORE_UNUSED_LABEL'
|  4455 | PRAGMA_IGNORE_UNUSED_LABEL
|       | ^
| src/SWIG/_m2crypto_wrap.c:4456:30: error: expected ';' after top level 
declarator
|  4456 | PRAGMA_WARN_STRICT_PROTOTYPES
|       |                              ^
|       |                              ;
| 2 errors generated.

On Sun, Mar 1, 2026 at 9:57 PM wangmy via 
lists.openembedded.org<http://lists.openembedded.org> 
<[email protected]<mailto:[email protected]>>
 wrote:
From: Wang Mingyu <[email protected]<mailto:[email protected]>>

0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch
0002-fix-correct-struct-packing-on-32-bit-with-_TIME_BITS.patch
removed since they're included in 0.47.0

Signed-off-by: Wang Mingyu <[email protected]<mailto:[email protected]>>
---
 ...-time_t-on-32-bit-systems-in-test_is.patch | 40 -----------
 ...ct-packing-on-32-bit-with-_TIME_BITS.patch | 72 -------------------
 ...o_0.46.2.bb<http://o_0.46.2.bb> => 
python3-m2crypto_0.47.0.bb<http://python3-m2crypto_0.47.0.bb>} |  8 +--
 3 files changed, 2 insertions(+), 118 deletions(-)
 delete mode 100644 
meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch
 delete mode 100644 
meta-python/recipes-devtools/python/python3-m2crypto/0002-fix-correct-struct-packing-on-32-bit-with-_TIME_BITS.patch
 rename 
meta-python/recipes-devtools/python/{python3-m2crypto_0.46.2.bb<http://python3-m2crypto_0.46.2.bb>
 => python3-m2crypto_0.47.0.bb<http://python3-m2crypto_0.47.0.bb>} (84%)

diff --git 
a/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch
 
b/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch
deleted file mode 100644
index d49950074f..0000000000
--- 
a/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From d123b4ddce99c44f2c290fb3d6cc887de98778e6 Mon Sep 17 00:00:00 2001
-From: Haixiao Yan 
<[email protected]<mailto:[email protected]>>
-Date: Wed, 22 Oct 2025 15:23:56 +0800
-Subject: [PATCH 1/2] fix: allow 64-bit time_t on 32-bit systems in
- test_is32bit
-
-Some modern 32-bit Linux systems (e.g. with glibc >= 2.34 or musl time64 ABI)
-use 64-bit time_t by default when _TIME_BITS=64 is enabled. The original test
-assumed time_t was always 32-bit on 32-bit architectures, which is no longer
-true.
-
-Relax the check to accept both 32-bit and 64-bit time_t values:
-
-    self.assertIn(bit32, (32, 64))
-
-This makes the test compatible with both legacy and time64 ABIs.
-
-Upstream-Status: Backport 
[https://gitlab.com/m2crypto/m2crypto/-/commit/818c3dfda6ea]
-
-Signed-off-by: Haixiao Yan 
<[email protected]<mailto:[email protected]>>
----
- tests/test_util.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tests/test_util.py b/tests/test_util.py
-index e925d03b090c..233fb7a099d9 100644
---- a/tests/test_util.py
-+++ b/tests/test_util.py
-@@ -26,7 +26,7 @@ class UtilTestCase(unittest.TestCase):
-                 not in ["true", "1", "yes"]
-             )
-         ):
--            self.assertEqual(bit32, 32)
-+            self.assertIn(bit32, (32, 64))
-         else:
-             self.assertNotEqual(bit32, 32)
-         self.assertIsInstance(bit32, int)
---
-2.34.1
-
diff --git 
a/meta-python/recipes-devtools/python/python3-m2crypto/0002-fix-correct-struct-packing-on-32-bit-with-_TIME_BITS.patch
 
b/meta-python/recipes-devtools/python/python3-m2crypto/0002-fix-correct-struct-packing-on-32-bit-with-_TIME_BITS.patch
deleted file mode 100644
index c36afa5cc0..0000000000
--- 
a/meta-python/recipes-devtools/python/python3-m2crypto/0002-fix-correct-struct-packing-on-32-bit-with-_TIME_BITS.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From b5dbfca23986429853ccb15a38cc526d9df0dd40 Mon Sep 17 00:00:00 2001
-From: Haixiao Yan 
<[email protected]<mailto:[email protected]>>
-Date: Wed, 22 Oct 2025 15:23:57 +0800
-Subject: [PATCH 2/2] fix: correct struct packing on 32-bit with _TIME_BITS=64
-
-On 32-bit platforms with glibc time64 ABI, time_t is 64-bit wide while
-`long` remains 32-bit. This causes struct timeval to use two 64-bit fields
-(tv_sec, tv_usec). The previous code incorrectly packed timeout as "ll",
-leading to EINVAL in setsockopt(SO_RCVTIMEO).
-
-Use "qq" instead when m2.time_t_bits() == 64 to match the actual ABI.
-
-Fixes: https://todo.sr.ht/~mcepl/m2crypto/374
-
-Upstream-Status: Backport 
[https://gitlab.com/m2crypto/m2crypto/-/commit/473de659f78e]
-
-Signed-off-by: Haixiao Yan 
<[email protected]<mailto:[email protected]>>
----
- src/M2Crypto/SSL/timeout.py | 24 ++++++++++++++++++++----
- 1 file changed, 20 insertions(+), 4 deletions(-)
-
-diff --git a/src/M2Crypto/SSL/timeout.py b/src/M2Crypto/SSL/timeout.py
-index b45f38b1cbdb..5ba52283b6f8 100644
---- a/src/M2Crypto/SSL/timeout.py
-+++ b/src/M2Crypto/SSL/timeout.py
-@@ -33,10 +33,14 @@ class timeout(object):
-             millisec = int(self.sec * 1000 + round(float(self.microsec) / 
1000))
-             binstr = struct.pack("l", millisec)
-         else:
--            if m2.time_t_bits() == 32:
-+            bits = m2.time_t_bits()
-+            if bits == 32:
-                 binstr = struct.pack("ii", self.sec, self.microsec)
-+            elif bits == 64:
-+                # handle both 64-bit and 32-bit+TIME_BITS=64
-+                binstr = struct.pack("qq", self.sec, self.microsec)
-             else:
--                binstr = struct.pack("ll", self.sec, self.microsec)
-+                raise ValueError(f"Unsupported time_t_bits: {bits}")
-         return binstr
-
-
-@@ -48,7 +52,13 @@ def struct_to_timeout(binstr: bytes) -> timeout:
-         sec = int(millisec / 1000)
-         microsec = (millisec % 1000) * 1000
-     else:
--        (sec, microsec) = struct.unpack("ll", binstr)
-+        bits = m2.time_t_bits()
-+        if bits == 32:
-+            (sec, microsec) = struct.unpack("ii", binstr)
-+        elif bits == 64:
-+            (sec, microsec) = struct.unpack("qq", binstr)
-+        else:
-+            raise ValueError(f"Unsupported time_t_bits: {bits}")
-     return timeout(sec, microsec)
-
-
-@@ -56,4 +66,10 @@ def struct_size() -> int:
-     if sys.platform == "win32":
-         return struct.calcsize("l")
-     else:
--        return struct.calcsize("ll")
-+        bits = m2.time_t_bits()
-+        if bits == 32:
-+            return struct.calcsize("ii")
-+        elif bits == 64:
-+            return struct.calcsize("qq")
-+        else:
-+            raise ValueError(f"Unsupported time_t_bits: {bits}")
---
-2.34.1
-
diff --git 
a/meta-python/recipes-devtools/python/python3-m2crypto_0.46.2.bb<http://python3-m2crypto_0.46.2.bb>
 
b/meta-python/recipes-devtools/python/python3-m2crypto_0.47.0.bb<http://python3-m2crypto_0.47.0.bb>
similarity index 84%
rename from 
meta-python/recipes-devtools/python/python3-m2crypto_0.46.2.bb<http://python3-m2crypto_0.46.2.bb>
rename to 
meta-python/recipes-devtools/python/python3-m2crypto_0.47.0.bb<http://python3-m2crypto_0.47.0.bb>
index abe79671d2..ba7bd9b8e3 100644
--- 
a/meta-python/recipes-devtools/python/python3-m2crypto_0.46.2.bb<http://python3-m2crypto_0.46.2.bb>
+++ 
b/meta-python/recipes-devtools/python/python3-m2crypto_0.47.0.bb<http://python3-m2crypto_0.47.0.bb>
@@ -4,13 +4,9 @@ HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto";
 LICENSE = "BSD-2-Clause"
 LIC_FILES_CHKSUM = 
"file://LICENSES/BSD-2-Clause.txt;md5=8099b0e569f862ece05740aef06c82a2"

-SRC_URI[sha256sum] = 
"13c2fa89562f7b8af40cc74b55f490be5e2ab8ccfb739f11c16d3ce6221a61ba"
+SRC_URI[sha256sum] = 
"9256300be1e0412be802aa1f827e0ce7f94deb1099b8ccdcfd9867a7f0f975bf"

-SRC_URI += " \
-          file://0001-setup.py-Make-the-cmd-available.patch \
-          
file://0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch \
-          
file://0002-fix-correct-struct-packing-on-32-bit-with-_TIME_BITS.patch \
-"
+SRC_URI += "file://0001-setup.py-Make-the-cmd-available.patch"

 CVE_STATUS[CVE-2009-0127] = "disputed: upstream claims there is no bug"
 CVE_STATUS[CVE-2020-25657] = "fixed-version: the used version (0.46.2) 
contains the fix already"
--
2.43.0



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

Reply via email to