隐藏符号`__sync_fetch_and_add_4'由DSO引用

时间:2014-09-08 10:03:25

标签: gcc g++

我正在尝试在Linux平台上交叉编译opencv(ARM 8148) 我收到以下错误:

warning: libQtTest.so.4, needed by ../../lib/libopencv_highgui.so.3.0.0, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libQtCore.so.4, needed by ../../lib/libopencv_highgui.so.3.0.0, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: ../../bin/opencv_perf_core: hidden symbol `__sync_fetch_and_add_4' in /opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(linux-atomic.o) is referenced by DSO
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_perf_core] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2

我无法理解这个错误,并且在网上也没有得到适当的参考。任何人都可以帮助我理解这个错误。

1 个答案:

答案 0 :(得分:1)

__ sync_fetch_and_add_x *通常由gcc内联,并编译为对内存字执行自动操作的内联代码。

您将在此处找到它们:

https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/_005f_005fsync-Builtins.html

如本页所述,如果编译器发出函数调用而不是生成内联汇编,则意味着目标平台不支持此原子操作。