-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add patch for linking libatomic on archs without 64-bit atomics (submitted upstream: esnet/iperf#1612)
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From 1511e9f85b548891ea53d4e378903344df1fd31e Mon Sep 17 00:00:00 2001 | ||
From: Jan Palus <jpalus@fastmail.com> | ||
Date: Sun, 3 Dec 2023 12:14:05 +0100 | ||
Subject: [PATCH] Check and link libatomic if needed | ||
|
||
Some architectures without native support for 64-bit atomics need | ||
linking with libatomic. | ||
--- | ||
configure.ac | 14 +++++++++++++- | ||
1 file changed, 13 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/configure.ac b/configure.ac | ||
index 2594b395e..ad7eaf120 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -92,7 +92,19 @@ CXX="$PTHREAD_CXX" | ||
]) | ||
|
||
# Atomics | ||
-AC_CHECK_HEADERS([stdatomic.h]) | ||
+AC_CHECK_HEADERS([stdatomic.h], | ||
+ [AC_MSG_CHECKING([whether libatomic is required]) | ||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdatomic.h>]], [[atomic_uint_fast64_t i; i++;]])], | ||
+ [AC_MSG_RESULT([no])], | ||
+ [save_LIBS="$LIBS" | ||
+ LIBS="$LIBS -latomic" | ||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdatomic.h>]], [[atomic_uint_fast64_t i; i++;]])], | ||
+ [AC_MSG_RESULT([yes])], | ||
+ [AC_MSG_ERROR([failed to find working configuration with atomics])] | ||
+ )] | ||
+ )], | ||
+ [] | ||
+) | ||
|
||
# Check for poll.h (it's in POSIX so everyone should have it?) | ||
AC_CHECK_HEADERS([poll.h]) |