| ^ libzzuf/lib-fd.c: In function aio_read: libzzuf/lib-fd.c:622:20: error: dereferencing pointer to incomplete type struct aiocb 622 | int fd = aiocbp->aio_fildes; | ^~ libzzuf/lib-fd.c:624:31: warning: passing argument 1 of aio_read_orig from incompatible pointer type [-Wincompatible-pointer-types] ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.0_musl-20200316-165821 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-gentoo-linux-musl-9.3.0 * clang version 10.0.0 Target: x86_64-gentoo-linux-musl Thread model: posix InstalledDir: /usr/lib/llvm/10/bin /usr/lib/llvm/10 10.0.0 Available Python interpreters, in order of preference: [1] python3.8 [2] python3.7 [3] python3.6 [4] python2.7 (fallback) Available Ruby profiles: [1] ruby24 (with Rubygems) [2] ruby25 (with Rubygems) * Available Rust versions: [1] rust-1.41.1 * timestamp of HEAD at this tinderbox image: /var/db/repos/gentoo Sun Mar 22 18:14:26 UTC 2020 /var/db/repos/musl Sun Mar 22 15:02:57 UTC 2020 emerge -qpvO app-forensics/zzuf [ebuild N ] app-forensics/zzuf-0.15
Created attachment 624570 [details] emerge-info.txt
Created attachment 624572 [details] app-forensics:zzuf-0.15:20200322-200748.log
Created attachment 624574 [details] emerge-history.txt
Created attachment 624576 [details] environment
Created attachment 624578 [details] etc.portage.tbz2
Created attachment 624580 [details] logs.tbz2
Created attachment 624582 [details] temp.tbz2
The bug here is incomplete aio.h header on musl which autoconf can't detect as working: """ zzuf-0.15 # fgrep -A5 'checking aio.h usability' config.log configure:12580: checking aio.h usability configure:12580: x86_64-gentoo-linux-musl-gcc -c -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -std=c99 -g -O2 -Wall -W -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare conftest.c >&5 In file included from conftest.c:66: /usr/include/aio.h:21:18: error: field 'aio_sigevent' has incomplete type 21 | struct sigevent aio_sigevent; | ^~~~~~~~~~~~ """ Shorter reproducer is: """ $ x86_64-gentoo-linux-musl-gcc -xc -c -o /dev/null - <<<"#include <aio.h>" <ok> $ x86_64-gentoo-linux-musl-gcc -std=c99 -xc -c -o /dev/null - <<<"#include <aio.h>" In file included from <stdin>:1: /usr/include/aio.h:21:18: error: field 'aio_sigevent' has incomplete type 21 | struct sigevent aio_sigevent; | ^~~~~~~~~~~~ """ For comparison glibc system Just Works: """ $ x86_64-pc-linux-gnu-gcc -xc -c -o /dev/null - <<<"#include <aio.h>" $ x86_64-pc-linux-gnu-gcc -std=c99 -xc -c -o /dev/null - <<<"#include <aio.h>" """ I think it's a musl deficiency. Either aio.h should just work by defining complete 'struct aiocb' or it should just work by not defining 'struct aiocb' at all.
The problem at hand can be worked around by either making the Autoconf test for aio.h pass (which can be done e.g. by appending -D_POSIX_SOURCE to CFLAGS - see the musl version of signal.h to find out which complaiance levels are required in order to have 'struct sigevent' defined), or simply override the result of this test for USE=elibc_musl by appending -DHAVE_AIO_H=1 to CFLAGS (in theory appending to CPPFLAGS should suffice, haven't tested it though). Unfortunately this only makes compilation fail slightly later - on a musl system, Autoconf ends up setting the macro FPOS64_CAST(x) to "unknown".
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1205600d6d0ee0d83a00c6068c93a38e7f05d07c commit 1205600d6d0ee0d83a00c6068c93a38e7f05d07c Author: Marek Szuba <marecki@gentoo.org> AuthorDate: 2021-11-29 14:06:37 +0000 Commit: Marek Szuba <marecki@gentoo.org> CommitDate: 2021-11-29 14:55:51 +0000 app-forensics/zzuf: support musl in configure.ac One, call AC_USE_SYSTEM_EXTENSIONS so that all compiler invocations have the correct feature-set macros set. This is required so that configure can include the musl version of aio.h without error: field 'aio_sigevent' has incomplete type Not quite sure WHY this is necessary given that according to musl documentation, if no feature test macros are defined musl exposes the equivalent of _BSD_SOURCE - but there you go. Two, extend the test identifying the way of extracting raw position index from the structure fpos64_t, so that it supports the musl layout of this structure as well. With these two fixes in place zzuf builds successfully against musl. Tests (which currently have to be run manually because they like neither the sandbox nor out-of-tree builds) fail but in the same way as against glibc. Closes: https://bugs.gentoo.org/714030 Signed-off-by: Marek Szuba <marecki@gentoo.org> .../zzuf/files/zzuf-0.15_autoconf-musl.patch | 24 ++++++++++++++++++++++ app-forensics/zzuf/zzuf-0.15_p20190208.ebuild | 4 ++++ 2 files changed, 28 insertions(+)