交叉编译Boost的问题

发布于 2024-08-22 18:47:10 字数 1142 浏览 0 评论 0原文

我正在尝试在我们的系统中设置 Boost 1.42。我需要 Boost 来使用 gcc 编译常规 x86 架构,并且需要针对 Texas Instruments 的 ARM 处理器进行交叉编译。

ARM 处理器的工具链基于 gcc。 gcc、ar、ranlib等工具都以arm_v5t_le-为前缀。关于交叉编译的文档有些有限。这是我所做的: 我已将以下内容添加到 user-config.jam 文件中: using gcc : arm : arm_v5t_le-g++ ; 从我们的 Makefile 中调用 Bjam,如下所示: bjam toolset=gcc-arm -- toolset-root=/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin <一些其他选项> 为 ARM 处理器进行编译,如下所示:bjam toolset=gcc针对 x86 处理器的<一些其他选项>此处提到了选项 --toolset-root。

我遇到了以下问题: 当我为 ARM 处理器构建应用程序时,出现以下链接器错误:libboost_system-mt.a:无法读取符号:存档没有索引;运行 ranlib 添加一个。我在存档上运行arm_v5t_le-ranlib后,它的链接没有问题。我的猜测是 bjam 使用 ar 而不是 arm-v5t_le-ar。我如何告诉 bjam 应该使用哪个存档器?

邮件列表上据说指定了user-config.jam 中的 也是如此,但不幸的是它似乎不起作用。我最终遇到了相同的链接器错误。

谢谢。

I'm trying to setup Boost 1.42 in our system. I need Boost to compile for the regular x86 architecture with gcc and I need cross compilation for an ARM processor of Texas Instruments.

The toolchain for the ARM processor is based on gcc. The tools like gcc, ar, ranlib are all prefixed with arm_v5t_le-. The documentation about cross compiling is somewhat limited. Here is what I have done:
I have added the following to the user-config.jam file: using gcc : arm : arm_v5t_le-g++ ; Bjam is invoked from our Makefile like this: bjam toolset=gcc-arm --toolset-root=/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin <some other options> to compile for the ARM processor, and like this: bjam toolset=gcc <some other options> for the x86 processor. The option --toolset-root is mentioned here.

I ran into the following problem:
When I build our application for the ARM processor I get the following linker error: libboost_system-mt.a: could not read symbols: Archive has no index; run ranlib to add one. After I ran arm_v5t_le-ranlib on the archive it links without problems. My guess is that bjam uses ar in stead of arm-v5t_le-ar. How do I tell bjam which archiver it should use?

On a mailing list it was said to specify <archiver> in user-config.jam as well, but unfortunately it does not seem to work. I end up with the same linker error.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

揪着可爱 2024-08-29 18:47:10

尝试基于 CMake 的 Boost 构建,它可能能够比 BJam 更好地进行跨平台构建。至少我在这方面取得了成功(但我从未尝试过 ARM)。

Try the CMake-based build of Boost, that might be able to do cross-platform builds better than BJam can. At least I have had success with that (but I never tried ARM).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文