Cross compilation issues

I am trying to configure Boost 1.42 on our system. I need Boost to compile for the regular x86 architecture with gcc, and I need cross-compilation for the Texas Instruments ARM processor.

The toolchain for the ARM processor is based on gcc. Tools like gcc, ar, ranlib are prefixed with arm_v5t_le-. cross compilation documentation is somewhat limited. Here's what I did: I added the following to the user-config.jam file: using gcc : arm : arm_v5t_le-g++ ; Bjam is called from our Makefile as follows: 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 so : bjam toolset=gcc <some other options> for the x86 processor. The --toolset-root option is mentioned here .

I had the following problem: When I create our application for the ARM processor, I get the following linker error: libboost_system-mt.a: could not read the characters: the archive has no index; run runlib to add one. After I launched arm_v5t_le-ranlib in the archive, it communicates without problems. I assume bjam uses ar instead of arm-v5t_le-ar. How to tell bjam which archiver it should use?

The mailing list was told that it also points to <archiver> in user-config.jam, but unfortunately this does not seem to work. I get the same linker error.

Thanks.

+4
source share
1 answer

Try creating CMake-based Boost that can do cross-platform builds better than BJam. At least I had success with this (but I never tried ARM).

+3
source

Source: https://habr.com/ru/post/1302111/


All Articles