This seems to be a root cause:
/usr/include/stdio.h:53:9: error: unknown type name '__gnuc_va_list'
53 | typedef __gnuc_va_list va_list;
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:53:24: error: conflicting types for 'va_list'; have 'int'
53 | typedef __gnuc_va_list va_list;
| ^~~~~~~
Full log:
make[3]: Entering directory '/sync/workspace/openwrt/package/system/apk'
touch /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/.prepared_951970ef98e51ce9898a417ff2e5cf7c_18f1e190c5d53547fed41a3eaa76e9e9_check
. /sync/workspace/openwrt/include/shell.sh; zstdcat /sync/workspace/openwrt/dl/apk-3.0.0_pre20241113.tar.zst | tar -C /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/.. -xf -
[ ! -d ./src/ ] || cp -fpR ./src/. /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113
Applying /sync/workspace/openwrt/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch using plaintext:
patching file src/database.c
Applying /sync/workspace/openwrt/package/system/apk/patches/0010-app_list-add-full-print.patch using plaintext:
patching file src/app_list.c
touch /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/.prepared_951970ef98e51ce9898a417ff2e5cf7c_18f1e190c5d53547fed41a3eaa76e9e9
rm -f /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/.configured_*
rm -f /sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/stamp/.apk.mbedtls_installed
/sync/workspace/openwrt/staging_dir/host/bin/sed -e "s|@CC@|'/sync/workspace/openwrt/staging_dir/host/bin/gcc',|" -e "s|@CXX@|'/sync/workspace/openwrt/staging_dir/host/bin/g++',|" -e "s|@PKGCONFIG@|/sync/workspace/openwrt/staging_dir/host/bin/pkg-config|" -e "s|@CMAKE@|/sync/workspace/openwrt/staging_dir/host/bin/cmake|" -e "s|@PYTHON@|/sync/workspace/openwrt/staging_dir/host/bin/python3|" -e "s|@CFLAGS@|'-O2', '-I/sync/workspace/openwrt/staging_dir/host/include', '-I/sync/workspace/openwrt/staging_dir/hostpkg/include', '-I/sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/host/include', '-I/sync/workspace/openwrt/staging_dir/host/include', '-I/sync/workspace/openwrt/staging_dir/hostpkg/include', '-I/sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/host/include',|" -e "s|@CXXFLAGS@|'-O2', '-I/sync/workspace/openwrt/staging_dir/host/include', '-I/sync/workspace/openwrt/staging_dir/hostpkg/include', '-I/sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/host/include', '-I/sync/workspace/openwrt/staging_dir/host/include', '-I/sync/workspace/openwrt/staging_dir/hostpkg/include', '-I/sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/host/include',|" -e "s|@LDFLAGS@|'-L/sync/workspace/openwrt/staging_dir/host/lib', '-L/sync/workspace/openwrt/staging_dir/hostpkg/lib', '-L/sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/host/lib',|" -e "s|@PREFIX@|/sync/workspace/openwrt/staging_dir/host|" < /sync/workspace/openwrt/staging_dir/host/lib/meson/openwrt-native.txt.in > /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-native.txt
/sync/workspace/openwrt/staging_dir/host/bin/sed -e "s|@CC@|'aarch64-openwrt-linux-musl-gcc',|" -e "s|@CXX@|'aarch64-openwrt-linux-musl-g++',|" -e "s|@LD@|'bfd',|" -e "s|@AR@|aarch64-openwrt-linux-musl-gcc-ar|" -e "s|@STRIP@|aarch64-openwrt-linux-musl-strip|" -e "s|@NM@|aarch64-openwrt-linux-musl-gcc-nm|" -e "s|@PKGCONFIG@|/sync/workspace/openwrt/staging_dir/host/bin/pkg-config|" -e "s|@CMAKE@|/sync/workspace/openwrt/staging_dir/host/bin/cmake|" -e "s|@PYTHON@|/sync/workspace/openwrt/staging_dir/host/bin/python3|" -e "s|@CFLAGS@|'-Os', '-pipe', '-mcpu=generic', '-fno-caller-saves', '-fno-plt', '-fhonour-copts', '-ffile-prefix-map=/sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113=apk-3.0.0_pre20241113', '-Wformat', '-Werror=format-security', '-fstack-protector', '-D_FORTIFY_SOURCE=1', '-Wl,-z,now', '-Wl,-z,relro', '-I/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/usr/include', '-I/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include', '-I/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify',|" -e "s|@CXXFLAGS@|'-Os', '-pipe', '-mcpu=generic', '-fno-caller-saves', '-fno-plt', '-fhonour-copts', '-ffile-prefix-map=/sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113=apk-3.0.0_pre20241113', '-Wformat', '-Werror=format-security', '-fstack-protector', '-D_FORTIFY_SOURCE=1', '-Wl,-z,now', '-Wl,-z,relro', '-I/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/usr/include', '-I/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include', '-I/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify',|" -e "s|@LDFLAGS@|'-L/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/usr/lib', '-L/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/lib', '-fuse-ld=bfd', '-znow', '-zrelro',|" -e "s|@ARCH@|"aarch64"|" -e "s|@CPU@|"generic"|" -e "s|@ENDIAN@|little|" < /sync/workspace/openwrt/staging_dir/host/lib/meson/openwrt-cross.txt.in > /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-cross.txt
VERSION=3.0.0_pre20241113 /sync/workspace/openwrt/staging_dir/host/bin/python3 /sync/workspace/openwrt/staging_dir/host/bin/meson.py setup --buildtype plain --native-file /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-native.txt --cross-file /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-cross.txt -Ddefault_library=both -Dcompressed-help=false -Ddocs=disabled -Dhelp=enabled -Dlua_version=5.1 -Durl_backend=wget -Dzstd=false -Dcrypto_backend=mbedtls /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-build /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-build/..
The Meson build system
Version: 1.5.1
Source dir: /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113
Build dir: /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-build
Build type: cross build
Project name: apk-tools
Project version: 3.0.0_pre20241113
C compiler for the host machine: aarch64-openwrt-linux-musl-gcc (gcc 13.3.0 "aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 13.3.0 r28180-b8b658bc0d) 13.3.0")
C linker for the host machine: aarch64-openwrt-linux-musl-gcc ld.bfd 2.42
C compiler for the build machine: /sync/workspace/openwrt/staging_dir/host/bin/gcc (gcc 14.2.1 "gcc (GCC) 14.2.1 20240910")
C linker for the build machine: /sync/workspace/openwrt/staging_dir/host/bin/gcc ld.bfd 2.43.0
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: aarch64
Host machine cpu: generic
Target machine cpu family: aarch64
Target machine cpu: generic
Program lua5.1 found: YES (/sync/workspace/openwrt/staging_dir/hostpkg/bin/lua5.1)
Found pkg-config: YES (/sync/workspace/openwrt/staging_dir/host/bin/pkg-config) 2.2.0
Found CMake: /sync/workspace/openwrt/staging_dir/host/bin/cmake (3.30.5)
Run-time dependency lua5.1 found: NO (tried pkgconfig and cmake)
Dependency scdoc skipped: feature docs disabled
Run-time dependency zlib found: YES 1.3.1
Run-time dependency libzstd found: NO (tried pkgconfig and cmake)
Run-time dependency mbedtls found: YES 3.6.2
Run-time dependency mbedcrypto found: YES 3.6.2
Header "unistd.h" has symbol "fexecve" : YES
Header "sys/random.h" has symbol "getrandom" : YES
Header "string.h" has symbol "memrchr" : YES
Header "sys/mman.h" has symbol "memfd_create" : YES
Header "sys/stat.h" has symbol "mknodat" : YES
Header "unistd.h" has symbol "pipe2" : YES
Header "stdlib.h" has symbol "qsort_r" : YES
Header "stdlib.h" has symbol "reallocarray" : YES
Header "string.h" has symbol "strchrnul" : YES
Header "string.h" has symbol "strlcpy" : YES
Header "sys/socket.h" has symbol "SOCK_CLOEXEC" : YES
Checking if "Test qsort_r non-POSIX prototype" compiles: NO
Run-time dependency cmocka found: YES 1.1.7
Build targets in project: 5
apk-tools 3.0.0_pre20241113
User defined options
Cross files : /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-cross.txt
Native files : /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-native.txt
buildtype : plain
default_library: both
compressed-help: false
crypto_backend : mbedtls
docs : disabled
help : enabled
lua_version : 5.1
url_backend : wget
zstd : false
Found ninja-1.12.1 at /sync/workspace/openwrt/staging_dir/host/bin/ninja
touch /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/.built
touch /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/.built_check
MAKEFLAGS="" /sync/workspace/openwrt/staging_dir/host/bin/ninja -j1 -C /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-build
ninja: Entering directory `/sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/openwrt-build'
[63/68] Compiling C object test/unit/unit_tests.p/blob_test.c.o
In file included from /usr/include/bits/endian.h:35,
from /usr/include/ctype.h:39,
from ../src/apk_blob.h:13,
from ../test/unit/blob_test.c:2:
/usr/include/bits/endianness.h:9: warning: "__BYTE_ORDER" redefined
9 | #define __BYTE_ORDER __LITTLE_ENDIAN
|
In file included from /sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/stddef.h:19,
from ../test/unit/apk_test.h:2,
from ../test/unit/blob_test.c:1:
/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/bits/alltypes.h:8: note: this is the location of the previous definition
8 | #define __BYTE_ORDER 1234
|
In file included from ../src/apk_defines.h:15,
from ../src/apk_blob.h:16:
/usr/include/stdint.h:98: warning: "__INT64_C" redefined
98 | # define __INT64_C(c) c ## LL
|
<built-in>: note: this is the location of the previous definition
/usr/include/stdint.h:99: warning: "__UINT64_C" redefined
99 | # define __UINT64_C(c) c ## ULL
|
<built-in>: note: this is the location of the previous definition
[64/68] Compiling C object test/unit/unit_tests.p/version_test.c.o
FAILED: test/unit/unit_tests.p/version_test.c.o
aarch64-openwrt-linux-musl-gcc -Itest/unit/unit_tests.p -Itest/unit -I../test/unit -Isrc -I../src -Iportability -I../portability -I/usr/include -I/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/usr/include -I/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include -I/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/fortify -fdiagnostics-color=always -Wall -Winvalid-pch -std=gnu11 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -Os -pipe -mcpu=generic -fno-caller-saves -fno-plt -fhonour-copts -ffile-prefix-map=/sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113=apk-3.0.0_pre20241113 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -D_ATFILE_SOURCE '-DAPK_VERSION="3.0.0_pre20241113"' -DCRYPTO_USE_MBEDTLS '-DRELATIVE_LIBEXECDIR="usr/libexec"' -MD -MQ test/unit/unit_tests.p/version_test.c.o -MF test/unit/unit_tests.p/version_test.c.o.d -o test/unit/unit_tests.p/version_test.c.o -c ../test/unit/version_test.c
In file included from /usr/include/bits/endian.h:35,
from /usr/include/endian.h:24,
from ../portability/endian.h:12,
from /usr/include/sys/types.h:176,
from ../src/apk_io.h:12,
from ../test/unit/version_test.c:2:
/usr/include/bits/endianness.h:9: warning: "__BYTE_ORDER" redefined
9 | #define __BYTE_ORDER __LITTLE_ENDIAN
|
In file included from /sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/stddef.h:19,
from ../test/unit/apk_test.h:2,
from ../test/unit/version_test.c:1:
/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/bits/alltypes.h:8: note: this is the location of the previous definition
8 | #define __BYTE_ORDER 1234
|
In file included from ../src/apk_defines.h:15,
from ../src/apk_io.h:16:
/usr/include/stdint.h:98: warning: "__INT64_C" redefined
98 | # define __INT64_C(c) c ## LL
|
<built-in>: note: this is the location of the previous definition
/usr/include/stdint.h:99: warning: "__UINT64_C" redefined
99 | # define __UINT64_C(c) c ## ULL
|
<built-in>: note: this is the location of the previous definition
In file included from /sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/usr/include/mbedtls/bignum.h:20,
from /sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/usr/include/mbedtls/rsa.h:22,
from /sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/usr/include/mbedtls/pk.h:20,
from ../src/apk_crypto_mbedtls.h:13,
from ../src/apk_crypto.h:19,
from ../src/apk_io.h:19:
/usr/include/stdio.h:53:9: error: unknown type name '__gnuc_va_list'
53 | typedef __gnuc_va_list va_list;
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:53:24: error: conflicting types for 'va_list'; have 'int'
53 | typedef __gnuc_va_list va_list;
| ^~~~~~~
In file included from /sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/stdarg.h:10,
from ../test/unit/apk_test.h:1:
/sync/workspace/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/bits/alltypes.h:334:27: note: previous declaration of 'va_list' with type 'va_list'
334 | typedef __builtin_va_list va_list;
| ^~~~~~~
/usr/include/stdio.h:373:22: error: unknown type name '__gnuc_va_list'
373 | __gnuc_va_list __arg) __nonnull ((1));
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:378:54: error: unknown type name '__gnuc_va_list'
378 | extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:381:22: error: unknown type name '__gnuc_va_list'
381 | __gnuc_va_list __arg) __THROWNL;
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:390:56: error: unknown type name '__gnuc_va_list'
390 | const char *__restrict __format, __gnuc_va_list __arg)
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:398:23: error: unknown type name '__gnuc_va_list'
398 | __gnuc_va_list __arg)
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:411:22: error: unknown type name '__gnuc_va_list'
411 | __gnuc_va_list __arg)
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:491:21: error: unknown type name '__gnuc_va_list'
491 | __gnuc_va_list __arg)
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:498:53: error: unknown type name '__gnuc_va_list'
498 | extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:503:54: error: unknown type name '__gnuc_va_list'
503 | const char *__restrict __format, __gnuc_va_list __arg)
| ^~~~~~~~~~~~~~
In file included from /usr/include/features.h:511,
from /usr/include/setjmp.h:25,
from ../test/unit/apk_test.h:3:
/usr/include/stdio.h:511:12: error: unknown type name '__gnuc_va_list'
511 | extern int __REDIRECT (vfscanf,
| ^~~~~~~~~~
/usr/include/stdio.h:516:12: error: unknown type name '__gnuc_va_list'
516 | extern int __REDIRECT (vscanf, (const char *__restrict __format,
| ^~~~~~~~~~
/usr/include/stdio.h:519:12: error: unknown type name '__gnuc_va_list'
519 | extern int __REDIRECT_NTH (vsscanf,
| ^~~~~~~~~~~~~~
/usr/include/stdio.h:922:29: error: unknown type name '__gnuc_va_list'
922 | __gnuc_va_list __args)
| ^~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:954:
/usr/include/bits/stdio2-decl.h:31:28: error: unknown type name '__gnuc_va_list'
31 | __gnuc_va_list __ap) __THROW
| ^~~~~~~~~~~~~~
/usr/include/bits/stdio2-decl.h:42:29: error: unknown type name '__gnuc_va_list'
42 | __gnuc_va_list __ap) __THROW
| ^~~~~~~~~~~~~~
/usr/include/bits/stdio2.h:55:1: error: unknown type name '__gnuc_va_list'
55 | __NTH (vsprintf (__fortify_clang_overload_arg (char *, __restrict, __s),
| ^~~~~
/usr/include/bits/stdio2.h:93:1: error: unknown type name '__gnuc_va_list'
93 | __NTH (vsnprintf (__fortify_clang_overload_arg (char *, __restrict, __s),
| ^~~~~
ninja: build stopped: subcommand failed.
make[3]: *** [Makefile:97: /sync/workspace/openwrt/build_dir/target-aarch64_generic_musl/apk-mbedtls/apk-3.0.0_pre20241113/.built] Error 1
make[3]: Leaving directory '/sync/workspace/openwrt/package/system/apk'
time: package/system/apk/mbedtls/compile#4.77#0.87#5.46
ERROR: package/system/apk failed to build (build variant: mbedtls).
make[2]: *** [package/Makefile:185: package/system/apk/compile] Error 1
make[2]: Leaving directory '/sync/workspace/openwrt'
make[1]: *** [package/Makefile:179: /sync/workspace/openwrt/staging_dir/target-aarch64_generic_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/sync/workspace/openwrt'
make: *** [/sync/workspace/openwrt/include/toplevel.mk:248: world] Error 2
It seems like a defect. Shall I report that?
I may also try to build an image in an isolated environment.
How can I fix or workaround this?