简体   繁体   English

无法为 x86、uclibc 交叉编译 Python-2.7.18

[英]Unable to cross-compile Python-2.7.18 for x86,uclibc

I'm trying to cross-compile Python 2.7.18 for an x86,uclibc machine using a crosstool-ng example toolchain.我正在尝试使用 crosstool-ng 示例工具链为 x86、uclibc 机器交叉编译 Python 2.7.18。 The commands used are the following:使用的命令如下:

CONFIG_SITE=config.site CC=/home/msainz/x-tools/x86_64-unknown-linux-uclibc/bin/x86_64-unknown-linux-uclibc-gcc CXX=/home/msainz/x-tools/x86_64-unknown-linux-uclibc/bin/x86_64-unknown-linux-uclibc-g++ AR=/home/msainz/x-tools/x86_64-unknown-linux-uclibc/bin/x86_64-unknown-linux-uclibc-ar RANLIB=/home/msainz/x-tools/x86_64-unknown-linux-uclibc/bin/x86_64-unknown-linux-uclibc-ranlib READELF=/home/msainz/x-tools/x86_64-unknown-linux-uclibc/bin/x86_64-unknown-linux-uclibc-readelf LDFLAGS="-L/home/msainz/Projects/Selene/WP3/local/uclibc/base_rootfs/lib -L/home/msainz/Projects/Selene/WP3/local/uclibc/base_rootfs/usr/lib" CFLAGS="-I/home/msainz/Projects/Selene/WP3/local/uclibc/base_rootfs/usr/include -I/home/msainz/Projects/Selene/WP3/local/uclibc/base_rootfs/include" CPPFLAGS="-I/home/msainz/Projects/Selene/WP3/local/uclibc/base_rootfs/usr/include -I/home/msainz/Projects/Selene/WP3/local/uclibc/base_rootfs/include" ./configure --enable-shared --host=x86_64-unknown-linux-uclibc --build=x86_64 --disable-ipv6 --prefix=/home/msainz/Projects/python2_top_uclibc/

followed by其次是

PATH=$PATH:/home/msainz/Projects/python2_top_glibc/bin/ make

and

PATH=$PATH:/home/msainz/Projects/python2_top_glibc/bin/ make install

Execution ends with the following error:执行以以下错误结束:

fi /home/msainz/x-tools/x86_64-unknown-linux-uclibc/bin/x86_64-unknown-linux-uclibc-gcc -L/home/msainz/Projects/Selene/WP3/local/uclibc/base_rootfs/lib -L/home/msainz/Projects/Selene/WP3/local/uclibc/base_rootfs/usr/lib -Xlinker -export-dynamic -o python \\ Modules/python.o \\ -L. -lpython2.7 -ldl -lpthread -lm _PYTHON_PROJECT_BASE=/home/msainz/Projects/Python-2.7.18 _PYTHON_HOST_PLATFORM=linux2-x86_64 PYTHONPATH=./Lib:./Lib/plat-linux2 python -S -m sysconfig --generate-posix-vars ;\\ if test $? -ne 0 ; then \\ echo "generate-posix-vars failed" ; \\ rm -f ./pybuilddir.txt ; \\ exit 1 ; \\ fi python: error while loading shared libraries: libc.so.0: cannot open shared object file: No such file or directory generate-posix-vars failed make: *** [Makefile:523: pybuilddir.txt] Error 1

python2_top_glibc dir contains a previous Python-2.7.18 installation but for native glibc which was compiled perfectly. python2_top_glibc目录包含以前的 Python-2.7.18 安装,但用于完美编译的本机 glibc。 libc.so.0 is in fact in the base_rootfs of target system, which is being linked in ./configure stage. libc.so.0 实际上是在目标系统的 base_rootfs 中,它在 ./configure 阶段被链接。 I'm stuck at this at the moment.我现在被困在这个问题上。 Any clue will be appreciated.任何线索将不胜感激。 Any additional info will be supplied on demand.任何其他信息将按需提供。

Thanks in advance.提前致谢。

python: cannot open shared object file: No such file or directory python:无法打开共享对象文件:没有那个文件或目录

This is a run-time loader error.这是一个运行时加载程序错误。 You are trying to run a python executable that is linked against that libc.so.0 .您正在尝试运行与libc.so.0链接的python可执行文件。

If this executable can actually run in your host environment, you can enable it by adding your base_rootfs library to LD_LIBRARY_PATH .如果此可执行文件实际上可以在您的主机环境中运行,您可以通过将 base_rootfs 库添加到LD_LIBRARY_PATH来启用它。 Otherwise, you need to use your host python executable in this step of the build process, or disable it altogether.否则,您需要在构建过程的这一步中使用您的主机 python 可执行文件,或者完全禁用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM