|
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。
|
|