I'm having a hard time trying to cross-compile the boost library to arm platform.
I'm getting the sources from http://sourceforge.net/projects/boost/files/boost/ . I've tried ver. 1.55, 1.54, and 1.49 they all behave the same.
After unpacking i use ./bootstrap.sh --prefix=/blah/arm-none-eabi
. (the arm-none-eabi catalog contains cross-compilers include
and lib
catalogs, amont others.). Next I update the file tools/build/v2/user-config.jam
by adding using gcc : arm : arm-none-eabi-g++ ;
(ARM EABI Sourcery CodeBench Lite 2013.05-23 crosscompiler, gcc version 4.7.3). After that, I run ./bjam --prefix=/blah/arm-none-eabi/ toolset=gcc-arm
. This gives me a lot of errors like:
`"arm-none-eabi-g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/wave_config_constant.o" "libs/wave/src/wave_config_constant.cpp"
...failed gcc.compile.c++ bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/wave_config_constant.o...
gcc.compile.c++ bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/cpplexer/re2clex/aq.o
arm-none-eabi-g++: error: unrecognized command line option '-pthread'`
I modified the file $BOOST/tools/build/v2/tools/gcc.jam
-case * : option = -pthread ; libs = rt ;
+case * : option = -lpthread ; libs = rt ;
After running the cross compilation again i get a lot of
"arm-none-eabi-g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -lpthread -fPIC -Wextra -Wno-long-long -Wno-variadic-macros -pedantic -DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DNDEBUG -I"." -c -o "bin.v2/libs/chrono/build/gcc-arm/release/threading-multi/chrono.o" "libs/chrono/src/chrono.cpp"
...failed gcc.compile.c++ bin.v2/libs/chrono/build/gcc-arm/release/threading-multi/chrono.o...
gcc.compile.c++ bin.v2/libs/chrono/build/gcc-arm/release/threading-multi/thread_clock.o
gcc.compile.c++ bin.v2/libs/chrono/build/gcc-arm/release/threading-multi/process_cpu_clocks.o
...skipped <pbin.v2/libs/chrono/build/gcc-arm/release/threading-multi>libboost_chrono.so.1.54.0 for lack of <pbin.v2/libs/chrono/build/gcc-arm/release/threading-multi>chrono.o...
...skipped <pstage/lib>libboost_chrono.so.1.54.0 for lack of <pbin.v2/libs/chrono/build/gcc-arm/release/threading-multi>libboost_chrono.so.1.54.0...
...skipped <pstage/lib>libboost_chrono.so for lack of <pstage/lib>libboost_chrono.so.1.54.0...
gcc.link.dll bin.v2/libs/context/build/gcc-arm/release/threading-multi/libboost_context.so.1.54.0
/home/skramer/PP/MGR/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: cannot find -lrt
collect2: error: ld returned 1 exit status
"arm-none-eabi-g++" -o "bin.v2/libs/context/build/gcc-arm/release/threading-multi/libboost_context.so.1.54.0" -Wl,-h -Wl,libboost_context.so.1.54.0 -shared -Wl,--start-group "bin.v2/libs/context/build/gcc-arm/release/threading-multi/asm/make_arm_aapcs_elf_gas.o" "bin.v2/libs/context/build/gcc-arm/release/threading-multi/asm/jump_arm_aapcs_elf_gas.o" -Wl,-Bstatic -Wl,-Bdynamic -lrt -Wl,--end-group -lpthread
...failed gcc.link.dll bin.v2/libs/context/build/gcc-arm/release/threading-multi/libboost_context.so.1.54.0...
...skipped <pstage/lib>libboost_context.so.1.54.0 for lack of <pbin.v2/libs/context/build/gcc-arm/release/threading-multi>libboost_context.so.1.54.0...
...skipped <pstage/lib>libboost_context.so for lack of <pstage/lib>libboost_context.so.1.54.0...
gcc.compile.c++ bin.v2/libs/coroutine/build/gcc-arm/release/link-static/threading-multi/detail/standard_stack_allocator_posix.o
libs/coroutine/src/detail/standard_stack_allocator_posix.cpp:14:22: fatal error: sys/mman.h: No such file or directory
compilation terminated.
"arm-none-eabi-g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -lpthread -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/coroutine/build/gcc-arm/release/link-static/threading-multi/detail/coroutine_context.o" "libs/coroutine/src/detail/coroutine_context.cpp"
...failed gcc.compile.c++ bin.v2/libs/coroutine/build/gcc-arm/release/link-static/threading-multi/detail/coroutine_context.o...
...skipped <pbin.v2/libs/coroutine/build/gcc-arm/release/link-static/threading-multi>libboost_coroutine.a(clean) for lack of <pbin.v2/libs/coroutine/build/gcc-arm/release/link-static/threading-multi>detail/standard_stack_allocator_posix.o...
...skipped <pbin.v2/libs/coroutine/build/gcc-arm/release/link-static/threading-multi>libboost_coroutine.a for lack of <pbin.v2/libs/coroutine/build/gcc-arm/release/link-static/threading-multi>detail/standard_stack_allocator_posix.o...
...skipped <pstage/lib>libboost_coroutine.a for lack of <pbin.v2/libs/coroutine/build/gcc-arm/release/link-static/threading-multi>libboost_coroutine.a...
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-arm/release/threading-multi/gregorian/greg_month.o
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-arm/release/threading-multi/gregorian/greg_weekday.o
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-arm/release/threading-multi/gregorian/date_generators.o
gcc.link.dll bin.v2/libs/date_time/build/gcc-arm/release/threading-multi/libboost_date_time.so.1.54.0
/home/skramer/PP/MGR/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: cannot find -lrt
collect2: error: ld returned 1 exit status
I don't really know what to do now. I've been googling around for a few hours but with no result. I've tried using b2 instead of bjam - nothing changed. I've also tried a different arm cross-compilator - Xilinx EABI Sourcery CodeBench Lite 2012.03-83 (gcc 4.6.3) which seems to be producing less errors but still a lot of syntax and No such file or directory like errors are present. How can I get boost working at arm platform?
error: 'sys/mman.h: No such file or directory
- the compiler can not find header 'sys/mman.h' because the include path is not correct or your system does not contain this file.
You compile for an embedded system, eg arm-non-eabi (used for bare-metal). This ABI is not supported by boost.context. To disable buidling boost.context and boost.coroutine (depends on boost.context) you have to call: b2 --without-context --without-coroutine
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.