-
Notifications
You must be signed in to change notification settings - Fork 23.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Raspberry Pi] 5.0.4 Build fail : undefined reference to __atomic_fetch_add_8' #6275
Comments
Adding "-latomic" as library is correct. I hope it helps |
Any progress on this one ? It still doesn't build... |
@qpernil unfortunately I've not had time to see how best to propose a fix that won't also potentially break other Redis builds... However, if you edit
and then run |
OK, Thanks @AngusP |
Had the same issue. But I can confirm that the compilation of Redis 5.0.7 on Raspbian 10 (Buster) is successful after changing
to
in |
Yes, I can also confirm it works. |
Please @qpernil could you try if instead of using -latomic directly there, it works with the following patch? diff --git a/src/Makefile b/src/Makefile
index 9fc230f9..e6773198 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -77,6 +77,15 @@ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
FINAL_LIBS=-lm
DEBUG=-g -ggdb
+# Linux ARM needs -latomic at linking time
+ifneq (,$(filter aarch64 armv,$(uname_M)))
+ FINAL_LIBS+=-latomic
+else
+ifneq (,$(findstring armv,$(uname_M)))
+ FINAL_LIBS+=-latomic
+endif
+endif
+
ifeq ($(uname_S),SunOS)
# SunOS
ifneq ($(@@),32bit) Thank you |
ping @LucidSkyWalker to see if it's possible to get the patch tested. The problem is that I don't want it to break other builds. Right now my Pi3 looks dead unfortunately, I'll have to resurrect it. |
@antirez I’ve also got a handful of Pis, just not found time to test it yet, will try and do so soon if I don’t get beaten to it |
Thanks a lot @AngusP :-) I'll try to resurrect mine at the same time to have a larger test base, especially since I believe I've a version of the distribution that does not need -latomic, to check if it may create problems in that case. |
+@rafie may be able to help too. |
So, build succeeds and tests pass on all the Pis I have access to 🍾 (well, except some tests time out sometimes) All running Raspbian 10, building the 5.0.7 release with the above Makefile patch given by @antirez. on a Pi 4 Model B (BCM2835 rev. c03111quad core, 4GB RAM) on a Pi ZeroW v1.1 (BCM2835 rev. 9000c1 single core) (this took a while!) on a Pi 3 Model B v1.2 (BCM2835 rev. a22082 quad core) |
Thanks @AngusP! Fix pushed. |
Sorry for not finding time to help with this... Next time.. |
Thanks anyway! |
Hi Salvatore,
I have now tested this on a Raspberry pi 3B+ and a 4B (2Gb), both running
Buster. It worked perfectly.
I also applied the patch on Catalina 10.15.1, and Ubuntu eoan with no ill
effects (I ran make test on all four machines).
Thanks !
/Per
|
只要修改src/Makefile 中的 FINAL_LIBS=-lm -latomic 就能运行了 亲测有用 |
Is this merged into any other branch than unstable ? |
It doesn't look like it this has been merged into GitLab is mirroring this repository, the gitlab-omnibus installer uses this mirror as a dependency. We are seeing this same @AngusP do you intend to backport this fix to 5.0 branch? If that is your intention, but you're short on time I am happy to create the PR. Maybe we should reopen this issue. |
@dustinmm80 as far as I can see it'd be fine to backport to any maintained version as it's just a Makefile fix (e9564dc); go ahead if you'd like it, I am a little short on time unfortunately |
On a Raspberry Pi 3 v1.2, and also on I think a Zero W v1.1, but probably all RPis running Raspbian 10 'Buster', the build fails to link
atomic
--undefined reference to __atomic_fetch_add_8'
This is easily fixed by 'hacking' a
-latomic
in to the build flags, though I'm not too familiar with the Makefile and where best to add such a link without breaking stuff, so haven't PR'dThis seems similar to #5550
The text was updated successfully, but these errors were encountered: