package/gnutls: fix build on sparc
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Mon, 15 Jul 2019 16:36:08 +0000 (18:36 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 17 Jul 2019 05:40:18 +0000 (07:40 +0200)
commite5a2354b6b8a321cd733e8936776c38dca064647
tree118cafc6f934211168ae1f3f5f3fd0e4b593e270
parent43caf8e1f71506b664efe75795f6d9d25f493497
package/gnutls: fix build on sparc

gnutls source code uses the C++11 <atomic> functionality since
https://github.com/gnutls/gnutls/commit/7978a733460f92b31033affd0e487c86d66c643d,
which internally is implemented using the __atomic_*() gcc built-ins

On certain architectures, the __atomic_*() built-ins are implemented in
the libatomic library that comes with the rest of the gcc runtime. Due
to this, code using <atomic> might need to link against libatomic,
otherwise one hits build issues such as:

../lib/.libs/libgnutls.so: undefined reference to `__atomic_fetch_sub_4'

on an architecture like SPARC.

To solve this, link against libatomic if BR2_PACKAGE_HAS_LIBATOMIC is set.

This fix gnutls build failures as well as cups, gnupg and libmicrohttpd

Fixes:
 - http://autobuild.buildroot.org/results/1c7541fc6ac4b52d1dfe02a9a7d61db90f4521eb
 - http://autobuild.buildroot.org/results/42c8803b98e38ebd48870fe6b1a20a1d6c351e5f
 - http://autobuild.buildroot.org/results/a1e96d02d41f7fec0f5327f65fb34405f963a1e9
 - http://autobuild.buildroot.org/results/59c92706457a9da29dd44425e546a7c80c18b454

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/gnutls/gnutls.mk