summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-m2crypto
diff options
context:
space:
mode:
authorWang Mingyu <wangmy@fujitsu.com>2026-03-18 11:04:45 +0800
committerKhem Raj <raj.khem@gmail.com>2026-03-18 14:33:33 -0700
commit62b17d28060e63e8fb6992b8c75a98bc2f7a376c (patch)
tree6038520551991c59c418617011279bb0f2639205 /meta-python/recipes-devtools/python/python3-m2crypto
parent01d347f0bc40fd4038fbd09c0e0051c2c280e20b (diff)
downloadmeta-openembedded-62b17d28060e63e8fb6992b8c75a98bc2f7a376c.tar.gz
python3-m2crypto: fix do_compile error using clang
erre message: | 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. Add patch 0001-fix-swig-avoid-clang-GNUC-pragma-block-before-_lib.h.patch to avoid clang GNUC pragma block before _lib.h Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-m2crypto')
-rw-r--r--meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-swig-avoid-clang-GNUC-pragma-block-before-_lib.h.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-swig-avoid-clang-GNUC-pragma-block-before-_lib.h.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-swig-avoid-clang-GNUC-pragma-block-before-_lib.h.patch
new file mode 100644
index 0000000000..7aa768f44d
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-swig-avoid-clang-GNUC-pragma-block-before-_lib.h.patch
@@ -0,0 +1,49 @@
1From df210da932c2cab9d3a80ee88c70611d77824a15 Mon Sep 17 00:00:00 2001
2From: Wang Mingyu <wangmy@fujitsu.com>
3Date: Wed, 18 Mar 2026 02:26:56 +0000
4Subject: [PATCH] fix(swig): avoid clang GNUC pragma block before _lib.h
5
6Clang defines __GNUC__, so the old guard emitted PRAGMA_* tokens before
7they were defined, breaking builds on macOS/clang; move the block after
8<_lib.h> and exclude clang while keeping the GCC<5 workaround.
9
10Fixes: https://todo.sr.ht/~mcepl/m2crypto/392
11
12Upstream-Status: Backport [git.sr.ht/~mcepl/m2crypto/commit/504ca8f438afb0f5041d2b5163e5f666a9a1b742.patch]
13
14Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
15---
16 src/SWIG/_m2crypto.i | 13 ++++++++-----
17 1 file changed, 8 insertions(+), 5 deletions(-)
18
19diff --git a/src/SWIG/_m2crypto.i b/src/SWIG/_m2crypto.i
20index d89d355..5426446 100644
21--- a/src/SWIG/_m2crypto.i
22+++ b/src/SWIG/_m2crypto.i
23@@ -43,15 +43,18 @@ typedef unsigned __int64 uint64_t;
24 %}
25
26 %{
27-#if defined __GNUC__ && __GNUC__ < 5
28-PRAGMA_IGNORE_UNUSED_LABEL
29-PRAGMA_WARN_STRICT_PROTOTYPES
30-#endif
31-
32 #include <openssl/err.h>
33 #include <openssl/rand.h>
34 #include <_lib.h>
35
36+/* _lib.h defines PRAGMA_* helpers; only needed for old GCC (clang defines
37+ * __GNUC__ too, but doesn't need this workaround).
38+ */
39+#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 5)
40+PRAGMA_IGNORE_UNUSED_LABEL
41+PRAGMA_WARN_STRICT_PROTOTYPES
42+#endif
43+
44 #include "compile.h"
45
46 static PyObject *ssl_verify_cb_func;
47--
482.43.0
49