Skip to content

Commit

Permalink
up to 3.16
Browse files Browse the repository at this point in the history
- add patch for linking libatomic on archs without 64-bit atomics
  (submitted upstream: esnet/iperf#1612)
  • Loading branch information
jpalus committed Dec 13, 2023
1 parent d30c4ed commit e33663a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
10 changes: 8 additions & 2 deletions iperf3.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -56,6 +61,7 @@ Pliki nagłówkowe bibliotek iperf3.

%prep
%setup -q -n %{orgname}-%{version}
%patch0 -p1

%build
%{__libtoolize}
Expand Down
36 changes: 36 additions & 0 deletions link-libatomic.patch
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])

0 comments on commit e33663a

Please sign in to comment.