开发者

Troubles with cross compiling boost

开发者 https://www.devze.com 2022-12-21 03:28 出处:网络
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.

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-c开发者_StackOverflow中文版onfig.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.


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).

  • http://sodium.resophonic.com/boost-cmake/1.41.0.cmake0/
  • http://www.itk.org/Wiki/CMake_Cross_Compiling
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号