为QNX 6.6.0 armle v7交叉编译perl

我试图用以下方法交叉编译perl 5.24,因为目标机器没有安装ssh。 https://github.com/arsv/perl-cross

只是为了Fyi,我的本地机器是Ubuntu x86_64 GNU / Linux。

我使用以下选项configuration工具链:

./configure -Dsysroot = $ QNX_TARGET -Dcc = ntoarmv7-gcc -Dtargetarch = armle -Dprefix = $ HOME / localperl -Duseshrplib

我认为上述脚本工作得很好的原因是因为它生成具有以下消息的生成文件:

Generating config.h Extracting config.h (with variable substitutions) Generating Makefile.config Configuration completed for native build platform: x86_64- c compiler: ntoarmv7-gcc ld: ntoarmv7-gcc ar: ar ranlib: ranlib 

当我运行make -j4选项时,我最终得到了以下两个结果之一:

 ./generate_uudmap uudmap.h bitcount.h mg_data.h ./generate_uudmap: 1: ./generate_uudmap: Syntax error: word unexpected (expecting ")") make: *** [uudmap.h] Error 2 

要么

 cp -f op.c opmini.c cp -f perl.c perlmini.c cp -f ext/re/re.pm lib/re.pm sh cflags.SH cp -f dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp lib/ExtUtils/xsubpp ntoarmv7-gcc -DPERL_CORE --sysroot=/opt/qnx650/target/qnx6 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -Wno-unused-function -c -o op.o op.c ./miniperl_top lib/unicore/mktables -w -C lib/unicore -P pod -maketest -makelist -p ./miniperl_top: no ./miniperl found; build it before using miniperl_top make: *** [lib/unicore/CombiningClass.pl] Error 1 

我找不到有关如何解决上述问题的很多信息。 难道是因为我没有提供正确的设置选项./configure? 如果是这样,你能提供更多的见解。

编辑:

它看起来像我是错误的信息传递给./configure脚本(它被认为是本地而不是交叉),我更新了以下,并能够取得进展。

 ./configure -Dsysroot=/opt/qnx6 -Dcc=arm-unknown-nto-qnx6.6.0eabi-gcc --target-tools-prefix=arm-unknown-nto-qnx6.6.0eabi- --target=arm-unknown-nto-qnx6.6.0eabi --host=arm-unknown-nto-qnx6.6.0eabi -Dprefix=$HOME/localperl 

与此,跨平台的configuration是成功的。 现在,当我执行make时,它运行得很好,我运行它后面的错误

 arm-unknown-nto-qnx6.6.0eabi-ar cru libperl.a op.o perl.o gv.o toke.o perly.o pad.o regcomp.o dump.o dquote.o util.o mg.o reentr.o mro_core.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o keywords.o caretx.o time64.o DynaLoader.o arm-unknown-nto-qnx6.6.0eabi-ranlib libperl.a ./miniperl_top statars > static.list ./miniperl_top extlibs > ext.libs arm-unknown-nto-qnx6.6.0eabi-gcc -DPERL_CORE --sysroot=/opt/qnx6 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c -o perlmain.o perlmain.c arm-unknown-nto-qnx6.6.0eabi-gcc --sysroot=/opt/qnx6 -Wl,-E -o perl perlmain.o libperl.a libperl.a(pp.o): In function `Perl_pp_crypt': pp.c:(.text+0xffd8): warning: The 'crypt' function has been deprecated in libc. Link against liblogin for extended algorithm support. libperl.a(toke.o): In function `Perl_scan_num': toke.c:(.text+0x27b82): undefined reference to `pow' libperl.a(util.o): In function `Perl_drand48_r': util.c:(.text+0xa36e): undefined reference to `ldexp' libperl.a(sv.o): In function `S_hextract': sv.c:(.text+0x13ca0): undefined reference to `frexp' libperl.a(sv.o): In function `Perl_sv_vcatpvfn_flags': sv.c:(.text+0x16cc0): undefined reference to `frexp' libperl.a(time64.o): In function `Perl_gmtime64_r': time64.c:(.text+0x338c): undefined reference to `fmod' . . time64.c:(.text+0x359c): undefined reference to `floor' time64.c:(.text+0x37e6): undefined reference to `ceil' collect2: error: ld returned 1 exit status make: *** [perl] Error 1 

最后的问题与连接图书馆有关。 加上-lm修正了这个问题

 arm-unknown-nto-qnx6.6.0eabi-gcc --sysroot=/opt/qnx660/target/qnx6 -Wl,-rpath,/home/swgroup/localperl/lib/perl5/5.24.0/arm-/CORE -Wl,-E -o perl perlmain.o libperl.so -lm