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

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

问题描述

我在过去几天遇到这个问题,我无法得知这里真正发生的是什么,或是什么问题。

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.

我有一个makefile这些标志:

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

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

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*

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

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


推荐答案

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

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.

如果编译器启用了multilib与 -print-multi-lib ),那么你可以使用 -mfloat-abi = softfp ,但如果不是那么选项不会帮助你:gcc会愉快地生成softfp代码,但是将没有兼容的libgcc链接。

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.

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

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

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

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编译错误,VPF注册使用的可执行文件,而不是目标文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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