在debian中安装arm-gcc 4.9版本

问题描述 投票:0回答:1

错误信息:

# apt-get install gcc-4.9-arm-linux-gnueabihf
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gcc-4.9-arm-linux-gnueabihf : Depends: libgcc-4.9-dev:armhf (= 4.9.2-10) but 4.9.2-10+deb8u1 is to be installed
E: Unable to correct problems, you have held broken packages.

我看过一篇文章说修改/var/lib/dpkg/status,将=改为=>来解决这个问题。但它没有提到细节。如果您有任何想法,请分享。

参考:https://wiki.debian.org/CrossToolchains#Installation

gcc arm debian cross-compiling
1个回答
0
投票

如果你真的需要gcc 4.9,我建议你从here下载一个Linaro工具链。如果没有,您可以从here下载更新的7.4.1版本here或最新的8.3版本。

这应避免您遇到包依赖问题,并为您提供更广泛使用/维护的工具链。

例如:

wget https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabi/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz
sudo tar Jxf gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz -C /opt
PATH=/opt/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin:$PATH

arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Linaro GCC 4.9-2017.01) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

如果您的目标确实支持硬件浮点,则需要安装arm-linux-gnueabihf而不是arm-linux-gnueabi

© www.soinside.com 2019 - 2024. All rights reserved.