Problem building 1.6.5 in clients/ms_conn.o
I am trying to build from source membase-server-community_1.6.5 but I get following error (my gcc and g++ version is 4.3.2 and I am building on Fedora Core 10) :
mv -f $depbase.Tpo $depbase.Po
/bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -pthread -pipe -O0 -DDEBUG -fvisibility=hidden -pedantic -Wall -Wundef -Wshadow -fdiagnostics-show-option -Wstrict-aliasing -Wextra -Wformat -Wno-format-nonliteral -Wno-format-security -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align -Wswitch-default -Wswitch-enum -Wwrite-strings -Wlogical-op -L/tmp/membase-build/lib -o clients/memslap clients/memslap.o clients/ms_conn.o clients/ms_setting.o clients/ms_sigsegv.o clients/ms_stats.o clients/ms_task.o clients/ms_thread.o -levent clients/libgenexec.la -lm clients/libutilities.la libmemcached/libmemcached.la -lsasl2 -lrt
libtool: link: gcc -std=gnu99 -pthread -pipe -O0 -DDEBUG -fvisibility=hidden -pedantic -Wall -Wundef -Wshadow -fdiagnostics-show-option -Wstrict-aliasing -Wextra -Wformat -Wno-format-nonliteral -Wno-format-security -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align -Wswitch-default -Wswitch-enum -Wwrite-strings -Wlogical-op -o clients/memslap clients/memslap.o clients/ms_conn.o clients/ms_setting.o clients/ms_sigsegv.o clients/ms_stats.o clients/ms_task.o clients/ms_thread.o -L/tmp/membase-build/lib -levent clients/.libs/libgenexec.a clients/.libs/libutilities.a libmemcached/.libs/libmemcached.a -lm -lsasl2 -lrt -pthread
clients/ms_conn.o: In function `ms_get_udp_request_id':
/data/tools/src/membase-server-community_1.6.5_src/libmemcached/clients/ms_conn.c:194: undefined reference to `__sync_fetch_and_add_4'
clients/ms_conn.o: In function `ms_reconn':
/data/tools/src/membase-server-community_1.6.5_src/libmemcached/clients/ms_conn.c:919: undefined reference to `__sync_fetch_and_add_4'
/data/tools/src/membase-server-community_1.6.5_src/libmemcached/clients/ms_conn.c:956: undefined reference to `__sync_fetch_and_add_4'
clients/ms_conn.o: In function `ms_reconn_socks':
/data/tools/src/membase-server-community_1.6.5_src/libmemcached/clients/ms_conn.c:1051: undefined reference to `__sync_fetch_and_add_4'
clients/ms_thread.o: In function `ms_setup_thread':
/data/tools/src/membase-server-community_1.6.5_src/libmemcached/clients/ms_thread.c:196: undefined reference to `__sync_fetch_and_add_4'
clients/ms_thread.o:/data/tools/src/membase-server-community_1.6.5_src/libmemcached/clients/ms_thread.c:208: more undefined references to `__sync_fetch_and_add_4' follow
collect2: ld returned 1 exit status
make[3]: *** [clients/memslap] Error 1
make[3]: Leaving directory `/data/tools/src/membase-server-community_1.6.5_src/libmemcached'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/data/tools/src/membase-server-community_1.6.5_src/libmemcached'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/data/tools/src/membase-server-community_1.6.5_src/libmemcached'
make: *** [libmemcached/libmemcached/libmemcached.la] Error 2
Does anyone have any clue??
Analyzing source file libmemcached/clients/ms_conn.c I found out that error occurs in every location where a call to 'atomic_add_32_nv' function is made... On the other hand calls to 'atomic_add_32' dont generate errors, is it possible to use 'atomic_add_32' everywhere?