NetBSD Problem Report #58097

From www@netbsd.org  Mon Apr  1 22:10:24 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5FC8E1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  1 Apr 2024 22:10:24 +0000 (UTC)
Message-Id: <20240401220959.E39441A923B@mollari.NetBSD.org>
Date: Mon,  1 Apr 2024 22:09:59 +0000 (UTC)
From: brandon@burn.net
Reply-To: brandon@burn.net
To: gnats-bugs@NetBSD.org
Subject: iperf3 fails to build on sparc
X-Send-Pr-Version: www-1.0

>Number:         58097
>Category:       pkg
>Synopsis:       iperf3 fails to build on sparc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 01 22:15:00 +0000 2024
>Last-Modified:  Tue Apr 02 00:55:01 +0000 2024
>Originator:     Brandon Applegate
>Release:        10.0 + 2024Q1
>Organization:
>Environment:
NetBSD qemu-10.internal.burn.net 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 2024  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/sparc/compile/GENERIC sparc
>Description:
When building iperf3 from pkgsrc, compilation fails on iperf_util.lo

 CC       iperf_util.lo
In file included from /usr/include/stdio.h:595,
                 from iperf_util.c:34:
iperf_util.c: In function 'get_system_info':
iperf_util.c:235:32: warning: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 1020 [-Wformat-truncation=]
  235 |     snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, uts.nodename,
      |                                ^~~~~~~~~~~~~~~~
  236 |       uts.release, uts.version, uts.machine);
      |                                 ~~~~~~~~~~~
iperf_util.c:235:45: note: format string is defined here
  235 |     snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, uts.nodename,
      |                                             ^~
In file included from /usr/include/stdio.h:595,
                 from iperf_util.c:34:
iperf_util.c:235:5: note: '__builtin_snprintf' output between 5 and 1280 bytes into a destination of size 1024
  235 |     snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, uts.nodename,
      |     ^~~~~~~~
  CC       iperf_time.lo
  CC       dscp.lo
  CC       net.lo
  CC       tcp_info.lo
  CC       timer.lo
  CC       units.lo
  CCLD     libiperf.la
  CCLD     iperf3
ld: ./.libs/libiperf.so: undefined reference to `__atomic_fetch_add_8'
*** Error code 1

Stop.
make[2]: stopped in /usr/pkgsrc/net/iperf3/work/iperf-3.16/src
*** Error code 1

Stop.
make[1]: stopped in /usr/pkgsrc/net/iperf3/work/iperf-3.16/src
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/net/iperf3/work/iperf-3.16
*** Error code 1

Stop.
make[1]: stopped in /usr/pkgsrc/net/iperf3
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/net/iperf3

>How-To-Repeat:
'make install' for iperf3
>Fix:

>Audit-Trail:
From: Thomas Klausner <wiz@gatalith.at>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/58097: iperf3 fails to build on sparc
Date: Tue, 2 Apr 2024 00:17:27 +0200

 On Mon, Apr 01, 2024 at 10:15:00PM +0000, brandon@burn.net wrote:
 > >Number:         58097
 > >Category:       pkg
 > >Synopsis:       iperf3 fails to build on sparc

 Does adding

 .include '../../mk/atomic64.mk"

 to the pkgsrc Makefile fix this?
  Thomas

From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/58097: iperf3 fails to build on sparc
Date: Tue, 2 Apr 2024 00:21:43 +0200

 On Mon, Apr 01, 2024 at 10:20:02PM +0000, Thomas Klausner wrote:
 >  .include '../../mk/atomic64.mk"

 Make that

 .include "../../mk/atomic64.mk"

 with matching quotes.
  Thomas

From: Brandon Applegate <brandon@burn.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/58097: iperf3 fails to build on sparc
Date: Mon, 1 Apr 2024 20:51:34 -0400

 Thomas,

 Thanks for the lightning quick reply.  Sorry I wasn=E2=80=99t as quick =
 with mine (I was building something else on sparc that pulled in Python =
 3 so the machine was tied up for a good while :) )

 I added that to the iperf3 Makefile and I get seemingly the same =
 warnings/errors but also some new ones (regarding pthread):

 In file included from /usr/include/stdio.h:595,
                  from iperf_util.c:34:
 iperf_util.c: In function 'get_system_info':
 iperf_util.c:235:32: warning: '%s' directive output may be truncated =
 writing up to 255 bytes into a region of size between 0 and 1020 =
 [-Wformat-truncation=3D]
   235 |     snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, =
 uts.nodename,
       |                                ^~~~~~~~~~~~~~~~
   236 |       uts.release, uts.version, uts.machine);
       |                                 ~~~~~~~~~~~
 iperf_util.c:235:45: note: format string is defined here
   235 |     snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, =
 uts.nodename,
       |                                             ^~
 In file included from /usr/include/stdio.h:595,
                  from iperf_util.c:34:
 iperf_util.c:235:5: note: '__builtin_snprintf' output between 5 and 1280 =
 bytes into a destination of size 1024
   235 |     snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, =
 uts.nodename,
       |     ^~~~~~~~
   CC       iperf_time.lo
   CC       dscp.lo
   CC       net.lo
   CC       tcp_info.lo
   CC       timer.lo
   CC       units.lo
   CCLD     libiperf.la
   CCLD     iperf3
 ld: ./.libs/libiperf.so: undefined reference to `pthread_setcanceltype'
 ld: ./.libs/libiperf.so: undefined reference to `pthread_attr_init'
 ld: ./.libs/libiperf.so: undefined reference to `pthread_attr_destroy'
 ld: ./.libs/libiperf.so: undefined reference to `pthread_create'
 ld: ./.libs/libiperf.so: undefined reference to `pthread_cancel'
 ld: ./.libs/libiperf.so: undefined reference to `__atomic_fetch_add_8'
 *** Error code 1

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.