嵌入式之家

 找回密码
 现在注册

QQ登录

只需一步,快速开始

搜索
热搜: ARM cortex
查看: 4225|回复: 0

arm-linux-gcc指定目标CPU型号

[复制链接]

该用户从未签到

14

主题

31

帖子

188

积分

注册会员

Rank: 2

积分
188
QQ
发表于 2015-8-6 21:44:43 | 显示全部楼层 |阅读模式
arm-linux-gcc直接编译程序时,会默认使用某款CPU作为目标CPU
需要手动加参数指定实际的目标CPU型号:
参数为 -march=architecture-type
描述:
           This specifies the name of the target ARM architecture.  GCC uses
           this name to determine what kind of instructions it can emit when
           generating assembly code.  This option can be used in conjunction
           with or instead of the -mcpu= option.  Permissible names are:
           armv2, armv2a, armv3, armv3m, armv4, armv4t, armv5, armv5t, armv5e,
           armv5te, armv6, armv6j, armv6t2, armv6z, armv6zk, armv6-m, armv7,
           armv7-a, armv7-r, armv7-m, iwmmxt, iwmmxt2, ep9312.
在Makefile中,使用CFLAGS变量传给编译器即可。
详见:man arm-none-linux-gnueabi-gcc。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 现在注册

本版积分规则

QQ|Archiver|手机版|小黑屋|嵌入式之家 ( 京ICP备14038168号-1 )

GMT+8, 2024-5-12 00:06 , Processed in 0.019403 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表