簡體   English   中英

如何安裝“gcc-arm-linux-gnueabihf”特定版本?

[英]How to install "gcc-arm-linux-gnueabihf" specific version?

我在 x86 上執行交叉編譯,目標平台是 armhf。 當我運行命令apt-get install -y gcc-arm-linux* g++-arm-linux*時,它安裝4.11.2.0版本和 output 如下

g++-arm-linux-gnueabi is already the newest version (4:11.2.0-1ubuntu1). 
g++-arm-linux-gnueabihf is already the newest version (4:11.2.0-1ubuntu1).    
gcc-arm-linux-gnueabi is already the newest version (4:11.2.0-1ubuntu1).    
gcc-arm-linux-gnueabihf is already the newest version (4:11.2.0-1ubuntu1)

但我需要4.9.3.0版本。 ubuntu命令行如何安裝4.9.3.0版本??

我正在使用 ubuntu 20.04 並使用 focal apt list 執行交叉編譯

我的 /etc/apt.source.list 文件如下

echo "### Copying ARM sources to /etc/apt/sources.list ###"
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe" >  /etc/apt/sources.list
echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal main universe" >>  /etc/apt/sources.list
echo "deb-src http://archive.ubuntu.com/ubuntu focal main universe" >>  /etc/apt/sources.list

正如old_timer所指出的,您可以下載/使用預構建的工具鏈。 例如,您可以使用 Linaro 工具鏈15.02 版中提供的arm-linux-gnueabihf-gcc - 在 Ubuntu 22.04 上測試:

下載/安裝:

wget https://releases.linaro.org/archive/15.02/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf.tar.xz
tar Jxf gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf.tar.xz
PATH=$(pwd)/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/bin

驗證 gcc 版本:

arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Linaro GCC 4.9-2015.01-3) 4.9.3 20150113 (prerelease)
Copyright (C) 2014 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.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM