Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 652098

Summary: =dev-db/redis-4.0.2-r1 fails to build on platforms without builtin support for 8-byte atomics (need -latomic): undefined reference to `__atomic_fetch_add_8'
Product: Gentoo Linux Reporter: Sergei Trofimovich (RETIRED) <slyfox>
Component: Current packagesAssignee: Ultrabug <ultrabug>
Status: RESOLVED FIXED    
Severity: normal CC: erhard_f, hydrapolic, ppc, robbat2
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/14402
https://github.com/gentoo/gentoo/pull/14994
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: dev-db-redis-4.0.2-r1-build.log
build.log

Description Sergei Trofimovich (RETIRED) gentoo-dev 2018-03-31 18:47:22 UTC
Created attachment 526208 [details]
dev-db-redis-4.0.2-r1-build.log

Build fails as:

timberdoodle /dev/shm/portage/dev-db/redis-4.0.2-r1/work/redis-4.0.2 # LANG=C make V=1
cd src && make all
make[1]: Entering directory '/dev/shm/portage/dev-db/redis-4.0.2-r1/work/redis-4.0.2/src'
powerpc-unknown-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu  -rdynamic -o redis-server adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o ../deps/hiredis/libhiredis.a -lm -llua -lm -ldl -pthread -ljemalloc -ldl
networking.o: In function `createClient':
networking.c:(.text+0x1fc): undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:193: redis-server] Error 1
make[1]: Leaving directory '/dev/shm/portage/dev-db/redis-4.0.2-r1/work/redis-4.0.2/src'
make: *** [Makefile:6: all] Error 2

Adding -latomic to LDFLAGS makes it link correctly.
Comment 1 Tomáš Mózes 2018-04-03 11:05:01 UTC
Sergei, would you mind reporting this upstream please?
Comment 2 ernsteiswuerfel archtester 2018-07-08 21:03:19 UTC
Created attachment 538862 [details]
build.log

Same here with dev-db/redis-4.0.10.
Comment 4 ernsteiswuerfel archtester 2020-01-21 01:48:25 UTC
(In reply to Tomáš Mózes from comment #3)
> Please test if it works with
> https://github.com/antirez/redis/commit/
> f5d48537f1aa76e5ce4f14953517bd25c9ad4673#diff-
> f57f2991a6aa25fe45d8036c51bf8b4d
For a crude test I used this modification instead of the original patch, which works on ppc:

+ifneq (,$(filter powerpc ppc,$(uname_M)))
+        FINAL_LIBS+=-latomic
+else
+ifneq (,$(findstring ppc,$(uname_M)))
+        FINAL_LIBS+=-latomic
+endif
+endif
+
Comment 5 Larry the Git Cow gentoo-dev 2020-03-20 14:53:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb20cb4fc5767f864df20caa4a499ab0c6599b13

commit cb20cb4fc5767f864df20caa4a499ab0c6599b13
Author:     Tomáš Mózes <hydrapolic@gmail.com>
AuthorDate: 2020-03-17 19:52:00 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-03-20 14:52:13 +0000

    dev-db/redis: bump to 5.0.8
    
    Closes: https://bugs.gentoo.org/652098
    Tested-by: ernsteiswuerfel <erhard_f@mailbox.org>
    Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/14994
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 dev-db/redis/Manifest                           |   1 +
 dev-db/redis/files/redis-5.0.8-ppc-atomic.patch |  19 +++
 dev-db/redis/redis-5.0.8.ebuild                 | 160 ++++++++++++++++++++++++
 3 files changed, 180 insertions(+)