错误消息“未定义符号__sync_fetch_and_add_4”

最后编辑了

症状

当尝试使用从Sources中的构建测试应用程序时,通过SquishServer启动失败,ARM平台上的错误失败:

/path/to/aut: symbol lookup error: /path/to/squish/lib/libsquishqtpre.so:
   undefined symbol: __sync_fetch_and_add_4

可能的原因和建议的解决方案

The symbol __sync_fetch_and_add (and others) are only implemented in the static libgcc library. When linking Squish’s libraries against the shared gcc_s library these symbols will be missing. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46563 讨论问题。

通过修补柔软可以实现快速解决方法’s build scripts to have -lgcc added to the link commands for each library. A more convenient and permanent fix for this toolchain problem: replace the libgcc_s.so symlink with a linker script (plain text file) with the following content:

/* GNU ld script
   Use the shared library, but some functions are only in
   the static library.  */
GROUP ( libgcc_s.so.1 libgcc.a )

这将使链接器在创建二进制文件时在共享和静态库中拉。