饭随笔

导航

执行安装redis报错undefined reference to `__sync_add_and_fetch_4'

执行make命令时报错:
 
zmalloc.o: In function `zmalloc_used_memory':
/var/lib/tcommsvr/redis-2.8.0-rc4/src/zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4'
collect2: ld returned 1 exit status
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/var/lib/tcommsvr/redis-2.8.0-rc4/src'
make: *** [all] Error 2
 
产生原因:
 
linux为32位版本。
查看方式:getconf LONG_BIT
 
 
解决办法:
 
执行make命令时加参数:make CFLAGS="-march=i686"

posted on 2014-02-17 09:30  饭随笔  阅读(2722)  评论(0编辑  收藏  举报