Boost logo

Boost Users :

Subject: Re: [Boost-users] undefined reference to `__sync_fetch_and_add_4'
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-04-24 12:53:26


Peter Dimov wrote:

> Birju Prajapati:
>
>> g++ -m32 [...]
>
>> /usr/local/lib32/libboost_serialization-gcc43-mt.so: undefined reference
>> to `__sync_fetch_and_add_4'
>
> This is weird. __sync_fetch_and_add is used by shared_ptr and atomic_count,
> but in both places, the earlier
>
> #elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined(
> __x86_64__ ) )
>
> takes precedence, and I have verified that g++ -m32 does indeed define
> __i386__.
>
> This could be caused by an issue we've identified recently of libstdc++
> standard headers using __sync_fetch_and_add as part of their reference
> counted implementation of std::string and std::locale.

Or probably by the fact that -m32 was not, in fact, passed to compiler
when building boost.

- 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