zeromq: fix static build with libatomic
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Thu, 13 Sep 2018 18:24:19 +0000 (20:24 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 13 Sep 2018 18:58:14 +0000 (20:58 +0200)
commit14f5cb7daa54644da981cae0e1dbbfc6d4c18993
tree888e64443d85f0c13fa39b72551df9f16914bd6c
parent7f3e2d258069f2930fc63e5e2be3380aa548f4de
zeromq: fix static build with libatomic

Second patch added support to link with -latomic if needed however using
LDFLAGS doesn't work when statically linking because LDFLAGS is added
before LIBS

Detection of atomic fails with:

configure:23230: /accts/mlweber1/instance-2/output/host/bin/sparc-linux-g++ -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static -static -pedantic -Werror -Wall -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -Wno-long-long -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static -latomic conftest.cpp -lrt -lpthread -lstdc++ >&5
/tmp/ccgrvVTg.o: In function `main':
conftest.cpp:(.text.startup+0x10): undefined reference to `__atomic_fetch_add_4'
collect2: error: ld returned 1 exit status

So use LIBS instead of LDFLAGS

As second patch was already merged upstream, a new PR was sent:
https://github.com/zeromq/libzmq/pull/3250

Fixes:
 - http://autobuild.buildroot.net/results/c471d6b1061a8516f7772735e471db68a32965aa

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/zeromq/0002-acinclude.m4-check-if-latomic-is-needed.patch