Boost logo

Boost Users :

Subject: Re: [Boost-users] M68K-Coldfire: Boost 1.44 seems to have a problem with low level locking
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2010-09-14 16:16:02


Andreas Wehrmann wrote:

> Hello,
>
> I recently upgraded boost on my embedded linux platform (m68k coldfire
> architecture)
> from version 1.41 (cmake release) to 1.44.
> Boost itself compiles flawlessly but when I tried to link my application
> (which makes use of the thread, regex, system libraries) it fails with
> (note the last line):
>
> squ_loopback_timer.o: In function
> `boost::asio::detail::wait_handler<boost::_bi::bind_t<void,
> boost::_mfi::mf1<void, rapp::squ_loopback_timer_t,
> boost::system::error_code const&>,
> boost::_bi::list2<boost::_bi::value<rapp::squ_loopback_timer_t*>,
> boost::arg<1> > >
> >::do_complete(boost::asio::detail::task_io_service*,
> boost::asio::detail::task_io_service_operation*,
> boost::system::error_code, unsigned int)':
> squ_loopback_timer.cpp:
(.text._ZN5boost4asio6detail12wait_handlerINS_3_bi6bind_tIvNS_4_mfi3mf1IvN4rapp20squ_loopback_timer_tERKNS_6system10error_codeEEENS3_5list2INS3_5valueIPS8_EENS_3argILi1EEEEEEEE11do_completeEPNS1_15task_io_serviceEPNS1_25task_io_service_operationESA_j[boost::asio::detail::wait_handler<boost::_bi::bind_t<void,
> boost::_mfi::mf1<void, rapp::squ_loopback_timer_t, boost::system::error_code const&>,
> boost::_bi::list2<boost::_bi::value<rapp::squ_loopback_timer_t*>, boost::arg<1> > >
> >::do_complete(boost::asio::detail::task_io_service*,
> boost::asio::detail::task_io_service_operation*, boost::system::error_code, unsigned int)]+0x72):
> undefined reference to `__sync_lock_test_and_set_4'
>
> What changed about the locking mechanism?

Boost is now using gcc atomics, but it assumes them to be available everywhere, which is not the
case. Adding

        define=BOOST_SP_DISABLE_THREADS

or

        define=BOOST_SP_USE_PTHREADS

to build command should fix this error (at the price of either thread safety or performance)

> Btw. I'm also using boost version 1.38 in another project (but on the
> same platform).
> My compiler is g++ version 4.2.0 20070318 (prerelease) (Sourcery G++
> Lite 4.2-35).

That's pretty old compiler, our current lite releases are 4.4-*. However, upgrading is not
likely to fix your immediate issue.

- Volodya


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