编译Python 3.6.5 arm32的静态二进制文件失败

时间:2018-05-19 23:51:07

标签: android python linux compilation

我在Debian 9.4 x64上尝试为arm32编译静态Python二进制文件。 我最初是:

  • 下载了" Gzipped源码tarball"源文件来自: https://www.python.org/downloads/release/python-365/
  • 在/python3.6.5 /
  • 中提取源文件
  • 下载并解压" binutils-gold-2.29.1-16.1.armv7hl.rpm"按cmd行:
    • rpm -qlp /python3.6.5/binutils-gold-2.29.1-16.1.armv7hl.rpm
  • 尝试使用以下命令编译二进制文件:
    • ./configure --build=arm --prefix="$PWD"/out LDFLAGS="-static -static-libgcc -Wl,--unresolved-symbols=ignore-all -Wl,--export-dynamic" CPPFLAGS=-static CXXFLAGS=-static CFLAGS="-Os -static" LDFLAGS=-static LD=ld.gold
  • 我得到这个错误:
    • /usr/bin/ld: BFD assertion (GNU Binutils for Debian) 2.28 as failed ../../bfd/elflink.c:14098
    • /usr/bin/ld: BFD (GNU Binutils for Debian) 2.28 internal error, aborting at ../../bfd/elf64-x86-64.c:6137 in elf_x86_64_finish_dynamic_symbol
    • /usr/bin/ld: Thanks to report this anomaly.
    • collect2: error: ld returned 1 exit status
    • Makefile:561 : the recipe for the "python" target has failed - make: *** [python] Error 1
  • 我试图找到如何解决这个错误,但不幸的是,Python网站上的支持网页并没有帮助(https://wiki.python.org/moin/BuildStatically)。

最后,我想为Android可以运行的所有处理器平台(arm32,aarm64,x86_x64,mips,mipsx64,...)编译Python 3.6.5,以最终获得单个二进制文件(当我完成arm32时,我将为所有其他拱门重复任务。

所引用的每个架构都有一个文件,而不是多个文件/文件夹。 以静态方式避免与外部库的任何依赖。 我选择进行构建操作,但如果存在其他危险性更小且更简单的解决方案,我就是接受者。

注意:默认情况下,所有cmd行都是通过LXTerminal在root会话中完成的。

感谢您提前寻求帮助。

0 个答案:

没有答案
相关问题