diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2024-12-10 21:12:54 +0800 |
---|---|---|
committer | Joe MacDonald <joe.macdonald@siemens.com> | 2024-12-10 12:39:38 -0500 |
commit | c3527f5859779610b373be3f964f7c32de39a3e0 (patch) | |
tree | 81c6ca10eff4b08a1bd9c12ee49aed2a8f222533 | |
parent | 51bfd7c35a1dfaeef31a1de276061b9638f6a444 (diff) | |
download | meta-selinux-c3527f5859779610b373be3f964f7c32de39a3e0.tar.gz |
libselinux-python: fix build with swig 4.3
Backport a patch to fix build with swig 4.3[1].
[1] https://github.com/SELinuxProject/selinux/issues/447
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe.macdonald@siemens.com>
-rw-r--r-- | recipes-security/selinux/libselinux-python_3.7.bb | 1 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch | 91 |
2 files changed, 92 insertions, 0 deletions
diff --git a/recipes-security/selinux/libselinux-python_3.7.bb b/recipes-security/selinux/libselinux-python_3.7.bb index 3c5c489..5099e55 100644 --- a/recipes-security/selinux/libselinux-python_3.7.bb +++ b/recipes-security/selinux/libselinux-python_3.7.bb | |||
@@ -15,6 +15,7 @@ SRC_URI += "\ | |||
15 | file://0001-Makefile-fix-python-modules-install-path-for-multili.patch \ | 15 | file://0001-Makefile-fix-python-modules-install-path-for-multili.patch \ |
16 | file://0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch \ | 16 | file://0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch \ |
17 | file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \ | 17 | file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \ |
18 | file://0001-libselinux-fix-swig-bindings-for-4.3.0.patch \ | ||
18 | " | 19 | " |
19 | 20 | ||
20 | S = "${WORKDIR}/git/libselinux" | 21 | S = "${WORKDIR}/git/libselinux" |
diff --git a/recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch b/recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch new file mode 100644 index 0000000..277c36c --- /dev/null +++ b/recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch | |||
@@ -0,0 +1,91 @@ | |||
1 | From 8e0e718bae53fff30831b92cd784151d475a20da Mon Sep 17 00:00:00 2001 | ||
2 | From: Petr Lautrbach <lautrbach@redhat.com> | ||
3 | Date: Wed, 16 Oct 2024 20:48:11 +0200 | ||
4 | Subject: [PATCH] libselinux: fix swig bindings for 4.3.0 | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | https://github.com/swig/swig/blob/master/CHANGES.current | ||
10 | |||
11 | "[Python] #2907 Fix returning null from functions with output | ||
12 | parameters. Ensures OUTPUT and INOUT typemaps are handled | ||
13 | consistently wrt return type. | ||
14 | |||
15 | New declaration of SWIG_Python_AppendOutput is now: | ||
16 | |||
17 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void); | ||
18 | |||
19 | The 3rd parameter is new and the new $isvoid special variable | ||
20 | should be passed to it, indicating whether or not the wrapped | ||
21 | function returns void. | ||
22 | |||
23 | Also consider replacing with: | ||
24 | |||
25 | SWIG_AppendOutput(PyObject* result, PyObject* obj); | ||
26 | |||
27 | which calls SWIG_Python_AppendOutput with same parameters but adding $isvoid | ||
28 | for final parameter." | ||
29 | |||
30 | Fixes: https://github.com/SELinuxProject/selinux/issues/447 | ||
31 | |||
32 | selinuxswig_python_wrap.c: In function ‘_wrap_security_compute_user’: | ||
33 | selinuxswig_python_wrap.c:11499:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ | ||
34 | 11499 | resultobj = SWIG_Python_AppendOutput(resultobj, plist); | ||
35 | | ^~~~~~~~~~~~~~~~~~~~~~~~ | ||
36 | selinuxswig_python_wrap.c:1248:1: note: declared here | ||
37 | 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void) { | ||
38 | | ^~~~~~~~~~~~~~~~~~~~~~~~ | ||
39 | selinuxswig_python_wrap.c: In function ‘_wrap_security_compute_user_raw’: | ||
40 | selinuxswig_python_wrap.c:11570:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ | ||
41 | 11570 | resultobj = SWIG_Python_AppendOutput(resultobj, plist); | ||
42 | | ^~~~~~~~~~~~~~~~~~~~~~~~ | ||
43 | selinuxswig_python_wrap.c:1248:1: note: declared here | ||
44 | 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void) { | ||
45 | | ^~~~~~~~~~~~~~~~~~~~~~~~ | ||
46 | selinuxswig_python_wrap.c: In function ‘_wrap_security_get_boolean_names’: | ||
47 | selinuxswig_python_wrap.c:12470:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ | ||
48 | 12470 | resultobj = SWIG_Python_AppendOutput(resultobj, list); | ||
49 | | ^~~~~~~~~~~~~~~~~~~~~~~~ | ||
50 | selinuxswig_python_wrap.c:1248:1: note: declared here | ||
51 | 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void) { | ||
52 | | ^~~~~~~~~~~~~~~~~~~~~~~~ | ||
53 | error: command '/usr/bin/gcc' failed with exit code 1 | ||
54 | |||
55 | Suggested-by: Jitka Plesnikova <jplesnik@redhat.com> | ||
56 | Signed-off-by: Petr Lautrbach <lautrbach@redhat.com> | ||
57 | Acked-by: James Carter <jwcart2@gmail.com> | ||
58 | |||
59 | Upstream-Status: Backport | ||
60 | [https://github.com/SELinuxProject/selinux/commit/8e0e718bae53fff30831b92cd784151d475a20da] | ||
61 | |||
62 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
63 | --- | ||
64 | src/selinuxswig_python.i | 4 ++-- | ||
65 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
66 | |||
67 | diff --git a/src/selinuxswig_python.i b/src/selinuxswig_python.i | ||
68 | index 17e03b9e..03ed296d 100644 | ||
69 | --- a/src/selinuxswig_python.i | ||
70 | +++ b/src/selinuxswig_python.i | ||
71 | @@ -71,7 +71,7 @@ def install(src, dest): | ||
72 | for (i = 0; i < *$2; i++) { | ||
73 | PyList_SetItem(list, i, PyString_FromString((*$1)[i])); | ||
74 | } | ||
75 | - $result = SWIG_Python_AppendOutput($result, list); | ||
76 | + $result = SWIG_AppendOutput($result, list); | ||
77 | } | ||
78 | |||
79 | /* return a sid along with the result */ | ||
80 | @@ -108,7 +108,7 @@ def install(src, dest): | ||
81 | plist = PyList_New(0); | ||
82 | } | ||
83 | |||
84 | - $result = SWIG_Python_AppendOutput($result, plist); | ||
85 | + $result = SWIG_AppendOutput($result, plist); | ||
86 | } | ||
87 | |||
88 | /* Makes functions in get_context_list.h return a Python list of contexts */ | ||
89 | -- | ||
90 | 2.25.1 | ||
91 | |||