#62848 closed defect (fixed)
redis @6.2.3: Undefined symbols ___atomic_compare_exchange_8 ___atomic_fetch_add_8 ___atomic_load_8
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | dgilman (David Gilman) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.4 |
Keywords: | snowleopard i386 | Cc: | |
Port: | redis |
Description
redis 6.2.3 fails to build on 10.6 i386:
Undefined symbols for architecture i386: "___atomic_compare_exchange_8", referenced from: _hdr_record_values_atomic in hdr_histogram.o "___atomic_fetch_add_8", referenced from: _hdr_record_values_atomic in hdr_histogram.o "___atomic_load_8", referenced from: _hdr_record_values_atomic in hdr_histogram.o ld: symbol(s) not found for architecture i386
This is a new problem... 6.0.10 built fine on that system.
Change History (5)
comment:1 Changed 3 years ago by barracuda156
comment:2 follow-up: 3 Changed 3 years ago by kencu (Ken)
clang-9, and some other clangs, need to have this tweak added:
for a build using some newer gcc, you will have to add in a link to libatomic:
configure.ldflags-append -latomic
comment:3 Changed 3 years ago by barracuda156
Replying to kencu:
clang-9, and some other clangs, need to have this tweak added:
for a build using some newer gcc, you will have to add in a link to libatomic:
configure.ldflags-append -latomic
Thank you! It worked.
comment:4 Changed 2 years ago by dgilman (David Gilman)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:5 Changed 2 years ago by kencu (Ken)
So the way to fix this libatomic thing is:
use a clang that has i386 atomics enabled (see above. clang used to default to having atomics enabled in compiler_rt, then the default changed we had to specifically enable it again .. I think I fixed all or nearly all of them).
or, only when building with gcc (or more specifically, when building against libgcc, which contains libatomic), add -latomic to the linker flags.
It is indeed some spaghetti to cover off all these permutations. Quite a few configure scripts will test to see if adding libatomic is required to support atomics.
For those that don't, in practical terms, what we usually do is something like this pseudo-code:
if {test for compiler being gcc} { configure.ldflags-append -latomic }
Is there a solution?
libfilezilla
@0.36.0 fails with the same error.