commit: 40bc7aaa27be1c1259d9d05cf49e93aa16bd3a4b Author: Krzesimir Nowak <knowak <AT> microsoft <DOT> com> AuthorDate: Fri Feb 6 11:28:20 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Mon Feb 9 23:46:53 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40bc7aaa
net-analyzer/netperf: Add a patch fixing issues with gcc15 The patch comes from: https://github.com/HewlettPackard/netperf/pull/86 Closes: https://bugs.gentoo.org/943836 Closes: https://bugs.gentoo.org/946728 Signed-off-by: Krzesimir Nowak <knowak <AT> microsoft.com> Part-of: https://codeberg.org/gentoo/gentoo/pulls/36 Merges: https://codeberg.org/gentoo/gentoo/pulls/36 Signed-off-by: Sam James <sam <AT> gentoo.org> .../netperf/files/netperf-2.7.0-gcc15.patch | 167 +++++++++++++++++++++ .../netperf/netperf-2.7.0_p20210121-r1.ebuild | 80 ++++++++++ 2 files changed, 247 insertions(+) diff --git a/net-analyzer/netperf/files/netperf-2.7.0-gcc15.patch b/net-analyzer/netperf/files/netperf-2.7.0-gcc15.patch new file mode 100644 index 000000000000..fe6335b26c28 --- /dev/null +++ b/net-analyzer/netperf/files/netperf-2.7.0-gcc15.patch @@ -0,0 +1,167 @@ +From 2bf2c2d7b6fecc43c70567054071134ab13ef0a6 Mon Sep 17 00:00:00 2001 +From: "mark.yang" <[email protected]> +Date: Wed, 16 Apr 2025 20:02:36 +0900 +Subject: [PATCH] Fix too many arguments error occurring in gcc-15 + +* See more details in http://errors.yoctoproject.org/Errors/Details/851803/ +../../git/src/nettest_bsd.c:4497:19: error: too many arguments to function 'alloc_sendfile_buf_ring'; expected 0, have 4 + 4497 | send_ring = alloc_sendfile_buf_ring(send_width, + | ^~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +In file included from ../../git/src/nettest_bsd.c:175: +../../git/src/netlib.h:690:26: note: declared here + 690 | extern struct ring_elt *alloc_sendfile_buf_ring(); + | ^~~~~~~~~~~~~~~~~~~~~~~ +In file included from ../../git/src/nettest_omni.c:184: +../../git/src/hist.h:135:6: error: conflicting types for 'HIST_purge'; have 'void(struct histogram_struct *)' + 135 | void HIST_purge(HIST h); + | ^~~~~~~~~~ +In file included from ../../git/src/nettest_omni.c:166: +../../git/src/netlib.h:651:17: note: previous declaration of 'HIST_purge' with type 'void(void)' + 651 | extern void HIST_purge(); + | ^~~~~~~~~~ +../../git/src/nettest_bsd.c: In function 'recv_tcp_stream': +../../git/src/nettest_bsd.c:5197:15: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 5197 | recv_ring = allocate_buffer_ring(recv_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_bsd.c: In function 'recv_tcp_maerts': +../../git/src/nettest_bsd.c:5617:15: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 5617 | send_ring = allocate_buffer_ring(send_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_bsd.c: In function 'recv_udp_stream': +../../git/src/nettest_bsd.c:7345:15: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 7345 | recv_ring = allocate_buffer_ring(recv_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_bsd.c: In function 'recv_udp_rr': +../../git/src/nettest_bsd.c:8360:15: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 8360 | recv_ring = allocate_buffer_ring(recv_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_bsd.c:8365:15: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 8365 | send_ring = allocate_buffer_ring(send_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_bsd.c: In function 'recv_tcp_rr': +../../git/src/nettest_bsd.c:8677:15: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 8677 | send_ring = allocate_buffer_ring(send_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_bsd.c:8682:15: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 8682 | recv_ring = allocate_buffer_ring(recv_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_omni.c: In function 'send_omni_inner': +../../git/src/nettest_omni.c:4044:21: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 4044 | send_ring = allocate_buffer_ring(send_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_omni.c:4086:21: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 4086 | recv_ring = allocate_buffer_ring(recv_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_omni.c:5050:5: error: too many arguments to function 'HIST_get_stats'; expected 0, have 5 + 5050 | HIST_get_stats(time_hist, + | ^~~~~~~~~~~~~~ ~~~~~~~~~ +../../git/src/netlib.h:650:17: note: declared here + 650 | extern void HIST_get_stats(); + | ^~~~~~~~~~~~~~ +../../git/src/nettest_omni.c:5055:19: error: too many arguments to function 'HIST_get_percentile'; expected 0, have 2 + 5055 | p50_latency = HIST_get_percentile(time_hist, 0.50); + | ^~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ +../../git/src/netlib.h:649:17: note: declared here + 649 | extern int HIST_get_percentile(); + | ^~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_omni.c:5056:19: error: too many arguments to function 'HIST_get_percentile'; expected 0, have 2 + 5056 | p90_latency = HIST_get_percentile(time_hist, 0.90); + | ^~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ +../../git/src/netlib.h:649:17: note: declared here + 649 | extern int HIST_get_percentile(); + | ^~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_omni.c:5057:19: error: too many arguments to function 'HIST_get_percentile'; expected 0, have 2 + 5057 | p99_latency = HIST_get_percentile(time_hist, 0.99); + | ^~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ +../../git/src/netlib.h:649:17: note: declared here + 649 | extern int HIST_get_percentile(); + | ^~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_omni.c: In function 'recv_omni': +../../git/src/nettest_omni.c:5354:17: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 5354 | send_ring = allocate_buffer_ring(send_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ +../../git/src/nettest_omni.c:5396:17: error: too many arguments to function 'allocate_buffer_ring'; expected 0, have 4 + 5396 | recv_ring = allocate_buffer_ring(recv_width, + | ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ +../../git/src/netlib.h:679:26: note: declared here + 679 | extern struct ring_elt *allocate_buffer_ring(); + | ^~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: mark.yang <[email protected]> +--- + src/netlib.h | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/netlib.h b/src/netlib.h +index b1f4199..8e1f6fe 100644 +--- a/src/netlib.h ++++ b/src/netlib.h +@@ -564,6 +564,7 @@ extern void demo_interval_final(); + #endif + #endif + ++#include "hist.h" + extern void netlib_init(); + extern int netlib_get_page_size(); + extern void install_signal_catchers(); +@@ -646,9 +647,9 @@ extern char *find_interface_slot(char *interface_name); + extern void find_interface_ids(char *interface_name, int *vendor, int *device, int *sub_vend, int *sub_dev); + extern void find_driver_info(char *ifname, char *driver, char *version, char *firmware, char *bus, int len); + extern void find_system_info(char **system_model, char **cpu_model, int *cpu_frequency); +-extern int HIST_get_percentile(); +-extern void HIST_get_stats(); +-extern void HIST_purge(); ++extern int HIST_get_percentile(HIST h, const double percentile); ++extern void HIST_get_stats(HIST h, int *min, int *max, double *mean, double *stddev); ++extern void HIST_purge(HIST h); + extern void find_security_info(int *enabled, int *type, char **specific); + extern void demo_first_timestamp(); + extern void demo_reset(); +@@ -676,7 +677,7 @@ extern void catcher(int, siginfo_t *,void *); + #else + extern void catcher(int); + #endif /* __hpux */ +-extern struct ring_elt *allocate_buffer_ring(); ++extern struct ring_elt *allocate_buffer_ring(int recv_width, int recv_size, int local_recv_align, int local_recv_offset); + extern void access_buffer(char *buffer_ptr, + int length, + int dirty_count, +@@ -687,7 +688,7 @@ extern struct ring_elt *allocate_exs_buffer_ring(); + #endif /* HAVE_ICSC_EXS */ + + #ifdef HAVE_SENDFILE +-extern struct ring_elt *alloc_sendfile_buf_ring(); ++extern struct ring_elt *alloc_sendfile_buf_ring(int send_width, int send_size, int local_send_align, int local_send_offset); + extern int netperf_sendfile(SOCKET send_socket, struct ring_elt *send_ring); + #endif /* HAVE_SENDFILE */ + diff --git a/net-analyzer/netperf/netperf-2.7.0_p20210121-r1.ebuild b/net-analyzer/netperf/netperf-2.7.0_p20210121-r1.ebuild new file mode 100644 index 000000000000..caf1dc52ad4a --- /dev/null +++ b/net-analyzer/netperf/netperf-2.7.0_p20210121-r1.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic + +COMMIT="3bc455b23f901dae377ca0a558e1e32aa56b31c4" +DESCRIPTION="Network performance benchmark" +HOMEPAGE="https://github.com/HewlettPackard/netperf" +SRC_URI="https://github.com/HewlettPackard/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${COMMIT}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="demo sctp" + +RDEPEND=" + acct-group/netperf + acct-user/netperf +" +BDEPEND=" + ${RDEPEND} + sys-devel/gnuconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-fix-scripts.patch + "${FILESDIR}"/${PN}-log-dir.patch + "${FILESDIR}"/${PN}-2.7.0-includes.patch + "${FILESDIR}"/${PN}-2.7.0-fcommon.patch + "${FILESDIR}"/${PN}-2.7.0-gcc15.patch +) + +src_prepare() { + # Fixing paths in scripts + sed -i \ + -e "s:^\(NETHOME=\).*:\1\"${EPREFIX}/usr/bin\":" \ + doc/examples/sctp_stream_script \ + doc/examples/tcp_range_script \ + doc/examples/tcp_rr_script \ + doc/examples/tcp_stream_script \ + doc/examples/udp_rr_script \ + doc/examples/udp_stream_script \ + || die + + default + AT_M4DIR=src/missing/m4 eautoreconf +} + +src_configure() { + # netlib.c:2292:5: warning: implicit declaration of function 'sched_setaffinity' + # nettest_omni.c:2943:5: warning: implicit declaration of function 'splice' + # TODO: drop once https://github.com/HewlettPackard/netperf/pull/73 is merged + append-cppflags -D_GNU_SOURCE + + econf \ + $(use_enable demo) \ + $(use_enable sctp) +} + +src_install() { + default + + # init.d / conf.d + newinitd "${FILESDIR}"/${PN}-2.7.0-init netperf + newconfd "${FILESDIR}"/${PN}-2.2-conf netperf + + keepdir /var/log/${PN} + fowners netperf:netperf /var/log/${PN} + fperms 0755 /var/log/${PN} + + # documentation and example scripts + dodoc AUTHORS ChangeLog NEWS README Release_Notes doc/${PN}.txt + docinto html + dodoc doc/${PN}.html + exeinto /usr/share/${PN}/examples + doexe doc/examples/*_script +}
