Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
lyqqt123
V2EX  ›  Linux

[Q]CentOS 下 ARM-LINUX-GCC 编译器安装后有怪问题

  •  
  •   lyqqt123 · Oct 3, 2016 · 3042 views
    This topic created in 3522 days ago, the information mentioned may be changed or developed.

    在 CentOS7-ARM-32bit 下下载安装了 ARM-LINUX-GCC

    默认 ROOT 下执行 arm-linux-gcc -v 却显示 /opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-gcc: line 15: /opt/FriendlyARM/toolschain/4.4.3/bin/.arm-none-linux-gnueabi-gcc: cannot execute binary file /opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-gcc: line 15: /opt/FriendlyARM/toolschain/4.4.3/bin/.arm-none-linux-gnueabi-gcc: Success

    而在 PC 的虚拟机上则能正常运行

    所以这是硬件兼容问题还是软件版本问题还是什么没设置好的?

    3 replies    2016-10-04 09:34:22 +08:00
    jasontse
        1
    jasontse  
       Oct 3, 2016 via iPad
    直接在目标平台上编译不需要工具链
    MForever78
        2
    MForever78  
       Oct 3, 2016
    LZ 没分清 host 环境和 target 环境。

    正常的 gcc 是本地编译器。 host 和 target 都是本机平台,比如在 x86 上的 gcc , host 和 target 都是 x86 。
    arm-linux-gcc 是交叉编译器,指的是在某个平台上编译成 arm 的 binary 。 host 是 x86 或者 x64 , target 是 arm 。

    在 arm 平台上直接用本地编译器就好了。也就是说,直接 gcc 就行了。
    raiz
        3
    raiz  
       Oct 4, 2016
    这个工具链是我 x86 机器( host )编译的,不是为 arm 平台( target )编译的, 想在 arm 上运行需要重新编译。重新编译器的又需要用到交叉工具链,就是你之前安装的这一款。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5336 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 08:11 · PVG 16:11 · LAX 01:11 · JFK 04:11
    ♥ Do have faith in what you're doing.