mirror of
https://github.com/NixOS/nix
synced 2025-07-08 11:03:54 +02:00
Merge pull request #4890 from alyssais/2.3-libatomic
[2.3] Backport libatomic fixes
This commit is contained in:
commit
cc565be4bc
1 changed files with 13 additions and 1 deletions
14
configure.ac
14
configure.ac
|
@ -69,7 +69,7 @@ AC_SYS_LARGEFILE
|
||||||
AC_STRUCT_DIRENT_D_TYPE
|
AC_STRUCT_DIRENT_D_TYPE
|
||||||
if test "$sys_name" = sunos; then
|
if test "$sys_name" = sunos; then
|
||||||
# Solaris requires -lsocket -lnsl for network functions
|
# Solaris requires -lsocket -lnsl for network functions
|
||||||
LIBS="-lsocket -lnsl $LIBS"
|
LDFLAGS="-lsocket -lnsl $LDFLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -157,6 +157,18 @@ AX_BOOST_BASE([1.66], [CXXFLAGS="$BOOST_CPPFLAGS $CXXFLAGS"], [AC_MSG_ERROR([Nix
|
||||||
# ends up with LDFLAGS being empty, so we set it afterwards.
|
# ends up with LDFLAGS being empty, so we set it afterwards.
|
||||||
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
|
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
|
||||||
|
|
||||||
|
# On some platforms, new-style atomics need a helper library
|
||||||
|
AC_MSG_CHECKING(whether -latomic is needed)
|
||||||
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
|
#include <stdint.h>
|
||||||
|
uint64_t v;
|
||||||
|
int main() {
|
||||||
|
return (int)__atomic_load_n(&v, __ATOMIC_ACQUIRE);
|
||||||
|
}]])], GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC=no, GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC=yes)
|
||||||
|
AC_MSG_RESULT($GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC)
|
||||||
|
if test "x$GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC" = xyes; then
|
||||||
|
LDFLAGS="-latomic $LDFLAGS"
|
||||||
|
fi
|
||||||
|
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue