ARM v7 平台上的 ARM v5 共享库 (ftd2xx) - 硬浮点数与软浮点数问题 [英] ARM v5 shared library (ftd2xx) on ARM v7 platform - hard vs soft float issue

查看:16
本文介绍了ARM v7 平台上的 ARM v5 共享库 (ftd2xx) - 硬浮点数与软浮点数问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在运行 Ubuntu 12.04 的 BeagleBoard xM rev C 上运行一个使用 ftd2xx 的程序.我正在尝试使用 此处 提供的 ARM 库 libftd2xx.so.libFTDI 不是一个选项.

我注意到的不同之处在于在 libftd2xx.so 上运行 readelf -hA 与在 BeagleBoard 上运行的其他库.特定于架构的部分将 ftd2xx 的操作系统名称指定为ARM926EF-S",而不是其他库的7-A",将 CPU_arch 指定为v5TEJ"而不是v7".

我假设这意味着该库适用于 ARM v5 指令集,而 BeagleBoard 运行的是 ARM v7.有什么方法可以让 ftd2xx 工作吗?

有人告诉我 ARM7 向后兼容 ARM5,但这并不能解决我的问题.

另一件需要注意的是,在 BeagleBoard 上运行 ldd libftd2xx.so 不会列出依赖项,而是打印出not a dynamic executable,而它在其他图书馆.

编辑 2:

问题似乎出在软浮动与硬浮动 ABI 上.我在 BeagleBoard xM 上有一个 gnueabihf 图像.当我尝试使用静态 libftd2xx.a 编译示例程序时,我得到了很多:

<代码>/usr/bin/ld: 错误:static_link_uses VFP 寄存器参数,libftd2xx.a(file.o) 没有
/usr/bin/ld: 无法合并文件 libftd2xx.a(file.o) 的目标特定数据

如果我尝试使用 mfloat-abi=softmfloatabi=softfp 进行编译,我会得到

在/usr/include/stdio.h:28:0 包含的文件中,
来自 main.c:12:
/usr/include/features.h:324:26 致命错误:bits/predef.h:没有那个文件或目录
编译终止

我还尝试使用 arm-linux-gnueabi 而不是 arm-linux-gnueabihf 进行交叉编译,但生成的程序无法在 BeagleBoard 上执行.有什么我可以做的还是不可能的?

--------- 解决方案 ----------------

经过一些麻烦之后,FTDI 为我提供了他们库的硬浮动版本,该版本可以正常工作.在许多人单独要求之后,我在这里提供它:

https://s3.amazonaws.com/hayk-public/arm926-hf.zip

解决方案

v5TEJ 是 v7-A 指令集的子集.

代码运行速度可能会慢一些,并且可能比要求的要大一些,但它应该可以正常工作,而不会因为非法指令或其他原因而崩溃.除了极少数例外,ARM 代码向后兼容以前的指令集.

如果代码在您的平台上不起作用,则很可能是其他原因,例如缺少对 USB 子系统的访问权限等.

I need to run a program that uses ftd2xx on my BeagleBoard xM rev C running Ubuntu 12.04. I am trying to use the ARM library libftd2xx.so provided here. libFTDI is not an option.

The difference that I noticed comes from running readelf -hA on libftd2xx.so vs other libraries on the BeagleBoard that work. The arch-specific section gives OS name as "ARM926EF-S" for ftd2xx instead of "7-A" for other libraries and CPU_arch as "v5TEJ" instead of "v7".

I'm assuming this means that the library is meant for the ARM v5 instruction set, and the BeagleBoard is running ARM v7. Is there some way to get ftd2xx to work?

Edit: I've been told ARM7 is backward compatible with ARM5, but that does not solve my problem.

Another thing to note is that running ldd libftd2xx.so on the BeagleBoard does not list the dependencies, but prints out not a dynamic executable, whereas it works on other libraries.

EDIT 2:

The issue seems to be with a soft vs hard float ABI. I have a gnueabihf image on the BeagleBoard xM. When I try to compile an example program with the static libftd2xx.a, I get many of these:

/usr/bin/ld: error: static_link_uses VFP register arguments, libftd2xx.a(file.o) does not
/usr/bin/ld: failed to merge target specific data of file libftd2xx.a(file.o)

If I try to compile with mfloat-abi=soft or mfloatabi=softfp, I get

In file included from /usr/include/stdio.h:28:0,
from main.c:12:
/usr/include/features.h:324:26 fatal error: bits/predef.h: No such file or directory
compilation terminated

I also tried to cross compile with arm-linux-gnueabi instead of arm-linux-gnueabihf, but the resulting program does not execute on the BeagleBoard. Is there anything I can do or is it impossible?

--------- SOLUTION ----------------

After some trouble, FTDI provided me with a hard float version of their library which works. I am providing it here after many people have individually requested it:

https://s3.amazonaws.com/hayk-public/arm926-hf.zip

解决方案

v5TEJ is a subset of the v7-A instruction set.

The code may run a bit slower and may be a bit larger than required, but it should nonetheless work without crashing due to illegal instructions or so. With very few exceptions ARM code is backward compatible to previous instruction sets.

If the code does not work on your platform it is very likely something else like missing access rights to the USB subsystem or so.

这篇关于ARM v7 平台上的 ARM v5 共享库 (ftd2xx) - 硬浮点数与软浮点数问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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