源和目标具有不同的 EABI 版本 [英] Source and target have different EABI versions
问题描述
我正在尝试使用 ARM 工具链编译 .so 文件.但是我不断收到此错误 -
I'm trying to compile a .so file using an ARM toolchain. However I keep getting this error-
错误:源对象具有 EABI 版本 0,但目标具有 EABI 版本 5
error: Source object has EABI version 0, but target has EABI version 5
我无法更改工具链中的任何内容,因为我必须使用给定的工具链.我以前从未见过这个错误.
I can't change anything in the tool chain as I have to use the one given. I've never seen this error before.
我使用了这个编译器标志 - -Wl,--no-warn-mismatch
但不得不把它拿出来,因为它打破了很多其他的东西.
I used this compiler flag -
-Wl,--no-warn-mismatch
But had to take it out as it broke a lot of other stuff.
我使用的编译器标志是:-fPIC -O2 -marm -march=armv7-a
The compiler flags I'm using are:
-fPIC -O2 -marm -march=armv7-a
推荐答案
Use as -meabi=5
我不会声称我完全理解它... :-) 但它解决了问题.
I'm not going to claim I fully understand it... :-) but it solved the problem.
我试图做的事情失败了:
What I was trying to do that failed:
- 使用配置了
--target arm-elf
的 GNU AS 从 4de5434b694fc260d02610e8e7fec21b2923600a 处编译 - 链接到 Ubuntu 16.04
arm-linux-gnueabihf-gcc
5.3.1 版
- assemble with GNU AS compiled from master at 4de5434b694fc260d02610e8e7fec21b2923600a configured with
--target arm-elf
- link with Ubuntu 16.04
arm-linux-gnueabihf-gcc
version 5.3.1
我认为 EABI 规范中提到的值说明了相关内容 http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf
I think that the value is mentioned in the EABI specs say something along about it http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf
表 4-2,ARM 特定的 e_flags
Table 4-2, ARM-specific e_flags
这掩盖了一个 8 位的版本号,这是 ABI 的版本ELF 文件符合.此 ABI 是版本 5.值 0 表示未知一致性.
This masks an 8-bit version number, the version of the ABI to which this ELF file conforms. This ABI is version 5. A value of 0 denotes unknown conformance.
虽然我完全不知道为什么会弹出 0.
although I don't know why exactly 0 popped up at all.
这篇关于源和目标具有不同的 EABI 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!