【问题标题】:Android OpenCV shared library build errorAndroid OpenCV 共享库构建错误
【发布时间】:2013-04-29 15:00:58
【问题描述】:

当我构建为静态库时,源代码使用 mm command 在 Android JellyBean 4.1.2 中构建良好。但是当我尝试将android/external/opencv 下的opencv 文件夹构建为静态库 时,android/external/opencv/Android.mk

中有以下更改
+ LOCAL_SHARED_LIBRARIES+= libdl

- include $(BUILD_STATIC_LIBRARY)
+ include $(BUILD_SHARED_LIBRARY)

- LOCAL_STATIC_LIBRARIES := libcxcore libcv libcvaux libcvml libcvhighgui
+ LOCAL_SHARED_LIBRARIES := libcxcore libcv libcvaux libcvml libcvhighgui

我收到以下错误:

android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: internal error in thumb_branch_common, at /tmp/android-8532/src/build/../binutils/binutils-2.21/gold/arm.cc:4148
collect2: ld returned 1 exit status
make: *** [out/target/product/mydevice/obj/SHARED_LIBRARIES/libcxcore_intermediates/LINKED/libcxcore.so] Error 1

知道如何解决这个错误吗?

提前致谢。 问候, 贾伊

【问题讨论】:

    标签: android opencv makefile shared-libraries


    【解决方案1】:

    ,,, arm-linux-androideabi/bin/ld:thumb_branch_common 内部错误, 在/tmp/android-8532/src/build/../binutils/binutils-2.21/gold/arm.cc:4148 collect2: ld 返回 1 个退出状态

    知道如何解决这个错误吗?

    在 Binutils 中,文件 arm.cc,第 4148 行存在内部错误(在 Binutils 中)。

    尝试更新的 Binutils(或更旧的)或修复错误并提交补丁。

    您还可以切换到不同的工具链(使用不同的 Binutils)和 试试看。有时编译器开关会改变操作足以避免 错误。

    有一个机会可以简单地改变源文件中函数的顺序 您正在编译的代码(不是 gold/arm.cc,这是编译器错误所在的位置, 更改您的来源)并且 Binutils 将以不同的方式读取新订购的代码 从而避免 Binutils Bug。

    您链接的代码(.o 文件)也可能已损坏 在磁盘上或编译器中的错误,或者它是错误的字节序 (等)并且没有被检测到。

    PS:Thumb-2 代码(在编译器的工具链中)并非没有错误(如您所见)。

    请参阅此处了解一些正在修复的人: http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/gold&id=b72f3238ad32ab420306a0226d8c2e57c52ddf45

    ... 这就是他们想出的: http://sourceware.org/bugzilla/attachment.cgi?id=6284&action=diff

    【讨论】:

      猜你喜欢
      • 2020-09-20
      • 1970-01-01
      • 2014-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多