diff options
author | Changqing Li <changqing.li@windriver.com> | 2020-04-23 14:39:38 +0800 |
---|---|---|
committer | Joe MacDonald <joe@deserted.net> | 2020-04-30 10:46:24 -0400 |
commit | f677a09992413f32e6b2c4c607ae44fb42de72c2 (patch) | |
tree | a24b6fe37b4b54acbf83d2f9a25ebb70c2901475 | |
parent | c014a0763af445a54ad7a23b23690583717fd311 (diff) | |
download | meta-selinux-f677a09992413f32e6b2c4c607ae44fb42de72c2.tar.gz |
libselinux-python: Fix one invalid link
when host arch and target arch are different, the extension
suffix of host is different with target one, so there will
be a invalid link. Fix by update the way to create the link.
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
-rw-r--r-- | recipes-security/selinux/libselinux-python_3.0.bb | 1 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux/0001-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch | 52 |
2 files changed, 53 insertions, 0 deletions
diff --git a/recipes-security/selinux/libselinux-python_3.0.bb b/recipes-security/selinux/libselinux-python_3.0.bb index e024a22..2b5438d 100644 --- a/recipes-security/selinux/libselinux-python_3.0.bb +++ b/recipes-security/selinux/libselinux-python_3.0.bb | |||
@@ -16,5 +16,6 @@ SRC_URI += "\ | |||
16 | file://libselinux-define-FD_CLOEXEC-as-necessary.patch \ | 16 | file://libselinux-define-FD_CLOEXEC-as-necessary.patch \ |
17 | file://0001-Fix-building-against-musl-and-uClibc-libc-libraries.patch \ | 17 | file://0001-Fix-building-against-musl-and-uClibc-libc-libraries.patch \ |
18 | file://0001-Makefile-fix-python-modules-install-path-for-multili.patch \ | 18 | file://0001-Makefile-fix-python-modules-install-path-for-multili.patch \ |
19 | file://0001-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch \ | ||
19 | " | 20 | " |
20 | S = "${WORKDIR}/libselinux-${PV}" | 21 | S = "${WORKDIR}/libselinux-${PV}" |
diff --git a/recipes-security/selinux/libselinux/0001-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch b/recipes-security/selinux/libselinux/0001-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch new file mode 100644 index 0000000..b7cd59d --- /dev/null +++ b/recipes-security/selinux/libselinux/0001-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 0d4da8093bc2ef92b7c6f7fd1f4804f6ebc6cb56 Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Petazzoni <thomas.petazzoni@bootlin.com> | ||
3 | Date: Fri, 25 Oct 2019 13:37:14 +0200 | ||
4 | Subject: [PATCH] Do not use PYCEXT, and rely on the installed file name | ||
5 | |||
6 | PYCEXT is computed by asking the Python intrepreter what is the | ||
7 | file extension used for native Python modules. | ||
8 | |||
9 | Unfortunately, when cross-compiling, the host Python doesn't give the | ||
10 | proper result: it gives the result matching the build machine, and not | ||
11 | the target machine. Due to this, the symlink has an incorrect name, | ||
12 | and doesn't point to the .so file that was actually built/installed. | ||
13 | |||
14 | To address this and keep things simple, this patch just changes the ln | ||
15 | invocation to rely on the name of the _selinux*.so Python module that | ||
16 | was installed. | ||
17 | |||
18 | [Upstream: https://github.com/SELinuxProject/selinux/pull/184] | ||
19 | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> | ||
20 | |||
21 | Upstream-Status: Denied [https://patchwork.kernel.org/patch/11212405/] | ||
22 | |||
23 | [Refreshed for 3.0] | ||
24 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
25 | --- | ||
26 | src/Makefile | 3 +-- | ||
27 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
28 | |||
29 | diff --git a/src/Makefile b/src/Makefile | ||
30 | index a384a10..82adf82 100644 | ||
31 | --- a/src/Makefile | ||
32 | +++ b/src/Makefile | ||
33 | @@ -15,7 +15,6 @@ INCLUDEDIR ?= $(PREFIX)/include | ||
34 | PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX)) | ||
35 | PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX)) | ||
36 | PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))") | ||
37 | -PYCEXT ?= $(shell $(PYTHON) -c 'import imp;print([s for s,m,t in imp.get_suffixes() if t == imp.C_EXTENSION][0])') | ||
38 | RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + " -I" + RbConfig::CONFIG["rubyhdrdir"]') | ||
39 | RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]') | ||
40 | RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]') | ||
41 | @@ -175,7 +174,7 @@ install: all | ||
42 | install-pywrap: pywrap | ||
43 | $(PYTHON) setup.py install --prefix=$(PREFIX) --root=$(DESTDIR) --install-lib=$(PYTHONLIBDIR) | ||
44 | install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py | ||
45 | - ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT) | ||
46 | + ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux*.so $(DESTDIR)$(PYTHONLIBDIR)/ | ||
47 | |||
48 | install-rubywrap: rubywrap | ||
49 | test -d $(DESTDIR)$(RUBYINSTALL) || install -m 755 -d $(DESTDIR)$(RUBYINSTALL) | ||
50 | -- | ||
51 | 2.24.1 | ||
52 | |||