Hi,

I am using debian 10 container to compile qemu too.

I think that what happens here is that

  /usr/include/linux/swab.h

Uses BITS_PER_LONG instead of __BITS_PER_LONG which is actually defined before
in qemu at:

  include/qemu/bitops.h:#define BITS_PER_LONG           (sizeof (unsigned long) 
* BITS_PER_BYTE)

which injects this definition into the linux swab.h header.

By changing BITS_PER_LONG to __BITS_PER_LONG in the linux headers, I managed to
successfully compile qemu.

A different approach would be to move the linux header includes
(#include <linux/cdrom.h>) in file-posix.c above all other includes - which in
some way makes more sense (since we probaly don't want qemu defines to control
linux headers) but it requires a more complex refactoring.

Reply via email to