On Sun, 23 Jan 2022 at 08:58, Adam Baxter <volta...@voltagex.org> wrote: > I'm trying to compile qemu 6.2.0 using musl-cross. > > I am getting the following errors on make: > > /output/aarch64-linux-musl/include/asm/sigcontext.h:83:8: error: redefinition > of 'struct esr_context' > /output/aarch64-linux-musl/include/asm/sigcontext.h:116:8: error: > redefinition of 'struct extra_context' > /output/aarch64-linux-musl/include/asm/sigcontext.h:125:8: error: > redefinition of 'struct sve_context'
I think this must be a musl problem. Quoting the full error message: In file included from /output/aarch64-linux-musl/include/asm/ptrace.h:26, from linux-headers/asm/kvm.h:37, from /src/qemu/linux-headers/linux/kvm.h:15, from /src/qemu/include/sysemu/kvm.h:25, from ../hw/arm/boot.c:18: /output/aarch64-linux-musl/include/asm/sigcontext.h:28:8: error: redefinition of 'struct sigcontext' 28 | struct sigcontext { | ^~~~~~~~~~ In file included from /output/aarch64-linux-musl/include/signal.h:48, from /src/qemu/include/qemu/osdep.h:105, from ../hw/arm/boot.c:10: /output/aarch64-linux-musl/include/bits/signal.h:18:16: note: originally defined here 18 | typedef struct sigcontext { | ^~~~~~~~~~ In file included from /output/aarch64-linux-musl/include/asm/ptrace.h:26, from linux-headers/asm/kvm.h:37, from /src/qemu/linux-headers/linux/kvm.h:15, from /src/qemu/include/sysemu/kvm.h:25, from ../hw/arm/boot.c:18: /output/aarch64-linux-musl/include/asm/sigcontext.h:66:8: error: redefinition of 'struct _aarch64_ctx' 66 | struct _aarch64_ctx { | ^~~~~~~~~~~~ In file included from /output/aarch64-linux-musl/include/signal.h:48, from /src/qemu/include/qemu/osdep.h:105, from ../hw/arm/boot.c:10: /output/aarch64-linux-musl/include/bits/signal.h:29:8: note: originally defined here 29 | struct _aarch64_ctx { | ^~~~~~~~~~~~ The compiler is complaining because the system headers (provided by musl) are defining these structs both in asm/sigcontext.h and in signal.h, which means those headers can't both be included at once. This isn't QEMU related: musl's headers just seem to be broken here. glibc doesn't have this bug. -- PMM