From 5e3a5dca196637f0792aabb05ae011fa4901901c Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Thu, 10 Feb 2022 09:47:25 +0900 Subject: [PATCH] python: Do not assume GNU Binutils and assume Clang/LLVM toolchain instead. --- packages/python/Lib-ctypes-util.py.patch | 29 ++++++++++++++++++++++++ packages/python/build.sh | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 packages/python/Lib-ctypes-util.py.patch diff --git a/packages/python/Lib-ctypes-util.py.patch b/packages/python/Lib-ctypes-util.py.patch new file mode 100644 index 000000000..9229e35c7 --- /dev/null +++ b/packages/python/Lib-ctypes-util.py.patch @@ -0,0 +1,29 @@ +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -172,7 +172,7 @@ + # assuming GNU binutils / ELF + if not f: + return None +- objdump = shutil.which('objdump') ++ objdump = shutil.which('llvm-objdump') + if not objdump: + # objdump is not available, give up + return None +@@ -209,7 +209,7 @@ + expr = os.fsencode(expr) + + try: +- proc = subprocess.Popen(('/sbin/ldconfig', '-r'), ++ proc = subprocess.Popen(('@TERMUX_PREFIX@/bin/ldconfig', '-r'), + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL) + except OSError: # E.g. command not found +@@ -300,7 +300,7 @@ + def _findLib_ld(name): + # See issue #9998 for why this is needed + expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) +- cmd = ['ld', '-t'] ++ cmd = ['ld.lld', '-t'] + libpath = os.environ.get('LD_LIBRARY_PATH') + if libpath: + for d in libpath.split(':'): diff --git a/packages/python/build.sh b/packages/python/build.sh index 36024509e..90a55205e 100644 --- a/packages/python/build.sh +++ b/packages/python/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="PythonPL" TERMUX_PKG_MAINTAINER="@termux" _MAJOR_VERSION=3.10 TERMUX_PKG_VERSION=${_MAJOR_VERSION}.2 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://www.python.org/ftp/python/${TERMUX_PKG_VERSION}/Python-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=17de3ac7da9f2519aa9d64378c603a73a0e9ad58dffa8812e45160c086de64c7 TERMUX_PKG_DEPENDS="gdbm, libandroid-posix-semaphore, libandroid-support, libbz2, libcrypt, libexpat, libffi, liblzma, libsqlite, ncurses, ncurses-ui-libs, openssl, readline, zlib"