Bug 252280 - benchmarks/iperf: does not build on i386, "bad_C++_code"
Summary: benchmarks/iperf: does not build on i386, "bad_C++_code"
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-30 02:44 UTC by Victor Sudakov
Modified: 2021-01-06 19:06 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
Poudriere build log (24.05 KB, text/plain)
2020-12-30 02:44 UTC, Victor Sudakov
no flags Details
Fix time_t mismatches in iperf (2.69 KB, patch)
2020-12-31 12:07 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Sudakov 2020-12-30 02:44:54 UTC
Created attachment 221098 [details]
Poudriere build log

c++ -DHAVE_CONFIG_H -I. -I..   -I../include  -I../include  -Wall -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -MT Settings.o -MD -MP -MF .deps/Settings.Tpo -c -o Settings.o Settings.cpp
Settings.cpp:1063:12: error: no matching function for call to 'localtime'
            ts = *localtime(&nowsecs);
                  ^~~~~~~~~
/usr/include/time.h:154:12: note: candidate function not viable: no known conversion from 'long *' to 'const time_t *' (aka 'const int *') for 1st argument
struct tm *localtime(const time_t *);
           ^
1 error generated.
*** Error code 1

Stop.
make[3]: stopped in /wrkdirs/usr/ports/benchmarks/iperf/work/iperf-2.0.14a/src
*** Error code 1

Stop.
make[2]: stopped in /wrkdirs/usr/ports/benchmarks/iperf/work/iperf-2.0.14a
*** Error code 1

Stop.
make[1]: stopped in /wrkdirs/usr/ports/benchmarks/iperf/work/iperf-2.0.14a
*** Error code 1

Stop.
make: stopped in /usr/ports/benchmarks/iperf
=>> Cleaning up wrkdir
===>  Cleaning for iperf-2.0.14a_3
build of benchmarks/iperf | iperf-2.0.14a_3 ended at Tue Dec 29 18:14:18 +07 2020
build time: 00:00:17
!!! build failure encountered !!!
Comment 1 Victor Sudakov 2020-12-31 09:45:50 UTC
Seems to happen only on the i386 platform: the error is present on 12.2/i386 and 11.4/i386. Build on amd64 is not affected.
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2020-12-31 12:07:11 UTC
Created attachment 221129 [details]
Fix time_t mismatches in iperf

Here is a patch that makes it build on i386, where time_t is 32 bit:

* Use time_t for localtime()
* Cast timeval::tv_sec to long to printf with %ld format
Comment 3 Victor Sudakov 2020-12-31 14:29:58 UTC
(In reply to Dimitry Andric from comment #2)
I confirm, those two new patch files fix the problem.
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-01-03 20:30:36 UTC
A commit references this bug:

Author: sunpoet
Date: Sun Jan  3 20:30:07 UTC 2021
New revision: 560244
URL: https://svnweb.freebsd.org/changeset/ports/560244

Log:
  Fix build on i386

  PR:		252280
  Reported by:	Victor Sudakov <vas@sibptus.ru>
  Submitted by:	dim

Changes:
  head/benchmarks/iperf/files/patch-src-Settings.cpp
  head/benchmarks/iperf/files/patch-src-histogram.c
Comment 5 Po-Chuan Hsieh freebsd_committer freebsd_triage 2021-01-03 20:45:53 UTC
Committed. Thanks!
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-01-06 19:06:47 UTC
A commit references this bug:

Author: sunpoet
Date: Wed Jan  6 19:05:47 UTC 2021
New revision: 560558
URL: https://svnweb.freebsd.org/changeset/ports/560558

Log:
  MFH: r560244 r560245

  Fix build on i386

  PR:		252280
  Reported by:	Victor Sudakov <vas@sibptus.ru>
  Submitted by:	dim

  Fix build on armv6

  PR:		251448
  Submitted by:	Martin Birgmeier <d8zNeCFG@aon.at>

Changes:
_U  branches/2021Q1/
  branches/2021Q1/benchmarks/iperf/files/patch-src-Settings.cpp
  branches/2021Q1/benchmarks/iperf/files/patch-src-histogram.c