Boost logo

Boost Users :

Subject: [Boost-users] undefined reference to '__sync_add_and_fetch_4' when cross-compiling boost::asio fors mips
From: Jayne (jayne_at_[hidden])
Date: 2012-02-16 04:06:40


 I'm trying to build Boost 1.48.0 for use with the WebSockets++ library on
a MIPS based embedded Linux board.

 My build machine reports itself as: Linux version
(mockbuild_at_[hidden]) (gcc version 4.6.0 20110603 (Red
Hat 4.6.0-10) (GCC) ) #1 SMP Tue Aug 30 14:38:32 UTC 2011

 My cross-compiler version is:  mipsel-linux-g++ (GCC) 4.2.0 20070124
(prerelease) - BRCM 11ts-20090508. I don't have any control over this as
its provided by the chip manufacturer.

 I can build Boost without any reported errors and can link to and use
most of the libraries without any problems. However, when WebSockets tries
to link to the Boost::asio library I get link errors like this:

undefined reference to `__sync_add_and_fetch_4'

undefined reference to `__sync_add_and_fetch_4'

more undefined references to `__sync_add_and_fetch_4' follow I've done
enough research to find this has been a problem in the past with ARM chips
and is to do with atomic transactions not being implemented by gcc for the
target machine. I've tried the suggested fixes for ARM which were to build
didn't help with my MIPS environment.

 Can anyone make any suggestions as to what I could try next?




Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at