从sou交叉编译ARM的python

2024-06-16 17:01:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用TI-SDK为ARM交叉编译Python3.7。你知道吗

我已经在ubuntu上下载了源代码,并按照下面的说明进行了操作

  1. 设置SDK的路径(导出路径=$path:)
  2. /配置
  3. 制造

当我运行make时,我得到下面的错误。你能告诉我如何解决链接器错误吗?你知道吗

*ar rc libpython3.5m.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o 
ar rc libpython3.5m.a Modules/_threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/zipimport.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.o
ranlib libpython3.5m.a
gcc -pthread   -Xlinker -export-dynamic -o python Programs/python.o libpython3.5m.a -lpthread -ldl  -lutil   -lm  
libpython3.5m.a(fileutils.o): In function `set_inheritable':
/home/pcadmin/work/OTIS/Python-3.5.9/Python/fileutils.c:892: undefined reference to `fcntl64'
/home/pcadmin/work/OTIS/Python-3.5.9/Python/fileutils.c:903: undefined reference to `fcntl64'
libpython3.5m.a(fileutils.o): In function `get_inheritable':
/home/pcadmin/work/OTIS/Python-3.5.9/Python/fileutils.c:777: undefined reference to `fcntl64'
/home/pcadmin/work/OTIS/Python-3.5.9/Python/fileutils.c:777: undefined reference to `fcntl64'
libpython3.5m.a(fileutils.o): In function `set_inheritable':
/home/pcadmin/work/OTIS/Python-3.5.9/Python/fileutils.c:892: undefined reference to `fcntl64'
libpython3.5m.a(fileutils.o):/home/pcadmin/work/OTIS/Python-3.5.9/Python/fileutils.c:903: more undefined references to `fcntl64' follow
collect2: error: ld returned 1 exit status
Makefile:555: recipe for target 'python' failed
make: *** [python] Error 1*

请评论,如果需要更多的信息来帮助我解决这个问题。你知道吗


Tags: toin路径moduleshomesdkfunctionwork
1条回答
网友
1楼 · 发布于 2024-06-16 17:01:16

我找到了解决办法。我想如果我把它贴出来可能会对别人有帮助。你知道吗

链接器错误是由于对libxml2的依赖性造成的。我交叉编译了libxml2并链接到python上,它成功了。你知道吗

configure脚本包括libxml的路径和其他选项。你知道吗

 ./configure CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ AR=arm-linux-gnueabihf-ar LD=arm-linux-gnueabihf-ld RANLIB=arm-linux-gnueabihf-ranlib  host=arm-linux-gnueabihf  target=arm -prefix=/home/sagar/otis/python3_install  without-sqlite3  without-pdo-sqlite  without-pear  enable-simplexml  disable-mbregex  enable-sockets  enable-fpm  disable-opcache  enable-libxml  without-zlib  with-libxml-dir=/home/sagar/otis/libxml/_install/  build=x86_64-linux-gnu   disable-all  disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no

相关问题 更多 >