Boost logo

Boost Users :

Subject: Re: [Boost-users] libboost_date_time: undefined referenceto __sync_fetch_and_add_4
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-04-04 10:22:55


Carsten Raas:
>> Did you rebuild date_time itself with this change?
>
> Yes, I did.
>
> I followed the hint of Peter Dimov in
> http://lists.boost.org/Archives/boost/2008/04/135521.php

That's very odd. It's true that Datetime uses shared_ptr, and that
shared_ptr uses __sync_fetch_and_add on some platforms, but it shouldn't on
Intel x64 because:

#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) &&
!defined( __arm__ ) && !defined( __hppa ) && ( !defined( __INTEL_COMPILER )
|| defined( __ia64__ ) )
# include <boost/detail/sp_counted_base_sync.hpp>

so I've no idea where the reference to __sync_fetch_and_add comes from. Can
you try rebuilding Datetime with

    #define __sync_fetch_and_add ERROR

and see what in Boost is trying to make use of it?

(The other alternative is that libstdc++ itself is using
__sync_fetch_and_add in a header.)


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