使用Raspbian Buster在新RaspberryPi 4上的Redis构建失败

时间:2019-06-25 22:36:42

标签: raspberry-pi raspbian debian-buster

尝试在最新的redis-stable上运行的raspbian buster上构建Raspberry Pi 4(应为5.0.5)时,出现链接器错误

make经过这些动作,然后失败,并显示以下内容

    LINK redis-server
/usr/bin/ld: networking.o: in function `createClient':
/home/pi/redis-stable/src/networking.c:109: undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:219: redis-server] Error 1
make[1]: Leaving directory '/home/pi/redis-stable/src'
make: *** [Makefile:6: all] Error 2

我在某处缺少设置吗?

2 个答案:

答案 0 :(得分:2)

通过仅将编译器标志-latomic添加到redis-server

,我能够使所有测试成功运行
# redis-server                                                                                                                                                
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)                                                                                                                     
        $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS) -latomic

编辑:这是Redis 5.0.5的

答案 1 :(得分:0)

我只能通过向haproxy添加编译器标志-latomic来运行

[错误]

/home/pi/CQ/LB/haproxy-1.8.21/src/proto_http.c:12152: undefined reference to `__atomic_fetch_add_8'
..........................................
..........................................
/usr/bin/ld: src/proto_http.o:/home/pi/CQ/LB/haproxy-1.8.21/src/proto_http.c:4200: more undefined references to `__atomic_fetch_add_8' follow
/usr/bin/ld: src/time.o: in function `tv_update_date':
/home/pi/CQ/LB/haproxy-1.8.21/src/time.c:229: undefined reference to `__atomic_compare_exchange_8'
collect2: error: ld returned 1 exit status
make: *** [Makefile:914: haproxy] error 1

[添加]

913 haproxy: $(OPTIONS_OBJS) $(EBTREE_OBJS) $(OBJS)
914          $(LD) $(LDFLAGS) -o $@ $^ $(LDOPTS) -latomic