Boost logo

Boost Users :

Subject: [Boost-users] Issue with cross-compiling boost
From: Roy Kleefman (roy.kleefman_at_[hidden])
Date: 2017-05-17 07:13:48


Hello all,

I am trying to cross-compile the boost libraries for an ARM based linux system.
The system is an FX30 IoT gateway by Sierra Wireless. It comes with a dedicated, Eclipse based, development studio, which supplies the cross-compiler & a disk image with all the required headers & libraries to cross-compile to.
For starters, I've created a user-config.jam file in my home directory with the following contents (my apologies on this being a bit hard to read, I had to use absolute paths or else the cross-compiler would complain):

using gcc : arm : /home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ : <cxxflags>--sysroot=/home/developer /legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi <include>~/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi <linkflags>-L/home/developer /legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/lib -L/home/developer /legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/local/lib <compileflags>-v ;

As you can see I've set the sysroot to the directory that is the / directory of the disk image. I've also set library paths to the disk image's /usr/lib & /usr/local/lib directories. I also tried several variations on setting the include path to point to the disk image, but I run into issues when compiling the boost libraries. When the compiler hits the alloc_lib.c file, it errors out on:

COLLECT_GCC=/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
Target: arm-poky-linux-gnueabi
Configured with: /work/build_src/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=arm-poky-linux-gnueabi --prefix=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr --bindir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi --sbindir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi --libexecdir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi --datadir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/com --localstatedir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/var --libdir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi --includedir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/work/build_src/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-poky-linux-gnueabi- --without-local-prefix --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --with-gxx-include-dir=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/include/c++/4.9.1 --with-build-time-tools=/work/build_src/tmp/sysroots/x86_64-linux/usr/arm-poky-linux-gnueabi/bin --with-sysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi --with-build-sysroot=/work/build_src/tmp/sysroots/swi-mdm9x15 --enable-poison-system-directories --with-mpfr=/work/build_src/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-mpc=/work/build_src/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --enable-nls --with-arch=armv7-a
Thread model: posix
gcc version 4.9.1 (GCC)
COLLECT_GCC_OPTIONS='-O3' '-finline-functions' '-Wno-inline' '-Wall' '-v' '-pthread' '-D' 'BOOST_ALL_NO_LIB=1' '-D' 'BOOST_CONTAINER_STATIC_LINK=1' '-D' 'NDEBUG' '-I' '.' '-c' '-o' 'bin.v2/libs/container/build/gcc-arm/release/link-static/threading-multi/alloc_lib.o' '-shared-libgcc' '-march=armv7-a' '-mtls-dialect=gnu'
/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/cc1 -quiet -v -I . -iprefix /home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/ -D_REENTRANT -D BOOST_ALL_NO_LIB=1 -D BOOST_CONTAINER_STATIC_LINK=1 -D NDEBUG libs/container/src/alloc_lib.c -quiet -dumpbase alloc_lib.c -march=armv7-a -mtls-dialect=gnu -auxbase-strip bin.v2/libs/container/build/gcc-arm/release/link-static/threading-multi/alloc_lib.o -O3 -Wno-inline -Wall -version -finline-functions -o /tmp/ccNP4WY6.s
GNU C (GCC) version 4.9.1 (arm-poky-linux-gnueabi)
                compiled by GNU C version 4.9.1, GMP version 6.0.0, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/../../../../../arm-poky-linux-gnueabi/include"
ignoring duplicate directory "/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/../../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/include"
ignoring nonexistent directory "/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/lib/gcc/arm-poky-linux-gnueabi/4.9.1/include"
ignoring nonexistent directory "/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/local/include"
ignoring duplicate directory "/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/../../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/include-fixed"
ignoring nonexistent directory "/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/../../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/../../../../../arm-poky-linux-gnueabi/include"
ignoring nonexistent directory "/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/include"
#include "..." search starts here:
#include <...> search starts here:
.
/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/include
/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/include-fixed
End of search list.
GNU C (GCC) version 4.9.1 (arm-poky-linux-gnueabi)
                compiled by GNU C version 4.9.1, GMP version 6.0.0, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 89d75e59a6fc83bde96963c802ac00fb
In file included from libs/container/src/alloc_lib.c:19:0:
libs/container/src/dlmalloc_ext_2_8_6.c:13:100: fatal error: errno.h: No such file or directory
#include "errno.h" //dlmalloc bug EINVAL is used in posix_memalign without checking LACKS_ERRNO_H
                                                                                                    ^
compilation terminated.

    "/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++" -x c -O3 -finline-functions -Wno-inline -Wall -v -pthread -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTAINER_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2/libs/container/build/gcc-arm/release/link-static/threading-multi/alloc_lib.o" "libs/container/src/alloc_lib.c"

...failed gcc.compile.c bin.v2/libs/container/build/gcc-arm/release/link-static/threading-multi/alloc_lib.o...
...failed updating 1 target...
...updated 123 targets...

Which I find strange, because the "errno.h" header is available on the disk image. It is found in these directories:
<sysroot>/usr/include/linux/errno.h
<sysroot>/usr/include/bits/errno.h
<sysroot>/usr/include/sys/errno.h
<sysroot>/usr/include/asm-generic/errno.h
<sysroot>/usr/include/asm-generic/errno-base.h
<sysroot>/usr/include/errno.h
<sysroot>/usr/include/asm/errno.h

What struck me as odd is that the include search for this file has a lot shorter search list than for other files. For example, searching for headers for libboost_atomic, it looks in more directories:

#include "..." search starts here:
#include <...> search starts here:
.
/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/include
/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/include
/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/include-fixed
/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/include/c++/4.9.1
/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/include/c++/4.9.1/arm-poky-linux-gnueabi
/home/developer/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07112100-wp85-wp750x-native-x86_64-201701091132/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/include/c++/4.9.1/backward

Can anybody help me with this problem?

Kind regards,

Roy Kleefman

[cid:image001.jpg_at_01D2CEED.E27ADF00]
Rohill * Edisonstraat 12 * 7903 AN Hoogeveen * The Netherlands
Phone: +31-528-263355 * Fax: +31-528-271844 * www.rohill.com<http://www.rohill.com/>
Chamber of Commerce Meppel registration no. 09084362

This email, including any attached files, is confidential, may be legally privileged, and is solely for the intended recipient(s).
If you have received this email in error, please destroy it and notify Rohill immediately. Any unauthorised use, dissemination,
disclosure, copying or printing is strictly prohibited. Thank you.
[cid:image003.jpg_at_01D2CEED.E27ADF00]<http://www.criticalcommunicationsworld.com/>




image001.jpg
image003.jpg

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net