Welcome! Log In Create A New Profile

Advanced

undefined reference to `__sync_fetch_and_add_4

Posted by Bill Moseley 
Bill Moseley
undefined reference to `__sync_fetch_and_add_4
July 27, 2010 08:20PM
Building the Memcached-libmemcached-0.4201 Perl module and I get the
following:

...
CC clients/ms_thread.o
CCLD clients/memslap
clients/ms_conn.o: In function `ms_get_udp_request_id':
/home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_conn.c:194:
undefined reference to `__sync_fetch_and_add_4'
clients/ms_conn.o: In function `ms_reconn_socks':
/home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_conn.c:1051:
undefined reference to `__sync_fetch_and_add_4'
clients/ms_conn.o: In function `ms_reconn':
/home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_conn.c:919:
undefined reference to `__sync_fetch_and_add_4'
/home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_conn.c:956:
undefined reference to `__sync_fetch_and_add_4'
clients/ms_thread.o: In function `ms_setup_thread':
/home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_thread.c:225:
undefined reference to `__sync_fetch_and_add_4'
clients/ms_thread.o:/home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_thread.c:208:
more undefined references to `__sync_fetch_and_add_4'

--
Bill Moseley
moseley@hank.org
KaiGai Kohei
Re: undefined reference to `__sync_fetch_and_add_4
July 28, 2010 01:40AM
(2010/07/28 3:11), Bill Moseley wrote:
> Building the Memcached-libmemcached-0.4201 Perl module and I get the
> following:
>
> ...
> CC clients/ms_thread.o
> CCLD clients/memslap
> clients/ms_conn.o: In function `ms_get_udp_request_id':
> /home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_conn.c:194:
> undefined reference to `__sync_fetch_and_add_4'
> clients/ms_conn.o: In function `ms_reconn_socks':
> /home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_conn.c:1051:
> undefined reference to `__sync_fetch_and_add_4'
> clients/ms_conn.o: In function `ms_reconn':
> /home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_conn.c:919:
> undefined reference to `__sync_fetch_and_add_4'
> /home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_conn.c:956:
> undefined reference to `__sync_fetch_and_add_4'
> clients/ms_thread.o: In function `ms_setup_thread':
> /home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_thread.c:225:
> undefined reference to `__sync_fetch_and_add_4'
> clients/ms_thread.o:/home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_thread.c:208:
> more undefined references to `__sync_fetch_and_add_4'
>
It is a localism of GCC.

http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html

Thanks,
--
KaiGai Kohei <[email protected]>
Bill Moseley
Re: undefined reference to `__sync_fetch_and_add_4
July 28, 2010 01:50AM
2010/7/27 KaiGai Kohei <[email protected]>

>
> >
> clients/ms_thread.o:/home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_thread.c:208:
> > more undefined references to `__sync_fetch_and_add_4'
> >
> It is a localism of GCC.
>
> http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html


I'm not clear about the problem. I assume it means my platform doesn't
support it. Should configure figure out that it's not supported on this
platform? Or am I missing a library?

Or more to the point, what do I need to do to get it to build?

Configuration summary for libmemcached version 0.42

* Installation prefix:
/home/bill/.cpan/build/Memcached-libmemcached-0.
4201-iS0dnh/src_inst
* System type: pc-linux-gnu
* Host CPU: i686
* C Compiler: gcc (GCC) 4.1.2 (Gentoo 4.1.2)
* Assertions enabled: yes
* Debug enabled: no
* Warnings as failure: no



--
Bill Moseley
moseley@hank.org
KaiGai Kohei
Re: undefined reference to `__sync_fetch_and_add_4
July 28, 2010 02:10AM
(2010/07/28 8:45), Bill Moseley wrote:
>
>
> 2010/7/27 KaiGai Kohei <[email protected] <mailto:[email protected]>>
>
>
> >
> clients/ms_thread.o:/home/bill/.cpan/build/Memcached-libmemcached-0.4201-nWi5dF/src/libmemcached/clients/ms_thread.c:208:
> > more undefined references to `__sync_fetch_and_add_4'
> >
> It is a localism of GCC.
>
> http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html
>
>
> I'm not clear about the problem. I assume it means my platform doesn't
> support it. Should configure figure out that it's not supported on this
> platform? Or am I missing a library?
>
> Or more to the point, what do I need to do to get it to build?
>
> Configuration summary for libmemcached version 0.42
>
> * Installation prefix:
> /home/bill/.cpan/build/Memcached-libmemcached-0.
> 4201-iS0dnh/src_inst
> * System type: pc-linux-gnu
> * Host CPU: i686
> * C Compiler: gcc (GCC) 4.1.2 (Gentoo 4.1.2)
> * Assertions enabled: yes
> * Debug enabled: no
> * Warnings as failure: no
>
I found some people who face similar problem:

http://sourceware.org/ml/libc-alpha/2007-02/msg00008.html
http://sourceware.org/ml/libc-alpha/2007-02/msg00009.html

http://djodjo.jp/archives/359

Should it be handled by configure script?

--
KaiGai Kohei <[email protected]>
Sorry, only registered users may post in this forum.

Click here to login