在构建系统源码是,提示gcc版本过高。原因是在~/.bashrc中配置了arm-none-eabi-gcc,版本为4.4.1。
需要降低gcc版本,使用系统源码自己的gcc工具,在工程构建脚本build.sh中export gcc 4.3.3:
export PATH=/opt/arm-2009q3-4.3.3/bin
执行脚本./build.sh,在终端查看
LIly@Lily:arm-none-eabi-gcc -- version
结果仍为:arm-none-eabi-gcc 4.4.1
在终端直接输入export PATH=/opt/arm-2009q3-4.3.3/bin
在终端查看;LIly@Lily:arm-none-eabi-gcc -- version
结果为:arm-none-eabi-gcc 4.3.3
修改脚本,加入echo arm-none-eabi-gcc --version
运行脚本,./build.sh
输出:arm-none-eabi-gcc 4.3.3
原因可能是脚本与终端运行在不同的进程中。所以,要么构建过程全部在脚本写在脚本中,要么全部在终端执行。