编译redis2.6.2报zmalloc.c:223: undefined reference to__sync_add_and_fetch_4'解决方法

在vps上面编译redis 2.6 由于系统有点老,以至于编不过,报错undefined reference to__sync_add_and_fetch_4',google了下,发现好多人遇到我同样的问题,

zmalloc.o: In function zmalloc_used_memory':
/home/xx/redis-2.6.2/src/zmalloc.c:223: undefined reference to
__sync_add_and_fetch_4'
collect2: ld 返回 1
make[1]: *** [redis-server] 错误 1
make[1]: Leaving directory `/home/xx/redis-2.6.2/src'
make: *** [all] 错误 2

github上面一兄弟在src/Makefile开头加 CFLAGS= -march=i686解决了,但是我试了。继续google,发现google group里有个兄弟编辑了下src/.make_settings里的OPT,改为OPT=-O2 -march=i686。

make过了,但是接下来make test又过不了。报错如下

You need 'tclsh8.5' in order to run the Redis test

查了下资料,说是要最新的tcl,那就给你装个最新的吧http://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html

安装完后,总算可以了.原文出处http://marspring.mobi/redis-compile/

 

参考资料:

https://github.com/antirez/redis/issues/736
https://groups.google.com/forum/#!msg/redis-db/NI_d00he39o/7GLi8uwZ1HEJ

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值