在Debian中安裝Cross-Toolchains

在Debian中安裝Cross-Toolchains

以下適用Debian 8, 安裝armhf cross-toolchain.

建立/etc/apt/sources.list.d/crosstools.list檔案, 內容如下:

deb http://emdebian.org/tools/debian/ jessie main

接下來需要安裝archive key

#curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | sudo apt-key add -

新增armhf 架構

#dpkg --add-architecture armhf

然後就可以用apt 來安裝armhf tool chain了

#apt-get update
#apt-get install crossbuild-essential-armhf
裝完後, GCC CROSS_COMPILE PREFIX 為 arm-linux-gnueabihf-

同理, 可新增armel 或 arm64 cross-toolchain

for armel
#dpkg --add-architecture armel
#apt-get update
#apt-get install crossbuild-essential-armel
裝完後, GCC CROSS_COMPILE PREFIX 為 arm-linux-gnueabi-

for arm64
#dpkg --add-architecture arm64
#apt-get update
#apt-get install crossbuild-essential-arm64
裝完後, GCC CROSS_COMPILE PREFIX 為 aarch64-linux-gnu-

參考資料

  1. CrossToolchains
This entry was posted in embedded system, Linux and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *