设为首页收藏本站
查看: 11615|回复: 0

DS-5编译自带例程threads选项改为-march=armv7-a出错

[复制链接]

231

主题

64

回帖

2145

积分

管理员

积分
2145
玉米糊 发表于 2015-9-15 15:50:40 | 显示全部楼层 |阅读模式
DS-5自带例程 examples/Linux_examples.zip 中的 threads 例程默认使用的目标内核是:armv4t,对于新的ARM内核来说,一般都是Cortex-A系列的,他们基本上都是armv7-a架构,所以这个配置就有点老了。

而如果在 DS-5 中直接把 armv4t 改成 armv7-a,又会提示 error: threads uses VFP register arguments 这样的错误:

[mw_shl_code=bash,true]15:47:33 **** Build of configuration Default for project threads ****
make -f Makeboth all
make[1]: Entering directory `D:/Saves/DS-5/threads'
arm-linux-gnueabihf-gcc -c -g -O0 -fno-omit-frame-pointer -marm -march=armv7-a -mfloat-abi=soft  -pthread threads.c -o threads.o
arm-linux-gnueabihf-gcc threads.o -marm -march=armv7-a -mfloat-abi=soft  -pthread -o threads
d:/program files/ds-5 v5.21.0/sw/gcc/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.exe: error: threads uses VFP register arguments, threads.o does not
d:/program files/ds-5 v5.21.0/sw/gcc/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.exe: failed to merge target specific data of file threads.o
collect2.exe: error: ld returned 1 exit status
make[1]: *** [threads] Error 1
make[1]: Leaving directory `D:/Saves/DS-5/threads'
make: *** [all] Error 2

15:47:34 Build Finished (took 673ms)[/mw_shl_code]

那么该怎么解决呢?
从错误提示中我们看出了点原因,其实只要再把
[mw_shl_code=bash,true]-mfloat-abi=soft[/mw_shl_code]
改为:
[mw_shl_code=bash,true]-mfpu=vfp [/mw_shl_code]
就可以了。
GNU GCC的参数请参考:https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html


回复

使用道具 举报

您需要登录后才可以回帖 登录

本版积分规则

Archiver|手机版|小黑屋|米尔科技论坛   

GMT+8, 2024-4-20 23:44 , Processed in 0.048811 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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