Skip to content
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

[BUG] passing CFLAGS="_latomic" does not solve the standard missing libstdc++ atomic support #10426

Open
egbertn opened this issue Mar 14, 2022 · 5 comments

Comments

@egbertn
Copy link

egbertn commented Mar 14, 2022

Describe the bug

We need a way to get atomic support for GCC in the make process. On ARM7 e.g. we get
/usr/bin/ld: server.o: in function resetServerStats': path/redis-6.2.6/src/server.c:3115: undefined reference to __atomic_store_8'
To reproduce

download redis-6.2.6.
run
make USE_SYSTEMD=yes BUILD_TLS=yes
or try
make USE_SYSTEMD=yes BUILD_TLS=yes CFLAGS="_latomic"

Expected behavior

finished & succeeded build

Additional information

In some architectures, e.g. ARM, support for atomic in libc is missing]

@egbertn egbertn changed the title [BUG] passing CFLAGS="_latomic" does not solve the standard missing GCC atomic support [BUG] passing CFLAGS="_latomic" does not solve the standard missing libstdc++ atomic support Mar 14, 2022
@yossigo
Copy link
Member

yossigo commented Mar 14, 2022

@egbertn I guess you're referring to libc, not libstdc++ (Redis is not written in C++).
I see this is already checked by the Makefile, can you please provide some more information:

  • What OS / compiler do you use?
  • What does uname -a produce on your system?

@egbertn
Copy link
Author

egbertn commented Mar 14, 2022

Linux ... 5.15.27-v8+ #1531 SMP PREEMPT Wed Mar 9 11:36:50 GMT 2022 aarch64 GNU/Linux
gcc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110
cc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110

@egbertn
Copy link
Author

egbertn commented Mar 14, 2022

if I execute this... I get 'yes'

echo "#include <stdatomic.h>" > foo.c; cc -std=c11 -c foo.c -o foo.o > /dev/null 2>&1; if [ -f foo.o ]; then echo "yes"; rm foo.o; fi;

@yossigo
Copy link
Member

yossigo commented Mar 15, 2022

@egbertn So apparently we dropped -latomic on aarch64 because it is not always needed or available (see #8839), but this is probably not universally correct. We'll need to come up with a more reliable method to determine that.

@egbertn
Copy link
Author

egbertn commented Mar 15, 2022

@yossigo Great. FYI when I hard code it to '' instead of 'yes' it also fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants