我发现在我的Ubuntu 19.04 64位机器上安装交叉编译器时出了问题。我想将Python代码交叉编译为可执行文件,以便在运行Debian Stretch的树莓派3型B+上使用。我遵循了许多指南,但没有一个有效。实际上,我正在按照https://github.com/Yadoms/yadoms/wiki/Cross-compile-for-raspberry-PI的步骤进行操作。
我遵循了上述指南的步骤: - 设置环境 - 安装交叉编译器 - Boost 1.64 - Python
在最后一部分(Python)中,它无法执行最后一条指令。
然后:
我需要使用 Python3 实现我的目的。
我在这个问题上遇到了困难,有人可以提供一些想法吗?我尝试过 QEMU 和 Docker (https://raspberrypi.stackexchange.com/questions/109488/building-a-virtual-machine-with-the-img-file-of-the-raspberry-pi-stretch),但都无法编译我的目标代码:
我遵循了上述指南的步骤: - 设置环境 - 安装交叉编译器 - Boost 1.64 - Python
在最后一部分(Python)中,它无法执行最后一条指令。
$ CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ AR=arm-linux-gnueabihf-ar RANLIB=arm-linux-gnueabihf-ranlib ./configure --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf --build=x86_64-linux-gnu --prefix=$HOME/Desktop/rapsberry/depsBuild/python --disable-ipv6 ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_have_long_long_format=yes --enable-shared
输出:
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabihf
checking for python3.7... python3.7
checking for python interpreter for cross build... python3.7
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for arm-linux-gnueabihf-gcc... arm-linux-gnueabihf-gcc
checking whether the C compiler works... no
configure: error: in `/home/slr/Desktop/raspberry/boost_1_64_0/Python-3.7.5':
configure: error: C compiler cannot create executables
See `config.log' for more details
然后:
$ make HOSTPYTHON=$HOME/Desktop/raspberry/depsBuild/pythonhost/python HOSTPGEN=$HOME/Desktop/raspberry/depsBuild/pythonhost/Parser/pgen BLDSHARED="arm-linux-gnueabihf-gcc -shared" CROSS-COMPILE=arm-linux-gnueabihf- CROSS_COMPILE_TARGET=yes HOSTARCH=arm-linux BUILDARCH=arm-linux-gnueabihf
输出:
make: *** No targets specified and no makefile found. Stop.
我需要使用 Python3 实现我的目的。
我在这个问题上遇到了困难,有人可以提供一些想法吗?我尝试过 QEMU 和 Docker (https://raspberrypi.stackexchange.com/questions/109488/building-a-virtual-machine-with-the-img-file-of-the-raspberry-pi-stretch),但都无法编译我的目标代码:
gcc: 内部编译器错误
我的代码很长(几千行),而小型代码成功运行。谢谢提前。