【问题标题】:boost_thread not linking on NaClboost_thread 未在 NaCl 上链接
【发布时间】:2012-06-13 01:12:25
【问题描述】:

将 -lboost_thread 链接到我在 google Native Client (pepper_19) 上的可执行文件时收到此错误:

nacl_sdk/pepper_19/toolchain/mac_x86_glibc/x86_64-nacl/usr/lib/libboost_thread.a:无法读取符号:存档没有索引;运行ranlib添加一个

我在这里根据 naclports 的说明编译了 boost:http://code.google.com/p/naclports/wiki/InstallingSDL(除了使用 boost 库目录而不是 SDL...我也使用相同的过程来正确编译 NaCl zlib 库)

cd naclports/src/libraries/boost_1_47_0

export NACL_PACKAGES_BITSIZE=32; ./nacl-boost_1_47_0.sh
export NACL_PACKAGES_BITSIZE=64; ./nacl-boost_1_47_0.sh

这会生成 libboost_thread.a 文件并将其放在我的 NACL 安装的 /usr/lib 目录中。我想也许不知何故我错误地构建了一个错误类型的库来与 NaCl 链接。有没有办法检查和/或修复它?

我试过了:

cd naclports/src/out/repository-x86_64/boost_1_47_0/bin.v2/libs/thread/build/darwin-4.2.1/release/link-static/threading-multi

nm libboost_thread.a

这产生了:

libboost_thread.a(thread.o):
0000000000052d08 s EH_frame0
000000000004f50c s GCC_except_table100
000000000004f534 s GCC_except_table101
000000000004f574 s GCC_except_table102
000000000004f5c0 s GCC_except_table103
000000000004f600 s GCC_except_table104
000000000004f64c s GCC_except_table105
000000000004f68c s GCC_except_table106
000000000004f6d8 s GCC_except_table107
.
.
.
.

等等等等。 但是后来我跑了:

nacl_sdk/pepper_19/toolchain/mac_x86_glibc/bin/x86_64-nacl-nm libboost_thread.a

得到:

__.SYMDEF SORTED: File format not recognized
nacl_sdk/pepper_19/toolchain/mac_x86_glibc/bin/x86_64-nacl-nm: thread.o: File format not recognized
nacl_sdk/pepper_19/toolchain/mac_x86_glibc/bin/x86_64-nacl-nm: once.o: File format not recognized

最后。我跑了:

file pthread/thread.o
pthread/thread.o: Mach-O 64-bit object x86_64

然而,在 zlib 对象文件上的相同命令会导致:

ELF 64-bit LSB relocatable, x86-64, version 1, not stripped

我将不胜感激有关构建正确交叉编译的 NaCl libboost_thread.a 的建议

谢谢。

【问题讨论】:

    标签: boost boost-thread google-nativeclient


    【解决方案1】:

    NaCl 端口中的一些库只能在 linux 上构建。所以你要么找到 boost 决定使用 system ar 而不是 x86_64-nacl-ar 的原因,要么在它们相同的地方安装带有 linux 的 VM。

    【讨论】:

      猜你喜欢
      • 2011-03-03
      • 2011-10-18
      • 1970-01-01
      • 2012-09-06
      • 1970-01-01
      • 1970-01-01
      • 2018-10-10
      • 1970-01-01
      相关资源
      最近更新 更多