#3 tests/test_mpmc compilation error on AS5 Redhat Linux

closed
nobody
None
5
2012-11-10
2012-05-18
X Z
No

make test_mpmc
g++ -Wno-strict-aliasing -I. -I../ -Wall -O6 -finline-functions -o test_mpmc test_mpmc.cpp -lpthread
/tmp/cc2Eb33b.o: In function `C(void*)':
test_mpmc.cpp:(.text+0xacf): undefined reference to `__sync_val_compare_and_swap_4'
test_mpmc.cpp:(.text+0xbc7): undefined reference to `__sync_val_compare_and_swap_4'
/tmp/cc2Eb33b.o: In function `P(void*)':
test_mpmc.cpp:(.text+0xdd5): undefined reference to `__sync_val_compare_and_swap_4'
test_mpmc.cpp:(.text+0xe22): undefined reference to `__sync_val_compare_and_swap_4'
test_mpmc.cpp:(.text+0xe4a): undefined reference to `__sync_val_compare_and_swap_4'
/tmp/cc2Eb33b.o:test_mpmc.cpp:(.text+0x132a): more undefined references to `__sync_val_compare_and_swap_4' follow

The error caused is because that for a 4.1.x gcc compiler, -march=i686 is not included into compilation options.

Change the Makefile to

test_mpmc:test_mpmc.cpp
$(CXX) -Wno-strict-aliasing $(INCLUDES) $(CXXFLAGS) $(ARCH) $(OPTIMIZE_FLAGS) -o $@ $< $(LDFLAGS) $(LIBS)

It will help to pass compilation of test_mpmc

Discussion

    • status: open --> closed
     
  • The problem should have been fixed in the last commit (n. 45) into the svn. Many thanks for reporting it !