Re: armv7 main [so: 14] targeting via poudriere bulk builds: iperf3 fails to build: iperf_api.c:4460:5: error: unknown type name 'cpu_set_t'; did you mean 'cpuset_t'?

From: Mark Millard via freebsd-ports <freebsd-ports_at_freebsd.org>
Date: Sat, 27 Nov 2021 22:13:43 UTC
On 2021-Nov-27, at 06:04, Mark Millard <marklmi@yahoo.com> wrote:

> Notably amd64 targeting did not have this problem. I've not
> tried aarch64 targeting yet.

I've now built for aarch64 based on the same /usr/ports
as used for the other builds and iperf3 built fione.

I do not know about 32-bit or 64-bit powerpc but armv7 (and
probably armv6 ?) seems to need the _WITH_CPU_SET_T opt-in
(or needs to be implemented differently to avoid using the
missing names).

> Still, it looks like iperf3 needs the #define _WITH_CPU_SET_T
> opt-in someplace:
> 
> --- iperf_api.lo ---
> iperf_api.c:4460:5: error: unknown type name 'cpu_set_t'; did you mean 'cpuset_t'?
>    cpu_set_t cpu_set;
>    ^~~~~~~~~
>    cpuset_t
> /usr/include/sys/_cpuset.h:50:24: note: 'cpuset_t' declared here
> typedef struct _cpuset cpuset_t;
>                       ^
> iperf_api.c:4464:9: warning: implicit declaration of function 'sched_setaffinity' is invalid in C99 [-Wimplicit-function-declaration]
>    if (sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set) != 0) {
>        ^
> iperf_api.c:4464:37: error: use of undeclared identifier 'cpu_set_t'; did you mean 'cpuset'?
>    if (sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set) != 0) {
>                                    ^~~~~~~~~
>                                    cpuset
> /usr/include/sys/cpuset.h:156:5: note: 'cpuset' declared here
> int     cpuset(cpusetid_t *);
>        ^
> iperf_api.c:4506:5: error: unknown type name 'cpu_set_t'; did you mean 'cpuset_t'?
>    cpu_set_t cpu_set;
>    ^~~~~~~~~
>    cpuset_t
> /usr/include/sys/_cpuset.h:50:24: note: 'cpuset_t' declared here
> typedef struct _cpuset cpuset_t;
>                       ^
> iperf_api.c:4512:9: warning: implicit declaration of function 'sched_setaffinity' is invalid in C99 [-Wimplicit-function-declaration]
>    if (sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set) != 0) {
>        ^
> iperf_api.c:4512:37: error: use of undeclared identifier 'cpu_set_t'; did you mean 'cpuset'?
>    if (sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set) != 0) {
>                                    ^~~~~~~~~
>                                    cpuset
> /usr/include/sys/cpuset.h:156:5: note: 'cpuset' declared here
> int     cpuset(cpusetid_t *);
>        ^
> 2 warnings and 4 errors generated.
> *** [iperf_api.lo] Error code 1
> 
> make[3]: stopped in /wrkdirs/usr/ports/benchmarks/iperf3/work/iperf-3.10.1/src
> 
> For reference:
> 
> # uname -apKU
> FreeBSD CA72_16Gp_ZFS 14.0-CURRENT FreeBSD 14.0-CURRENT #22 main-n250972-319e9fc642a1-dirty: Tue Nov 23 12:25:36 PST 2021     root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA72  arm64 aarch64 1400042 1400042
> 
> # poudriere jail -jmain-CA7 -i
> Jail name:         main-CA7
> Jail version:      14.0-CURRENT
> Jail arch:         arm.armv7
> Jail method:       null
> Jail mount:        /usr/obj/DESTDIRs/main-CA7-poud
> Jail fs:           
> Jail updated:      2021-06-27 17:58:33
> Jail pkgbase:      disabled
> 
> # uname -apKU
> FreeBSD CA72_16Gp_ZFS 14.0-CURRENT FreeBSD 14.0-CURRENT #22 main-n250972-319e9fc642a1-dirty: Tue Nov 23 12:25:36 PST 2021     root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA72  arm armv7 1400042 1400042




===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)