Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2525: More architectures that do not support __sync_fetch_and_add_4
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-03-09 03:15:28
#2525: More architectures that do not support __sync_fetch_and_add_4
----------------------------------------------+-----------------------------
Reporter: Steven Robbins <smr_at_[hidden]> | Owner: pdimov
Type: Bugs | Status: reopened
Milestone: Boost 1.39.0 | Component: smart_ptr
Version: Boost 1.37.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------------------+-----------------------------
Comment(by smr_at_[hidden]):
On the sparc to which I have access (a sparc64 running Debian Linux), I
can attest that g++ 4.2 does *not* have all the !__sync primitives used in
Boost. I created a test program using all the primitives I could find
with "rgrep !__sync_ *" in the Boost root source directory (SVN head).
Here is the transcript.
{{{
(sid)smr_at_smetana:~$ uname -a
Linux smetana 2.6.26-1-sparc64-smp #1 SMP Sat Jan 10 18:53:17 UTC 2009
sparc64 GNU/Linux
(sid)smr_at_smetana:~$ cat sync-primitives.cc
/* Test that uses all the __sync primitives found
by grepping the boost sources.
*/
int main( int ac, char* av[] )
{
long value = 0;
__sync_lock_release( &value );
return __sync_fetch_and_add( &value, 1 )
+ __sync_val_compare_and_swap( &value, 1, 2 )
+ __sync_add_and_fetch( &value, 1 )
+ __sync_lock_test_and_set( &value, 1 );
}
(sid)smr_at_smetana:~$ g++-4.1 sync-primitives.cc
/tmp/ccGOFRyI.o: In function `main':
sync-primitives.cc:(.text+0x24): undefined reference to
`__sync_fetch_and_add_4'
sync-primitives.cc:(.text+0x44): undefined reference to
`__sync_val_compare_and_swap_4'
sync-primitives.cc:(.text+0x60): undefined reference to
`__sync_add_and_fetch_4'
sync-primitives.cc:(.text+0x7c): undefined reference to
`__sync_lock_test_and_set_4'
collect2: ld returned 1 exit status
(sid)smr_at_smetana:~$ g++-4.2 sync-primitives.cc
/tmp/ccQg4NKe.o: In function `main':
sync-primitives.cc:(.text+0x28): undefined reference to
`__sync_fetch_and_add_4'
sync-primitives.cc:(.text+0x48): undefined reference to
`__sync_val_compare_and_swap_4'
sync-primitives.cc:(.text+0x64): undefined reference to
`__sync_add_and_fetch_4'
collect2: ld returned 1 exit status
(sid)smr_at_smetana:~$ g++-4.3 sync-primitives.cc
/tmp/cc8anhqk.o: In function `main':
sync-primitives.cc:(.text+0x28): undefined reference to
`__sync_fetch_and_add_4'
sync-primitives.cc:(.text+0x48): undefined reference to
`__sync_val_compare_and_swap_4'
sync-primitives.cc:(.text+0x64): undefined reference to
`__sync_add_and_fetch_4'
collect2: ld returned 1 exit status
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2525#comment:6> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC