diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2021-11-25 10:44:46 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-11-25 10:14:18 -0800 |
commit | 38864f10fa898b96174e98a6abb72bff77f52e2a (patch) | |
tree | e7bb78851de3411ca6f9d99be527d9fd67eb52b9 | |
parent | 301e8045d2472fb93040c0dc0a44e534a08b182e (diff) | |
download | meta-openembedded-38864f10fa898b96174e98a6abb72bff77f52e2a.tar.gz |
libtevent: fix pyext_PATTERN for cross compilation
The pyext_PATTERN will add native arch as suffix when cross compiling.
For example, on qemuarm64, it is expanded to:
pyext_PATTERN ='%s.cpython-310-x86_64-linux-gnu.so'
which will result in the incorrect library name.
root@qemuarm64:~# find /usr/lib/python3.10/ -name \*tevent\*.so
/usr/lib/python3.10/site-packages/_tevent.cpython-310-x86_64-linux-gnu.so
/usr/lib/python3.10/site-packages/_tevent.so
Set pyext_PATTERN to '%s.so' to remove the suffix.
After the patch:
root@qemuarm64:~# find /usr/lib/python3.10/ -name \*tevent\*.so
/usr/lib/python3.10/site-packages/_tevent.so
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-networking/recipes-support/libtevent/libtevent/0001-Fix-pyext_PATTERN-for-cross-compilation.patch | 42 | ||||
-rw-r--r-- | meta-networking/recipes-support/libtevent/libtevent_0.10.2.bb | 6 |
2 files changed, 43 insertions, 5 deletions
diff --git a/meta-networking/recipes-support/libtevent/libtevent/0001-Fix-pyext_PATTERN-for-cross-compilation.patch b/meta-networking/recipes-support/libtevent/libtevent/0001-Fix-pyext_PATTERN-for-cross-compilation.patch new file mode 100644 index 000000000..81abac83a --- /dev/null +++ b/meta-networking/recipes-support/libtevent/libtevent/0001-Fix-pyext_PATTERN-for-cross-compilation.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 96ddbe6653f87670e4a0bbff229276bbe0aa822a Mon Sep 17 00:00:00 2001 | ||
2 | From: Yi Zhao <yi.zhao@windriver.com> | ||
3 | Date: Wed, 24 Nov 2021 13:33:35 +0800 | ||
4 | Subject: [PATCH] Fix pyext_PATTERN for cross compilation | ||
5 | |||
6 | The pyext_PATTERN will add native arch as suffix when cross compiling. | ||
7 | For example, on qemuarm64, it is expanded to: | ||
8 | pyext_PATTERN ='%s.cpython-310-x86_64-linux-gnu.so' | ||
9 | which will result in the incorrect library name. | ||
10 | |||
11 | root@qemuarm64:~# find /usr/lib/python3.10/ -name \*tevent\*.so | ||
12 | /usr/lib/python3.10/site-packages/_tevent.cpython-310-x86_64-linux-gnu.so | ||
13 | /usr/lib/python3.10/site-packages/_tevent.so | ||
14 | |||
15 | Set pyext_PATTERN to '%s.so' to remove the suffix. | ||
16 | After the patch: | ||
17 | root@qemuarm64:~# find /usr/lib/python3.10/ -name \*tevent\*.so | ||
18 | /usr/lib/python3.10/site-packages/_tevent.so | ||
19 | |||
20 | Upstream-Status: Inappropriate [embedded specific] | ||
21 | |||
22 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
23 | --- | ||
24 | third_party/waf/waflib/Tools/python.py | 2 +- | ||
25 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py | ||
28 | index 7c45a76..c9a90f7 100644 | ||
29 | --- a/third_party/waf/waflib/Tools/python.py | ||
30 | +++ b/third_party/waf/waflib/Tools/python.py | ||
31 | @@ -328,7 +328,7 @@ def check_python_headers(conf, features='pyembed pyext'): | ||
32 | x = 'MACOSX_DEPLOYMENT_TARGET' | ||
33 | if dct[x]: | ||
34 | env[x] = conf.environ[x] = dct[x] | ||
35 | - env.pyext_PATTERN = '%s' + dct['SO'] # not a mistake | ||
36 | + env.pyext_PATTERN = '%s.so' | ||
37 | |||
38 | |||
39 | # Try to get pythonX.Y-config | ||
40 | -- | ||
41 | 2.17.1 | ||
42 | |||
diff --git a/meta-networking/recipes-support/libtevent/libtevent_0.10.2.bb b/meta-networking/recipes-support/libtevent/libtevent_0.10.2.bb index 5d7e1a0d6..78c092095 100644 --- a/meta-networking/recipes-support/libtevent/libtevent_0.10.2.bb +++ b/meta-networking/recipes-support/libtevent/libtevent_0.10.2.bb | |||
@@ -9,6 +9,7 @@ RDEPENDS:python3-tevent = "python3" | |||
9 | SRC_URI = "https://samba.org/ftp/tevent/tevent-${PV}.tar.gz \ | 9 | SRC_URI = "https://samba.org/ftp/tevent/tevent-${PV}.tar.gz \ |
10 | file://options-0.10.0.patch \ | 10 | file://options-0.10.0.patch \ |
11 | file://0001-libtevent-fix-musl-libc-compile-error.patch \ | 11 | file://0001-libtevent-fix-musl-libc-compile-error.patch \ |
12 | file://0001-Fix-pyext_PATTERN-for-cross-compilation.patch \ | ||
12 | " | 13 | " |
13 | LIC_FILES_CHKSUM = "file://tevent.h;endline=26;md5=4e458d658cb25e21efc16f720e78b85a" | 14 | LIC_FILES_CHKSUM = "file://tevent.h;endline=26;md5=4e458d658cb25e21efc16f720e78b85a" |
14 | 15 | ||
@@ -42,11 +43,6 @@ EXTRA_OECONF += "--disable-rpath \ | |||
42 | --with-libiconv=${STAGING_DIR_HOST}${prefix}\ | 43 | --with-libiconv=${STAGING_DIR_HOST}${prefix}\ |
43 | --without-gettext \ | 44 | --without-gettext \ |
44 | " | 45 | " |
45 | do_install:append() { | ||
46 | # add this link for cross check python module existence. eg: on x86-64 host, check python module | ||
47 | # under recipe-sysroot which is mips64. | ||
48 | cd ${D}${PYTHON_SITEPACKAGES_DIR}; ln -s _tevent.*.so _tevent.so | ||
49 | } | ||
50 | 46 | ||
51 | PACKAGES += "python3-tevent" | 47 | PACKAGES += "python3-tevent" |
52 | 48 | ||