Xilinx / qemu

Xilinx's fork of Quick EMUlator (QEMU) with improved support and modelling for the Xilinx platforms.
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/821395464/QEMU+User+Documentation
Other
246 stars 154 forks source link

Build error on macOS: no member named 'sem' in 'struct QemuSemaphore' #48

Closed cdelledonne closed 4 years ago

cdelledonne commented 4 years ago

Problem

When trying to build QEMU on macOS, I get the following error, in addition to #47:

[...]/qemu/hw/core/remote-port.c:496:47: error: no member named 'sem' in 'struct QemuSemaphore'
                sem_getvalue(&s->rx_queue.sem.sem, &sval);
                              ~~~~~~~~~~~~~~~ ^

which originates from the definition of QemuSemaphore that does not include sem when CONFIG_SEM_TIMEDWAIT is not defined: https://github.com/Xilinx/qemu/blob/1eb7d50646fb8f481893135986ca8028c1f6e732/include/qemu/thread-posix.h#L27-L36

To Reproduce

  1. clone the repository
  2. comment out #include <byteswap.h> in hw/core/remote-port-proto.c to temporarily get rid of #47
  3. run
    mkdir build
    cd build
    ../configure --target-list=arm-softmmu --enable-fdt --disable-xen
    make

Environment

edgarigl commented 4 years ago

Hi,

I don't have easy access to a macOS system unfortunately. Any chance you could create a fix and submit a pull-request?

Thanks, Edgar

cdelledonne commented 4 years ago

Ok, I'll try to submit a PR soon.

cdelledonne commented 4 years ago

I just submitted #49 (that should fix #47) and #50 (that should fix this one)

cdelledonne commented 4 years ago

Closed with 2736c2b1a676fb3f6af87e41ec18e2ba5605ef56