ARM编译错误,VFP注册由可执行文件使用,而不是目标文件 [英] ARM compilation error, VFP registered used by executable, not object file

查看:1324
本文介绍了ARM编译错误,VFP注册由可执行文件使用,而不是目标文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几天我一直有这个问题,我无法理解这里发生的事情,或者是什么问题。



我有一个使用这些标志的makefile:

  CC = arm-linux-gnueabihf-gcc-4.6 
FLAGS = - O3 -march = armv7 -a -mtune = cortex-a9 -mfpu = neon -ftree-vectorize -mfloat-abi = softfp -std = gnu99

我在.a文件中有一个库,它有一些目标文件,我需要做的就是将它们与我的可执行文件链接起来。我知道原型和所有这些,唯一抱怨的是以下内容:

  / usr / bin / ld:error: * EXECUTABLE *使用VFP寄存器参数,* OBJECTFILE *不
/ usr / bin / ld:未能合并文件的目标特定数据* OBJECTFILE *

当我不使用-mfloat-abi = softfp时,会得到另一个与浮点寄存器有关的错误。



有没有人知道是什么导致了这种情况,以及我能做些什么来解决这个问题,比如让我的可执行文件不使用虚拟浮点寄存器参数?

  x @ x:〜/ Desktop / perf_test $ make 
arm-linux-gnueabihf-gcc-4.6 -c -O3 -march = armv7 -a -mtune = cortex-a9 -mfpu = neon -ftree-vectorize -std = gnu99 -mfloat-abi = softfp perf_test.c ../baseline/util.c
arm-linux-gnueabihf-gcc-4.6 -o perf_test perf_test。 o util.o ../baseline/lib.a
/ usr / bin / ld:错误:perf_test使用VFP寄存器参数,perf_test.o不会
/ usr / bin / ld:无法合并文件perf_test.o的目标特定数据
/ usr / bin / ld:错误:perf_test使用VFP寄存器参数,util.o不会
/ usr / bin / ld:失败合并文件util.o的目标特定数据
/ usr / bin / ld:错误:perf_test使用VFP注册参数../baseline/lib.a(ao)不
/ usr / bin / ld:未合并文件的目标特定数据../baseline/lib.a(ao)
/ usr / bin / ld:错误:perf_test使用VFP注册参数../ baseline / lib.a( bo)不
/ usr / bin / ld:未合并文件的目标特定数据../baseline/lib.a(bo)
/ usr / bin / ld:错误:perf_test使用VFP注册参数../baseline/lib.a(co)不
/ usr / bin / ld:未合并文件的目标特定数据../baseline/lib.a(co)
/ usr / bin / ld:错误:perf_test使用VFP注册参数,../baseline/lib.a(do)不
/ usr / bin / ld:未合并文件的目标特定数据../ baseline / lib.a(做)
/ usr / bin / ld:错误:perf_test使用VFP注册原理ts,../baseline/lib.a(eo)不是
/ usr / bin / ld:未合并文件的目标特定数据../baseline/lib.a(eo)
/ usr / bin / ld:错误:perf_test使用VFP注册参数../baseline/lib.a(fo)不
/ usr / bin / ld:无法合并文件的目标特定数据../baseline /lib.a(fo)
collect2:ld返回1退出状态
make:*** [perf_test]错误1


解决方案

您的目标三元组表示您的编译器已配置为 hard-float ABI。这意味着libgcc库也将是hardfp。错误信息表明你的系统至少有一部分正在使用ABI。

如果编译器启用了multilib(你可以告诉 -print-multi-lib ),那么你可以使用 -mfloat-abi = softfp ,但如果不是这样的话选项对你没有多大帮助:gcc会很高兴地生成softfp代码,但是不会有兼容的libgcc来链接。



基本上,hardfp和softfp只是不兼容。你需要以一种或另一种方式配置你的整个系统。



编辑:一些发行版是或将会是多元化。如果您有其中一个,那么可以立即安装两个 ABI,但这是通过将所有内容加倍来完成的 - 兼容性问题仍然存在。


I have been having this problem for the last few days and I can't get my head around what is really happening here, or what is the problem.

I have a makefile with these flags:

CC = arm-linux-gnueabihf-gcc-4.6
FLAGS = -O3 -march=armv7-a -mtune=cortex-a9 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -std=gnu99

I have a library in a .a file, which has some object files, all I need to do is link them in with my executable. I know the prototypes and all that, the only thing that complains is the following:

/usr/bin/ld: error: *EXECUTABLE* uses VFP register arguments, *OBJECTFILE* does not
/usr/bin/ld: failed to merge target specific data of file *OBJECTFILE*

When I don't use the -mfloat-abi=softfp, I get another error relating to floating point registers.

Does anyone have any idea what is causing this, and what I can do to fix this, such as making it so that my executable does not use Virtual Floating Point Register arguments?

x@x:~/Desktop/perf_test$ make
arm-linux-gnueabihf-gcc-4.6 -c -O3 -march=armv7-a -mtune=cortex-a9 -mfpu=neon -ftree-vectorize -std=gnu99 -mfloat-abi=softfp  perf_test.c ../baseline/util.c
arm-linux-gnueabihf-gcc-4.6 -o perf_test perf_test.o util.o  ../baseline/lib.a
/usr/bin/ld: error: perf_test uses VFP register arguments, perf_test.o does not
/usr/bin/ld: failed to merge target specific data of file perf_test.o
/usr/bin/ld: error: perf_test uses VFP register arguments, util.o does not
/usr/bin/ld: failed to merge target specific data of file util.o
/usr/bin/ld: error: perf_test uses VFP register arguments, ../baseline/lib.a(a.o) does not
/usr/bin/ld: failed to merge target specific data of file ../baseline/lib.a(a.o)
/usr/bin/ld: error: perf_test uses VFP register arguments, ../baseline/lib.a(b.o) does not
/usr/bin/ld: failed to merge target specific data of file ../baseline/lib.a(b.o)
/usr/bin/ld: error: perf_test uses VFP register arguments, ../baseline/lib.a(c.o) does not
/usr/bin/ld: failed to merge target specific data of file ../baseline/lib.a(c.o)
/usr/bin/ld: error: perf_test uses VFP register arguments, ../baseline/lib.a(d.o) does not
/usr/bin/ld: failed to merge target specific data of file ../baseline/lib.a(d.o)
/usr/bin/ld: error: perf_test uses VFP register arguments, ../baseline/lib.a(e.o) does not
/usr/bin/ld: failed to merge target specific data of file ../baseline/lib.a(e.o)
/usr/bin/ld: error: perf_test uses VFP register arguments, ../baseline/lib.a(f.o) does not
/usr/bin/ld: failed to merge target specific data of file ../baseline/lib.a(f.o)
collect2: ld returned 1 exit status
make: *** [perf_test] Error 1

解决方案

Your target triplet indicates that your compiler is configured for the hard-float ABI. This means that the libgcc library will also be hardfp. The error message indicates that at least part of your system is using soft-float ABI.

If the compiler has multilib enabled (you can tell with -print-multi-lib) then you can use -mfloat-abi=softfp, but if not then that option won't help you much: gcc will happily generate softfp code, but then there'll be no compatible libgcc to link against.

Basically, hardfp and softfp are just not compatible. You need to get your whole system configured one way or the other.

EDIT: some distros are, or will be, "multiarch". If you have one of those then it's possible to install both ABIs at once, but that's done by doubling everything up -- the compatibility issues still exist.

这篇关于ARM编译错误,VFP注册由可执行文件使用,而不是目标文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆