Clang requires libatomic to be linked via LDFLAGS
Clang requires the libatomic to be linked via LDFLAGS or else the linker will fail to recognise __atomic macros. An error as a result of not passing -latomic to the linker can be seen below: ld.lld: error: undefined symbol: __atomic_fetch_add_2 >>> referenced by sds.c:185 >>> lto.tmp:(sdsdupshared) clang-10: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [Makefile:276: keydb-server] Error 1 Former-commit-id: dcd7b684bbb7b4719a0e44d5764b01c48eb619dd
This commit is contained in:
parent
cf13892cfa
commit
7ae66c0866
@ -70,6 +70,7 @@ endif
|
||||
|
||||
ifeq ($(COMPILER_NAME),clang)
|
||||
CXXFLAGS+= -stdlib=libc++
|
||||
LDFLAGS+= -latomic
|
||||
endif
|
||||
|
||||
# To get ARM stack traces if Redis crashes we need a special C flag.
|
||||
|
Loading…
x
Reference in New Issue
Block a user