package/libgit2: link with -latomic if needed

libgit2 is currently a library without any reverse dependencies so the
missing atomic symbols do not cause build failures yet.

libgit2 uses the atomics intrinsics on gcc >= 4.7 and the sync
intrinsics on previous gcc versions.  Since gcc 4.9 is the new
minimum, ignore the sync intrinsics requirements.

The next version of libgit2 will also build a binary, which will
expose the problem.

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Nicolas Cavallari 2022-08-12 16:56:51 +02:00 committed by Thomas Petazzoni
parent d9fcbb28ef
commit e992a3e771

View File

@ -44,4 +44,9 @@ else
LIBGIT2_CONF_OPTS += -DUSE_HTTPS=OFF
endif
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
LIBGIT2_CONF_OPTS += \
-DCMAKE_SHARED_LINKER_FLAGS=-latomic
endif
$(eval $(cmake-package))