python3: Fix building C extensions with setuptools
authorJeffery To <jeffery.to@gmail.com>
Mon, 30 Oct 2023 15:56:43 +0000 (23:56 +0800)
committerTianling Shen <cnsztl@gmail.com>
Wed, 1 Nov 2023 16:40:44 +0000 (00:40 +0800)
commitf218d96e14eafc6bd323d871a56a94b4b5e8c68b
tree34e27b5ad36a82efb6e2f2343acd6a92067017f5
parent9668b0dc21cc15318bc41b6b056c77f95a8a8751
python3: Fix building C extensions with setuptools

setuptools provides a local copy of distutils and when building a C
extension, this distutils will add the target LIBDIR (/usr/lib) to the
list of library paths.

If the build system has a libpython3.11.so in /usr/lib, then the linker
will try to link to this shared library and fail.

This adapts 008-distutils-use-python-sysroot.patch for host setuptools
to add the correct library directory.

Fixes: https://github.com/openwrt/packages/issues/22330
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 624fb955619c0b4b368e2ac1880619f159e3b8d6)
lang/python/python3-version.mk
lang/python/python3/patches-host-setuptools/0001-Adjust-library-header-paths-for-cross-compilation.patch [new file with mode: 0644]