0
点赞
收藏
分享

微信扫一扫

arm linux gcc

穆风1818 2024-11-07 阅读 19

任何类型指针都可以赋值给void指针,但反之则不行!

编译器和目标程序都是相同架构的编译过程,被称为 本地编译 。
编译器和目标程序运行在不同架构的编译过程,被称为 交叉编译。

ubuntu下的安装命令:



sudo apt install gcc-arm-linux-gnueabihf

apt get-install arm-none-eabi-gcc

arm-linux-gnueabihf-gcc –v

其中,arm-linux-gnueabihf-gcc编译后的目标应用程序是运行在Linux操作系统之上的。
none表示无操作系统,arm-none-eabi-gcc编译后的目标应用程序的运行环境是不带操作系统的。

编译命令:

arm-linux-gnueabihf-gcc hello.c –o hello

编译为thumb指令集:

arm-linux-gnueabihf-gcc -mthumb ./hello.c

使用如下命令查看elf文件的指令集:

readelf -a hello

参考链接:
https://doc.embedfire.com/linux/imx6/linux_base/zh/latest/linux_app/arm_gcc_hello_world/arm_gcc_hello_world.html

举报

相关推荐

0 条评论