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