mirror of
https://github.com/zeromq/libzmq.git
synced 2025-02-23 15:14:40 +01:00
fix static build with libatomic
Commit 2ec5a33f6e986661dc92f3585ea400f919a39cae 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 Fixes: - http://autobuild.buildroot.net/results/c471d6b1061a8516f7772735e471db68a32965aa Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
parent
1b61ff2910
commit
6de5f18be3
@ -680,8 +680,8 @@ int main (int, char **)
|
||||
[AC_MSG_RESULT(yes) ; GCC_ATOMIC_BUILTINS_SUPPORTED=1 libzmq_cv_has_atomic_instrisics="yes" ; $1])
|
||||
|
||||
if test "x$GCC_ATOMIC_BUILTINS_SUPPORTED" != x1; then
|
||||
save_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -latomic"
|
||||
save_LIBS=$LIBS
|
||||
LIBS="$LIBS -latomic"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
/* atomic intrinsics test */
|
||||
int v = 0;
|
||||
@ -691,9 +691,8 @@ int main (int, char **)
|
||||
return t;
|
||||
}
|
||||
])],
|
||||
[AC_MSG_RESULT(yes) ; libzmq_cv_has_atomic_instrisics="yes" LIBS="-latomic" ; $1],
|
||||
[AC_MSG_RESULT(no) ; libzmq_cv_has_atomic_instrisics="no"; $2])
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
[AC_MSG_RESULT(yes) ; libzmq_cv_has_atomic_instrisics="yes" ; $1],
|
||||
[AC_MSG_RESULT(no) ; libzmq_cv_has_atomic_instrisics="no" LIBS=$save_LIBS ; $2])
|
||||
fi
|
||||
}])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user