According to gcc doc, -pthread flag will link the program against libraries like libatomic on demand, which is the expected usage of pthread. Using -lpthread in CFLAGS and LDFLAGS causes absense of these libraries, thus failing to build on architectures which needs soft atomic operation implementation.
According to gcc doc,
-pthread
flag will link the program against libraries like libatomic on demand, which is the expected usage of pthread. Using-lpthread
in CFLAGS and LDFLAGS causes absense of these libraries, thus failing to build on architectures which needs soft atomic operation implementation.Reference: GCC doc, Stack Overflow