交叉编译需要依赖于体系结构的库和头文件。在
当测试python3.5-dev包和其他包是否可以安装在dpkg add-architecture armhf和{}(在对来源.列表),结果基本上是。在python3.5-dev:armhf : Depends: python3.5:armhf (= 3.5.1-10) but it is not going to be installed
apt-get install python3.5:armhf是不起作用的,seeThe existing proposals allow for the co-installation of libraries and
headers for different architectures, but not (yet) binaries.
QEMU和chroot提供了一种不需要“完整”虚拟机的解决方案。可以通过debootstrap命令为chroot创建一个合适的目录。{cd5>创建后可以访问环境。在
在以下命令中替换和:
^{pr2}$
环境应通过schroot -c chroot:xenial-armhf
对于根用户会话(用户必须位于根组中列出的组中)schroot -c chroot:xenial-armhf -u root
在此之后,还可以交叉编译cython模块:
在你好.pyx公司名称:print("hello world")
编译(python3.5-config cflags和{}在chroot中用于选项,请注意-fPIC):cython hello.pyx
arm-linux-gnueabihf-gcc sysroot -I/usr/include/python3.5m -I/usr/include/python3.5m -Wno-unused-