【问题标题】:make error when cross compile Perl for ARM为 ARM 交叉编译 Perl 时出错
【发布时间】:2011-09-27 16:07:58
【问题描述】:

我已经使用配置选项成功地为 perl 配置了交叉编译:

./Configure -des -Dusecrosscompile \
    -Dtargethost=172.17.185.91 \
    -Dtargetdir=/home/perl/ \
    -Dtargetuser=root \
    -Dtargetarch=arm-linux \
    -Dcc=arm-linux-gcc \
    -Dusrinc=/opt/Mozart_Toolchain/arm-eabi-uclibc/include/ \
    -Dincpth=/opt/Mozart_Toolchain/arm-eabi-uclibc/include/ \
    -Dlibpth=/opt/Mozart_Toolchain/arm-eabi-uclibc/lib/

配置脚本告诉我“现在你必须运行'make'。”但是我在make的时候遇到了这样的错误:

`sh  cflags "optimize='-O2'" miniperlmain.o`  miniperlmain.c
  CCCMD =  arm-linux-gcc -DPERL_CORE -c -DOVR_DBL_DIG=14 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -O2  -Wall 
In file included from perl.h:38,
                 from miniperlmain.c:40:
config.h:4425:12: error: operator '==' has no left operand
In file included from miniperlmain.c:40:
perl.h:713:14: error: operator '>=' has no left operand
... ...

在 config.h 中,有些宏是空白的,例如:

#define INTSIZE         /**/
#define LONGSIZE        /**/
#define SHORTSIZE       /**/
... much more ...

我认为这是未定义的宏导致 make 错误。我不知道如何解决它。为什么配置成功后宏还是空白? 有交叉编译 Perl 的指南吗?

【问题讨论】:

    标签: perl cross-compiling


    【解决方案1】:

    有一个 Cross 目录,其中包含一个 README 文件,其中包含以下针对 arm-linux 的说明:

    1)  You should be reading me (README) in perl-5.x.y/Cross
    
    2)  Make sure you are in the Cross directory.
    
    3)  Edit the file 'config' to contain your target platform information.
    
    4)  make patch  ## This will patch the existing source-tree.
    5)  make perl   ## Will make perl
    

    (阅读全文。)

    【讨论】:

      【解决方案2】:

      我得到了交叉编译 Perl for arm-linux 的最简单方法。请参考Cross-compiling perl。这是一个伟大的工作!它救了我的命。

      只要按照给出的说明,你就能得到你想要的。 'make'时可能会遇到这样的错误:

      pp_sys.c:78: error: non-thread-local declaration of 'h_errno' follows thread-local declaration
      

      只需注释该行。 尽情享受吧!

      【讨论】:

        猜你喜欢
        • 2011-07-24
        • 2014-01-18
        • 1970-01-01
        • 1970-01-01
        • 2018-09-13
        • 2012-02-11
        • 2019-05-21
        • 2014-12-05
        • 2012-08-04
        相关资源
        最近更新 更多