Need help configuring a toolset for building Boost

I've manage to build Boost (1_35_0) on my windows/cygwin machine using gcc (version 3.4.4) and it builds the threads dll such that I'm able to compile and run an application on windows that tests the threads. Now I'd like to be able to build using a cross-compiler (arm-xscale-linux-gnu-gcc version 4.1.0) but I'm not sure how to get it to recognize the tools. I was able to build for windows/cygwin with the following command:
bjam --build-dir=tmp/build-boost --toolset=gcc threading=multi target-os=cygwin threadapi=pthread stage
Changing 'gcc' to 'arm-xscale-linux-gnu-gcc' and 'cygwin' to 'linux' didn't work. Here is the error I'm getting: arm.jam: No such file or directory c:/cppLibs/boost_1_35_0/tools/build/v2/build\toolset.jam:38: in toolset.using rule arm.init unknown in module toolset. c:/cppLibs/boost_1_35_0/tools/build/v2\build-system.jam:429: in process-explicit-toolset-requests c:/cppLibs/boost_1_35_0/tools/build/v2\build-system.jam:508: in load c:\cppLibs\boost_1_35_0\tools\build\v2/kernel\modules.jam:267: in import c:\cppLibs\boost_1_35_0\tools\build\v2/kernel/bootstrap.jam:132: in boost-build c:\cppLibs\boost_1_35_0\boost-build.jam:11: in module scope

CSB wrote:
I've manage to build Boost (1_35_0) on my windows/cygwin machine using gcc (version 3.4.4) and it builds the threads dll such that I'm able to compile and run an application on windows that tests the threads.
Now I'd like to be able to build using a cross-compiler (arm-xscale-linux-gnu-gcc version 4.1.0) but I'm not sure how to get it to recognize the tools.
I was able to build for windows/cygwin with the following command:
bjam --build-dir=tmp/build-boost --toolset=gcc threading=multi target-os=cygwin threadapi=pthread stage
Changing 'gcc' to 'arm-xscale-linux-gnu-gcc' and 'cygwin' to 'linux' didn't work.
You need to configure you compiler in user-config.jam. For example: using gcc : arm : arm-xscale-linux-gnu-gcc ; and then use bjam ... toolset=gcc-arm ... When building on linux, you don't need target-os and threadapi properties. - Volodya

"Vladimir Prus"
CSB wrote:
I've manage to build Boost (1_35_0) on my windows/cygwin machine using gcc (version 3.4.4) and it builds the threads dll such that I'm able to compile and run an application on windows that tests the threads.
Now I'd like to be able to build using a cross-compiler (arm-xscale-linux-gnu-gcc version 4.1.0) but I'm not sure how to get it to recognize the tools.
I was able to build for windows/cygwin with the following command:
bjam --build-dir=tmp/build-boost --toolset=gcc threading=multi target-os=cygwin threadapi=pthread stage
Changing 'gcc' to 'arm-xscale-linux-gnu-gcc' and 'cygwin' to 'linux' didn't work.
You need to configure you compiler in user-config.jam. For example:
using gcc : arm : arm-xscale-linux-gnu-gcc ;
and then use
bjam ... toolset=gcc-arm ...
When building on linux, you don't need target-os and threadapi properties.
- Volodya
Thanks for the help. It has gotten me a little further along but either I'm
confused or the compiler is confused about what I'm trying to build. :)
I'm attempting to use my cross compiler (arm-xscale-linux-gnu-gcc) to build
my linux libraries for Boost.Thread on my windows machine. I'm building for
an embedded linux target and don't have the means at this time to build the
libs on the target platform which I'm sure is the more sane route.
I made the changes you indicated to user-config.jam and tried to rebuild.
It still seemed to be trying to build win32 specific sources though with
command line options not recognized by my cross-compiler for linux
(e.g. -mthreads). I tried editing gcc.jam to prevent it from picking up the
win32 specific stuff and it got a little further but still seems confused
about the target as evidenced by the error messages that follow.
--------------------- BEGIN ERROR
MESSAGES --------------------------------------------
gcc.compile.c++
tmp\build-boost\boost\bin.v2\libs\thread\build\gcc-arm\release\target-os-linux\threading-multi\thread.o
libs\thread\src\win32\thread.cpp:12:21: error: windows.h: No such file or
directory
libs\thread\src\win32\thread.cpp:14:21: error: process.h: No such file or
directory
libs\thread\src\win32\thread.cpp:28: error: 'DWORD' does not name a type
libs\thread\src\win32\thread.cpp: In function 'void
boost::<unnamed>::create_current_thread_tls_key()':
libs\thread\src\win32\thread.cpp:32: error: 'current_thread_tls_key' was not
declared in this scope
libs\thread\src\win32\thread.cpp:32: error: 'TlsAlloc' was not declared in
this scope
libs\thread\src\win32\thread.cpp: In function
'boost::detail::thread_data_base* boost::<unnamed>::get_current_thread_dat
a()':
libs\thread\src\win32\thread.cpp:39: error: 'current_thread_tls_key' was not
declared in this scope
libs\thread\src\win32\thread.cpp:39: error: 'TlsGetValue' was not declared
in this scope
libs\thread\src\win32\thread.cpp: In function 'void
boost::<unnamed>::set_current_thread_data(boost::detail::thread_data
_base*)':
libs\thread\src\win32\thread.cpp:45: error: 'current_thread_tls_key' was not
declared in this scope
libs\thread\src\win32\thread.cpp:45: error: 'TlsSetValue' was not declared
in this scope
libs\thread\src\win32\thread.cpp: In function 'void
boost::<unnamed>::run_thread_exit_callbacks()':
libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member
of 'boost::detail'
libs\thread\src\win32\thread.cpp:149: error: 'heap_delete' is not a member
of 'boost::detail'
libs\thread\src\win32\thread.cpp:159: error: 'heap_delete' is not a member
of 'boost::detail'
libs\thread\src\win32\thread.cpp: At global scope:
libs\thread\src\win32\thread.cpp:170: error: '__stdcall' does not name a
type
libs\thread\src\win32\thread.cpp: In member function 'void
boost::thread::start_thread()':
libs\thread\src\win32\thread.cpp:194: error: 'thread_start_function' was not
declared in this scope
libs\thread\src\win32\thread.cpp:194: error: 'CREATE_SUSPENDED' was not
declared in this scope
libs\thread\src\win32\thread.cpp:194: error: 'struct
boost::detail::thread_data_base' has no member named 'id'
libs\thread\src\win32\thread.cpp:194: error: '_beginthreadex' was not
declared in this scope
libs\thread\src\win32\thread.cpp:195: error: in argument to unary !
libs\thread\src\win32\thread.cpp:199: error: 'intrusive_ptr_add_ref' was not
declared in this scope
libs\thread\src\win32\thread.cpp:200: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:201: error: 'ResumeThread' was not declared
in this scope
libs\thread\src\win32\thread.cpp: In constructor
'boost::<unnamed>::externally_launched_thread::externally_launched_thre
ad()':
libs\thread\src\win32\thread.cpp:215: error: 'count' was not declared in
this scope
libs\thread\src\win32\thread.cpp:216: error: 'interruption_enabled' was not
declared in this scope
libs\thread\src\win32\thread.cpp: In function 'void
boost::<unnamed>::make_external_thread_data()':
libs\thread\src\win32\thread.cpp:225: error: 'heap_new' is not a member of
'boost::detail'
libs\thread\src\win32\thread.cpp:225: error: expected primary-expression
before '>' token
libs\thread\src\win32\thread.cpp:225: error: expected primary-expression
before ')' token
libs\thread\src\win32\thread.cpp: In constructor
'boost::thread::thread(boost::detail::thread_move_tboost::thread)':
libs\thread\src\win32\thread.cpp:251: error: no match for 'operator=' in 'x.
boost::detail::thread_move_t<T>::operator->
[with T = boost::thread]()->boost::thread::thread_info = 0'
./boost/shared_ptr.hpp:194: note: candidates are: boost::shared_ptr<T>&
boost::shared_ptr<T>::operator=(const boost::sha
red_ptr<T>&) [with T = boost::detail::thread_data_base]
libs\thread\src\win32\thread.cpp: In member function 'void
boost::thread::join()':
libs\thread\src\win32\thread.cpp:292: error: 'interruptible_wait' is not a
member of 'boost::this_thread'
libs\thread\src\win32\thread.cpp:292: error: 'boost::detail::timeout' has
not been declared
libs\thread\src\win32\thread.cpp:293: error: 'release_handle' was not
declared in this scope
libs\thread\src\win32\thread.cpp: In member function 'bool
boost::thread::timed_join(const boost::system_time&)':
libs\thread\src\win32\thread.cpp:302: error: 'interruptible_wait' is not a
member of 'boost::this_thread'
libs\thread\src\win32\thread.cpp:306: error: 'release_handle' was not
declared in this scope
libs\thread\src\win32\thread.cpp: In member function 'void
boost::thread::detach()':
libs\thread\src\win32\thread.cpp:313: error: 'release_handle' was not
declared in this scope
libs\thread\src\win32\thread.cpp: At global scope:
libs\thread\src\win32\thread.cpp:316: error: no 'void
boost::thread::release_handle()' member function declared in class
'boost::thread'
libs\thread\src\win32\thread.cpp: In member function 'void
boost::thread::release_handle()':
libs\thread\src\win32\thread.cpp:319: error: no match for 'operator=' in
'((boost::thread*)this)->boost::thread::thread_
info = 0'
./boost/shared_ptr.hpp:194: note: candidates are: boost::shared_ptr<T>&
boost::shared_ptr<T>::operator=(const boost::sha
red_ptr<T>&) [with T = boost::detail::thread_data_base]
libs\thread\src\win32\thread.cpp: In member function 'void
boost::thread::interrupt()':
libs\thread\src\win32\thread.cpp:327: error: 'struct
boost::detail::thread_data_base' has no member named 'interrupt'
libs\thread\src\win32\thread.cpp: In member function 'bool
boost::thread::interruption_requested() const':
libs\thread\src\win32\thread.cpp:334: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:334: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
handle'
libs\thread\src\win32\thread.cpp: In static member function 'static unsigned
int boost::thread::hardware_concurrency()':
libs\thread\src\win32\thread.cpp:339: error: 'SYSTEM_INFO' was not declared
in this scope
libs\thread\src\win32\thread.cpp:339: error: expected `;' before 'info'
libs\thread\src\win32\thread.cpp:340: error: 'info' was not declared in this
scope
libs\thread\src\win32\thread.cpp:340: error: 'GetSystemInfo' was not
declared in this scope
libs\thread\src\win32\thread.cpp: At global scope:
libs\thread\src\win32\thread.cpp:344: error: 'native_handle_type' in class
'boost::thread' does not name a type
libs\thread\src\win32\thread.cpp:360: error: 'LARGE_INTEGER' does not name a
type
libs\thread\src\win32\thread.cpp:399: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:399: error: expected ',' or '...' before
'handle_to_wait_for'
libs\thread\src\win32\thread.cpp: In function 'bool
boost::this_thread::interruptible_wait(int)':
libs\thread\src\win32\thread.cpp:401: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:401: error: expected initializer before
'handles'
libs\thread\src\win32\thread.cpp:406: error: 'handle_to_wait_for' was not
declared in this scope
libs\thread\src\win32\thread.cpp:406: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:409: error: 'handles' was not declared in
this scope
libs\thread\src\win32\thread.cpp:411: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
enabled'
libs\thread\src\win32\thread.cpp:414: error: 'handles' was not declared in
this scope
libs\thread\src\win32\thread.cpp:414: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
handle'
libs\thread\src\win32\thread.cpp:417: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:417: error: expected initializer before
'timer_handle'
libs\thread\src\win32\thread.cpp:422: error: 'target_time' was not declared
in this scope
libs\thread\src\win32\thread.cpp:424: error: 'boost::detail::timeout' has
not been declared
libs\thread\src\win32\thread.cpp:424: error: expected initializer before
'const'
libs\thread\src\win32\thread.cpp:425: error: 'time_left' was not declared in
this scope
libs\thread\src\win32\thread.cpp:428: error: 'timer_handle' was not declared
in this scope
libs\thread\src\win32\thread.cpp:428: error: 'CreateWaitableTimer' was not
declared in this scope
libs\thread\src\win32\thread.cpp:431: error: 'LARGE_INTEGER' was not
declared in this scope
libs\thread\src\win32\thread.cpp:431: error: expected `;' before 'due_time'
libs\thread\src\win32\thread.cpp:433: error: 'due_time' was not declared in
this scope
libs\thread\src\win32\thread.cpp:433: error: 'SetWaitableTimer' was not
declared in this scope
libs\thread\src\win32\thread.cpp:437: error: 'handles' was not declared in
this scope
libs\thread\src\win32\thread.cpp:444: error: 'timeout' is not a member of
'boost::detail'
libs\thread\src\win32\thread.cpp:450: error: 'boost::detail::timeout' has
not been declared
libs\thread\src\win32\thread.cpp:450: error: expected initializer before
'time_left'
libs\thread\src\win32\thread.cpp:456: error: 'time_left' was not declared in
this scope
libs\thread\src\win32\thread.cpp:456: error: 'target_time' was not declared
in this scope
libs\thread\src\win32\thread.cpp:461: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:461: error: 'handles' was not declared in
this scope
libs\thread\src\win32\thread.cpp:461: error: 'INFINITE' was not declared in
this scope
libs\thread\src\win32\thread.cpp:461: error: 'time_left' was not declared in
this scope
libs\thread\src\win32\thread.cpp:470: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:470: error: invalid type in declaration
before '(' token
libs\thread\src\win32\thread.cpp:470: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
handle'
libs\thread\src\win32\thread.cpp:470: warning: unused variable 'ResetEvent'
libs\thread\src\win32\thread.cpp:481: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:481: error: invalid type in declaration
before '(' token
libs\thread\src\win32\thread.cpp:481: error: 'time_left' was not declared in
this scope
libs\thread\src\win32\thread.cpp:481: warning: unused variable 'Sleep'
libs\thread\src\win32\thread.cpp:483: error: 'target_time' was not declared
in this scope
libs\thread\src\win32\thread.cpp:485: error: 'boost::detail::timeout' has
not been declared
libs\thread\src\win32\thread.cpp:488: error: 'time_left' was not declared in
this scope
libs\thread\src\win32\thread.cpp: In function 'boost::detail::thread_id
boost::this_thread::get_id()':
libs\thread\src\win32\thread.cpp:494: error: no matching function for call
to 'boost::detail::thread_id::thread_id(boost
::detail::thread_data_base*)'
./boost/thread/pthread/thread.hpp:58: note: candidates are:
boost::detail::thread_id::thread_id()
./boost/thread/pthread/thread.hpp:52: note:
boost::detail::thread_id::thread_id(boost::detail::thread_da
ta_ptr)
./boost/thread/pthread/thread.hpp:48: note:
boost::detail::thread_id::thread_id(const boost::detail::thr
ead_id&)
libs\thread\src\win32\thread.cpp: In function 'void
boost::this_thread::interruption_point()':
libs\thread\src\win32\thread.cpp:501: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:501: error: invalid type in declaration
before '(' token
libs\thread\src\win32\thread.cpp:501: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
handle'
libs\thread\src\win32\thread.cpp:501: warning: unused variable 'ResetEvent'
libs\thread\src\win32\thread.cpp: In function 'bool
boost::this_thread::interruption_enabled()':
libs\thread\src\win32\thread.cpp:508: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
enabled'
libs\thread\src\win32\thread.cpp: In function 'bool
boost::this_thread::interruption_requested()':
libs\thread\src\win32\thread.cpp:513: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:513: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
handle'
libs\thread\src\win32\thread.cpp: In function 'void
boost::this_thread::yield()':
libs\thread\src\win32\thread.cpp:516: error: redefinition of 'void
boost::this_thread::yield()'
./boost/thread/pthread/thread.hpp:252: error: 'void
boost::this_thread::yield()' previously defined here
libs\thread\src\win32\thread.cpp:518: error: 'boost::detail::win32' has not
been declared
libs\thread\src\win32\thread.cpp:518: error: invalid type in declaration
before '(' token
libs\thread\src\win32\thread.cpp:518: warning: unused variable 'Sleep'
libs\thread\src\win32\thread.cpp: In constructor
'boost::this_thread::disable_interruption::disable_interruption()':
libs\thread\src\win32\thread.cpp:526: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
enabled'
libs\thread\src\win32\thread.cpp: In destructor
'boost::this_thread::disable_interruption::~disable_interruption()':
libs\thread\src\win32\thread.cpp:534: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
enabled'
libs\thread\src\win32\thread.cpp: In constructor
'boost::this_thread::restore_interruption::restore_interruption(boost::
this_thread::disable_interruption&)':
libs\thread\src\win32\thread.cpp:542: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
enabled'
libs\thread\src\win32\thread.cpp: In destructor
'boost::this_thread::restore_interruption::~restore_interruption()':
libs\thread\src\win32\thread.cpp:550: error: 'struct
boost::detail::thread_data_base' has no member named 'interruption_
enabled'
libs\thread\src\win32\thread.cpp: In function 'void
boost::detail::add_thread_exit_function(boost::detail::thread_exit_f
unction_base*)':
libs\thread\src\win32\thread.cpp:561: error: 'heap_new' was not declared in
this scope
libs\thread\src\win32\thread.cpp:561: error: expected primary-expression
before '>' token
libs\thread\src\win32\thread.cpp:562: warning: left-hand operand of comma
has no effect
libs\thread\src\win32\thread.cpp: In function 'void
boost::detail::set_tss_data(const void*, boost::shared_ptr ::dispose() [with P
= boost::detail::thread_data_base*, D = bool]':
libs\thread\src\win32\thread.cpp:627: instantiated from here
./boost/detail/sp_counted_impl.hpp:144: error:
'((boost::detail::sp_counted_impl_pd
participants (2)
-
CSB
-
Vladimir Prus