debian9.6命令安装交叉编译器
  dSzaXU8MjqY1 2023年11月02日 36 0


1,搜索

guoyanzhang@bogon:~$ apt-cache search gcc-arm-linux-gnueabi*
gcc-arm-linux-gnueabi - GNU C compiler for the armel architecture
gcc-arm-linux-gnueabihf - GNU C compiler for the armhf architecture

 搜索的结果有两个,很显然,两个都是交叉编译器,一个是armel架构,一个是armhf架构。

可参考:​​https://zhidao.baidu.com/question/1691117630864232868.html​​,这里面对两个的区别写的还是比较清楚的。

另外这篇文章里说,这两个编译的结果不能兼容,大家使用的时候注意点。

2,安装

guoyanzhang@bogon:~$ sudo apt-get install gcc-arm-linux-gnueabi

3,查看是否安装成功

guoyanzhang@bogon:~/test$ dpkg -s gcc-arm-linux-gnueabi
Package: gcc-arm-linux-gnueabi
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 24
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Architecture: amd64
Multi-Arch: foreign
Source: gcc-defaults (1.168)
Version: 4:6.3.0-4
Depends: cpp-arm-linux-gnueabi (>= 4:6.3.0-4), gcc-6-arm-linux-gnueabi (>= 6.3.0-9~)
Recommends: libc6-dev-armel-cross | libc-dev-armel-cross
Suggests: make, manpages-dev, autoconf, automake, libtool, flex, bison, gdb-arm-linux-gnueabi, gcc-doc
Description: GNU C compiler for the armel architecture
This is the GNU C compiler, a fairly portable optimizing compiler for C.
.
This is a dependency package providing the default GNU C cross-compiler
for the armel architecture.

4,使用(后来又安装,这步可以不需要)

guoyanzhang@bogon:~/test$ sudo apt-get install lsb-core
guoyanzhang@bogon:~/test$ arm-linux-gnueabi-gcc a.c
guoyanzhang@bogon:~/test$

lsb-core的作用,就是可以像其他命令一样tab补全使用了,不用再加目录/usr/bin/使用arm-linux-gnueabi了,否则tab补全不了。(如果还不能补全的话,将/usr/bin下的arm-linux-gnueabi拷贝到/bin下)

这里我没注意,可能是改变了PATH内容,添加了/usr/bin这一项。


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
dSzaXU8MjqY1