On 28/08/2012 6:25 a.m., Jeff Gerard wrote:
I am looking for help in determining why my compile will not work.

I have been running into the following errors during compile:

/root/work/squid-3.2.1/src/ipc/../../src/ipc/AtomicWord.h:47: undefined 
reference to `__sync_fetch_and_add_4'
ipc/.libs/libipc.a(PageStack.o):/root/work/squid-3.2.1/src/ipc/../../src/ipc/AtomicWord.h:47:
 more undefined references to `__sync_fetch_and_add_4' follow
ipc/.libs/libipc.a(PageStack.o): In function `Ipc::Atomic::WordT<unsigned 
int>::swap_if(unsigned int, unsigned int)':
/root/work/squid-3.2.1/src/ipc/../../src/ipc/AtomicWord.h:38: undefined 
reference to `__sync_bool_compare_and_swap_4'
ipc/.libs/libipc.a(PageStack.o): In function 
`Ipc::Atomic::WordT<int>::swap_if(int, int)':
/root/work/squid-3.2.1/src/ipc/mem/PageStack.cc:88: undefined reference to 
`__sync_bool_compare_and_swap_4'
ipc/.libs/libipc.a(PageStack.o): In function 
`Ipc::Atomic::WordT<int>::operator+=(int)':
/root/work/squid-3.2.1/src/ipc/../../src/ipc/AtomicWord.h:31: undefined 
reference to `__sync_add_and_fetch_4'

For some reason your system header files are defining those __sync symbols but the libc which is being linked against does not contain them.

Please check your system for multiple libc libraries and ensure only one version is installed (latest by version is best) or that CXXFLAGS is passed arguments to identify the latest one explicitly.

collect2: ld returned 1 exit status
libtool: link: rm -f ".libs/squidS.o"
make[3]: *** [squid] Error 1
make[3]: Leaving directory `/root/work/squid-3.2.1/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/work/squid-3.2.1/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/work/squid-3.2.1/src'
make: *** [all-recursive] Error 1

I am running this on Fedora Core 6 (have been running 3.1.20 with no issue) and 
gcc version is 4.1.2

3.1 series contains no SMP support or atomic operations.

AMos

Reply via email to