From e33663a8dd20fbdd0e894dd3a6f462049038d70b Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Thu, 14 Dec 2023 00:18:20 +0100 Subject: [PATCH] up to 3.16 - add patch for linking libatomic on archs without 64-bit atomics (submitted upstream: https://github.com/esnet/iperf/pull/1612) --- iperf3.spec | 10 ++++++++-- link-libatomic.patch | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 link-libatomic.patch diff --git a/iperf3.spec b/iperf3.spec index bb7b29b..e67c6ec 100644 --- a/iperf3.spec +++ b/iperf3.spec @@ -4,19 +4,24 @@ Summary: Network performance measurement tool Summary(pl.UTF-8): Narzędzie do szacowania wydajności sieci Name: iperf3 -Version: 3.15 +Version: 3.16 Release: 1 License: BSD-like Group: Networking/Utilities Source0: https://downloads.es.net/pub/iperf/%{orgname}-%{version}.tar.gz -# Source0-md5: 63d4ceef1768c13af563ce92cfdd41fa +# Source0-md5: cbcdeae143cbd82a1f41a80ed01ede6c +Patch0: link-libatomic.patch URL: https://software.es.net/iperf/ BuildRequires: autoconf >= 2.71 BuildRequires: automake +%ifnarch %arch_with_atomics64 +BuildRequires: libatomic-devel +%endif BuildRequires: libsctp-devel BuildRequires: libtool BuildRequires: linux-libc-headers >= 7:3.13 BuildRequires: openssl-devel +BuildRequires: rpmbuild(macros) >= 2.025 Requires: %{name}-libs = %{version}-%{release} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -56,6 +61,7 @@ Pliki nagłówkowe bibliotek iperf3. %prep %setup -q -n %{orgname}-%{version} +%patch0 -p1 %build %{__libtoolize} diff --git a/link-libatomic.patch b/link-libatomic.patch new file mode 100644 index 0000000..dd7ec46 --- /dev/null +++ b/link-libatomic.patch @@ -0,0 +1,36 @@ +From 1511e9f85b548891ea53d4e378903344df1fd31e Mon Sep 17 00:00:00 2001 +From: Jan Palus +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 ]], [[atomic_uint_fast64_t i; i++;]])], ++ [AC_MSG_RESULT([no])], ++ [save_LIBS="$LIBS" ++ LIBS="$LIBS -latomic" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[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])