Bug 230847 - mm: vm_map.h prevents QEMU compilation
Summary: mm: vm_map.h prevents QEMU compilation
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-23 16:06 UTC by Roger Pau Monné
Modified: 2020-08-15 03:48 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Pau Monné freebsd_committer freebsd_triage 2018-08-23 16:06:03 UTC
Hello,

While trying to compile the current version of QEMU I've got the following error:

  CC      hw/usb/dev-bluetooth.o
  CC      hw/usb/dev-smartcard-reader.o
  CC      hw/usb/dev-mtp.o
  CC      hw/usb/host-libusb.o
  CC      hw/usb/host-stub.o
  CC      hw/usb/xen-usb.o
  CC      hw/virtio/virtio-bus.o
  CC      hw/virtio/virtio-rng.o
  CC      hw/virtio/virtio-pci.o
  CC      hw/virtio/vhost-stub.o
  CC      hw/watchdog/watchdog.o
  CC      hw/watchdog/wdt_i6300esb.o
  CC      hw/watchdog/wdt_ib700.o
  CC      hw/xen/xen_backend.o
  CC      hw/xen/xen_devconfig.o
  CC      hw/xen/xen_pvdev.o
In file included from /root/src/xen/tools/qemu-xen-dir/hw/usb/xen-usb.c:30:
In file included from /root/src/xen/tools/qemu-xen-dir/include/hw/xen/xen_backend.h:4:
In file included from /root/src/xen/tools/qemu-xen-dir/include/hw/xen/xen_common.h:19:
In file included from /root/src/xen/tools/qemu-xen-dir/include/hw/pci/pci.h:6:
In file included from /root/src/xen/tools/qemu-xen-dir/include/sysemu/dma.h:16:
In file included from /root/src/xen/tools/qemu-xen-dir/include/block/block.h:10:
/root/src/xen/tools/qemu-xen-dir/include/block/dirty-bitmap.h:86:68: error: expected ')'
bool bdrv_dirty_iter_next_area(BdrvDirtyBitmapIter *iter, uint64_t max_offset,
                                                                   ^
/usr/include/vm/vm_map.h:188:26: note: expanded from macro 'max_offset'
#define max_offset      header.start    /* (c) */
                              ^
/root/src/xen/tools/qemu-xen-dir/include/block/dirty-bitmap.h:86:31: note: to match this '('
bool bdrv_dirty_iter_next_area(BdrvDirtyBitmapIter *iter, uint64_t max_offset,
                              ^
  CC      hw/xen/xen-common.o
  CC      migration/migration.o
1 error generated.
  CC      migration/socket.o

I'm not sure why vm_map.h gets included there, but in any case having macro names like max_offset is asking for trouble. I would like to ask for feedback, but IMO the easier way to solve this is to rename the macro to VM_MAX_OFFSET (and VM_MIN_OFFSET).
Comment 1 Konstantin Belousov freebsd_committer freebsd_triage 2018-08-24 16:47:48 UTC
https://reviews.freebsd.org/D16881
Comment 2 Ed Maste freebsd_committer freebsd_triage 2018-08-31 21:20:43 UTC
Committed in r338370
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2020-08-15 03:48:45 UTC
^Triage: assign to committer who resolved.