Re: poudriere-devel-3.3.99.20211015 fails to build in my aarch64 environment (built on amd64 just fine)

From: Mark Millard via freebsd-toolchain <freebsd-toolchain_at_freebsd.org>
Date: Sun, 17 Oct 2021 06:41:19 UTC

On 2021-Oct-16, at 19:20, Mark Millard via freebsd-toolchain <freebsd-toolchain@freebsd.org> wrote:


> [00:00:45] [06] [00:00:18] Saving ports-mgmt/poudriere-devel | poudriere-devel-3.3.99.20211015 wrkdir
> [00:00:49] [06] [00:00:22] Saved ports-mgmt/poudriere-devel | poudriere-devel-3.3.99.20211015 wrkdir to: /usr/local/poudriere/data/wrkdirs/13_0R-CA72-default/default/poudriere-devel-3.3.99.20211015.tbz
> 
> Log:
> 
> . . .
> --- src/libexec/poudriere/pwait/sh-pwait.o ---
> cc -DHAVE_CONFIG_H -I. -I./src   -mcpu=cortex-a72 -Wall -pipe -O2   -Wno-extra -DSHELL -std=gnu99 -DVTABSIZE=1000  -DNO_HISTORY -Wno-unused-const-variable -include  ./external/sh_compat/compat.h -I./s
> rc  -I./external/sh -I./src/poudriere-sh  -I./src/poudriere-sh -O2 -pipe -mcpu=cortex-a72  -g -fstack-protector-strong -fno-strict-aliasing -MT src/libexec/poudriere/pwait/sh-pwait.o -MD -MP -MF src/l
> ibexec/poudriere/pwait/.deps/sh-pwait.Tpo -c -o src/libexec/poudriere/pwait/sh-pwait.o `test -f 'src/libexec/poudriere/pwait/pwait.c' || echo './'`src/libexec/poudriere/pwait/pwait.c
> . . .
> --- src/libexec/poudriere/pwait/sh-pwait.o ---
> src/libexec/poudriere/pwait/pwait.c:62:2: error: passing 'void *' to parameter of incompatible type 'va_list' (aka '__builtin_va_list')
>        exit(EX_USAGE);
>        ^~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:106:20: note: expanded from macro 'exit'
> #define exit(...)               exit_(_, ##__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:107:21: note: expanded from macro 'exit_'
> #define exit_(...)              exit_X(__VA_ARGS__, _1, _0)(__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:108:32: note: expanded from macro 'exit_X'
> #define exit_X(_0, _1, X, ...)  exit ## X
>                                ^
> <scratch space>:40:1: note: expanded from here
> exit_1
> ^
> ./src/poudriere-sh/helpers.h:110:58: note: expanded from macro 'exit_1'
> #define exit_1(_, status)       verrorwithstatus(status, NULL, NULL)
>                                                               ^~~~
> /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
> #define NULL    ((void *)0)
>                ^~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:104:49: note: passing argument to parameter here
> void verrorwithstatus(int, const char *, va_list) __printf0like(2, 0) __dead2;
>                                                ^
> src/libexec/poudriere/pwait/pwait.c:205:5: error: passing 'void *' to parameter of incompatible type 'va_list' (aka '__builtin_va_list')
>                                exit(EX_OK);
>                                ^~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:106:20: note: expanded from macro 'exit'
> #define exit(...)               exit_(_, ##__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:107:21: note: expanded from macro 'exit_'
> #define exit_(...)              exit_X(__VA_ARGS__, _1, _0)(__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:108:32: note: expanded from macro 'exit_X'
> #define exit_X(_0, _1, X, ...)  exit ## X
>                                ^
> <scratch space>:41:1: note: expanded from here
> exit_1
> ^
> ./src/poudriere-sh/helpers.h:110:58: note: expanded from macro 'exit_1'
> #define exit_1(_, status)       verrorwithstatus(status, NULL, NULL)
>                                                               ^~~~
> /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
> #define NULL    ((void *)0)
>                ^~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:104:49: note: passing argument to parameter here
> void verrorwithstatus(int, const char *, va_list) __printf0like(2, 0) __dead2;
>                                                ^
> src/libexec/poudriere/pwait/pwait.c:275:5: error: passing 'void *' to parameter of incompatible type 'va_list' (aka '__builtin_va_list')
>                                exit(124);
>                                ^~~~~~~~~
> ./src/poudriere-sh/helpers.h:106:20: note: expanded from macro 'exit'
> #define exit(...)               exit_(_, ##__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:107:21: note: expanded from macro 'exit_'
> #define exit_(...)              exit_X(__VA_ARGS__, _1, _0)(__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:108:32: note: expanded from macro 'exit_X'
> #define exit_X(_0, _1, X, ...)  exit ## X
>                                ^
> <scratch space>:42:1: note: expanded from here
> exit_1
> ^
> ./src/poudriere-sh/helpers.h:110:58: note: expanded from macro 'exit_1'
> #define exit_1(_, status)       verrorwithstatus(status, NULL, NULL)
>                                                               ^~~~
> /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
> #define NULL    ((void *)0)
>                ^~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:104:49: note: passing argument to parameter here
> void verrorwithstatus(int, const char *, va_list) __printf0like(2, 0) __dead2;
>                                                ^
> src/libexec/poudriere/pwait/pwait.c:303:5: error: passing 'void *' to parameter of incompatible type 'va_list' (aka '__builtin_va_list')
>                                exit(EX_OK);
>                                ^~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:106:20: note: expanded from macro 'exit'
> #define exit(...)               exit_(_, ##__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:107:21: note: expanded from macro 'exit_'
> #define exit_(...)              exit_X(__VA_ARGS__, _1, _0)(__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:108:32: note: expanded from macro 'exit_X'
> #define exit_X(_0, _1, X, ...)  exit ## X
>                                ^
> <scratch space>:43:1: note: expanded from here
> exit_1
> ^
> ./src/poudriere-sh/helpers.h:110:58: note: expanded from macro 'exit_1'
> #define exit_1(_, status)       verrorwithstatus(status, NULL, NULL)
>                                                               ^~~~
> /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
> #define NULL    ((void *)0)
>                ^~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:104:49: note: passing argument to parameter here
> void verrorwithstatus(int, const char *, va_list) __printf0like(2, 0) __dead2;
>                                                ^
> src/libexec/poudriere/pwait/pwait.c:319:2: error: passing 'void *' to parameter of incompatible type 'va_list' (aka '__builtin_va_list')
>        exit(EX_OK);
>        ^~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:106:20: note: expanded from macro 'exit'
> #define exit(...)               exit_(_, ##__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:107:21: note: expanded from macro 'exit_'
> #define exit_(...)              exit_X(__VA_ARGS__, _1, _0)(__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:108:32: note: expanded from macro 'exit_X'
> #define exit_X(_0, _1, X, ...)  exit ## X
>                                ^
> <scratch space>:44:1: note: expanded from here
> exit_1
> ^
> ./src/poudriere-sh/helpers.h:110:58: note: expanded from macro 'exit_1'
> #define exit_1(_, status)       verrorwithstatus(status, NULL, NULL)
>                                                               ^~~~
> . . .
> 
> 
> --- src/poudriere-sh/sh-mkdir.o ---
> cc -DHAVE_CONFIG_H -I. -I./src   -mcpu=cortex-a72 -Wall -pipe -O2   -Wno-extra -DSHELL -std=gnu99 -DVTABSIZE=1000  -DNO_HISTORY -Wno-unused-const-variable -include  ./external/sh_compat/compat.h -I./src  -I./external/sh -I./src/poudriere-sh  -I./src/poudriere-sh -O2 -pipe -mcpu=cortex-a72  -g -fstack-protector-strong -fno-strict-aliasing -MT src/poudriere-sh/sh-mkdir.o -MD -MP -MF src/poudriere-sh/.deps/sh-mkdir.Tpo -c -o src/poudriere-sh/sh-mkdir.o `test -f 'src/poudriere-sh/mkdir.c' || echo './'`src/poudriere-sh/mkdir.c
> . . .
> --- src/poudriere-sh/sh-mkdir.o ---
> src/poudriere-sh/mkdir.c:139:2: error: passing 'void *' to parameter of incompatible type 'va_list' (aka '__builtin_va_list')
>        exit(exitval);
>        ^~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:106:20: note: expanded from macro 'exit'
> #define exit(...)               exit_(_, ##__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:107:21: note: expanded from macro 'exit_'
> #define exit_(...)              exit_X(__VA_ARGS__, _1, _0)(__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:108:32: note: expanded from macro 'exit_X'
> #define exit_X(_0, _1, X, ...)  exit ## X
>                                ^
> <scratch space>:46:1: note: expanded from here
> exit_1
> ^
> ./src/poudriere-sh/helpers.h:110:58: note: expanded from macro 'exit_1'
> #define exit_1(_, status)       verrorwithstatus(status, NULL, NULL)
>                                                               ^~~~
> /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
> #define NULL    ((void *)0)
>                ^~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:104:49: note: passing argument to parameter here
> void verrorwithstatus(int, const char *, va_list) __printf0like(2, 0) __dead2;
>                                                ^
> src/poudriere-sh/mkdir.c:226:2: error: passing 'void *' to parameter of incompatible type 'va_list' (aka '__builtin_va_list')
>        exit (EX_USAGE);
>        ^~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:106:20: note: expanded from macro 'exit'
> #define exit(...)               exit_(_, ##__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:107:21: note: expanded from macro 'exit_'
> #define exit_(...)              exit_X(__VA_ARGS__, _1, _0)(__VA_ARGS__)
>                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./src/poudriere-sh/helpers.h:108:32: note: expanded from macro 'exit_X'
> #define exit_X(_0, _1, X, ...)  exit ## X
>                                ^
> <scratch space>:47:1: note: expanded from here
> exit_1
> . . .
> 
> I'll not list the rest.

I'll note that https://developer.arm.com/documentation/ihi0055/d/ reports
that va_list is based on:

struct __va_list {
  void *__stack;
   void *__gr_top;
   void *__vr_top;
   int   __gr_offs;
   int   __vr_offs;
 }

so NULL is not type compatible for aarch64.

My guess is an empty va_list needs to be created and used
instead of NULL, following the normal va_list protocol. This
should avoid presumptions about aspects that the language
standard does not specify.


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