On 07/03/20 12:50, Peter Maydell wrote:
...
This is because you're trying to apply the patch to the
5.0.0 release, but it was made against the current head-of-git,
and this file has changed a little between the two.
Generally we do all development against head-of-git, so
I would suggest that you try again with that.

As it happens, the current preferred fix for the drm.c issue
is this one:
https://patchew.org/QEMU/20200703145614.16684-1-peter.maydell@linaro.org/20200703145614.16684-10-peter.maydell@linaro.org/
I see.  I downloaded 5.0.0 mainly because I don't understand how git works.  Anyway, I applied your new  patch and it worked.

I tried gmake again and got further.  This time it's stopping here:

root@hemlock:~/qemu-5.0.0# gmake -j16
...
CC      hw/usb/hcd-uhci.o
In file included from hw/tpm/tpm_emulator.c:37:0:
hw/tpm/tpm_ioctl.h:222:30: warning: implicit declaration of function '_IOR\'; did you mean '_IORW'? [-Wimplicit-function-declaration]
     PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
                              ^~~~
                              _IORW
hw/tpm/tpm_ioctl.h:222:43: error: expected expression before \u2018ptm_cap\u2019
     PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
                                           ^~~~~~~
hw/tpm/tpm_ioctl.h:223:30: warning: implicit declaration of function \u2018_IOWR\u2019; did you mean \u2018_IOWRT\u2019? [-Wimplicit-function-declaration]
     PTM_INIT               = _IOWR('P', 1, ptm_init),
                              ^~~~~
                              _IOWRT
hw/tpm/tpm_ioctl.h:223:44: error: expected expression before \u2018ptm_init\u2019
     PTM_INIT               = _IOWR('P', 1, ptm_init),
                                            ^~~~~~~~
hw/tpm/tpm_ioctl.h:224:43: error: expected expression before \u2018ptm_res\u2019
     PTM_SHUTDOWN           = _IOR('P', 2, ptm_res),
                                           ^~~~~~~
hw/tpm/tpm_ioctl.h:225:43: error: expected expression before \u2018ptm_est\u2019
     PTM_GET_TPMESTABLISHED = _IOR('P', 3, ptm_est),
                                           ^~~~~~~
hw/tpm/tpm_ioctl.h:226:44: error: expected expression before \u2018ptm_loc\u2019
     PTM_SET_LOCALITY       = _IOWR('P', 4, ptm_loc),
                                            ^~~~~~~
hw/tpm/tpm_ioctl.h:227:43: error: expected expression before \u2018ptm_res\u2019
     PTM_HASH_START         = _IOR('P', 5, ptm_res),
                                           ^~~~~~~
hw/tpm/tpm_ioctl.h:228:44: error: expected expression before \u2018ptm_hdata\u2019
     PTM_HASH_DATA          = _IOWR('P', 6, ptm_hdata),
                                            ^~~~~~~~~
hw/tpm/tpm_ioctl.h:229:43: error: expected expression before \u2018ptm_res\u2019
     PTM_HASH_END           = _IOR('P', 7, ptm_res),
                                           ^~~~~~~
hw/tpm/tpm_ioctl.h:230:43: error: expected expression before \u2018ptm_res\u2019
     PTM_CANCEL_TPM_CMD     = _IOR('P', 8, ptm_res),
                                           ^~~~~~~
hw/tpm/tpm_ioctl.h:231:43: error: expected expression before \u2018ptm_res\u2019
     PTM_STORE_VOLATILE     = _IOR('P', 9, ptm_res),
                                           ^~~~~~~
hw/tpm/tpm_ioctl.h:232:47: error: expected expression before \u2018ptm_reset_est\u2019
     PTM_RESET_TPMESTABLISHED = _IOWR('P', 10, ptm_reset_est),
                                               ^~~~~~~~~~~~~
hw/tpm/tpm_ioctl.h:233:45: error: expected expression before \u2018ptm_getstate\u2019
     PTM_GET_STATEBLOB      = _IOWR('P', 11, ptm_getstate),
                                             ^~~~~~~~~~~~
hw/tpm/tpm_ioctl.h:234:45: error: expected expression before \u2018ptm_setstate\u2019
     PTM_SET_STATEBLOB      = _IOWR('P', 12, ptm_setstate),
                                             ^~~~~~~~~~~~
  CC      hw/usb/hcd-ohci.o
hw/tpm/tpm_ioctl.h:235:44: error: expected expression before \u2018ptm_res\u2019
     PTM_STOP               = _IOR('P', 13, ptm_res),
                                            ^~~~~~~
hw/tpm/tpm_ioctl.h:236:44: error: expected expression before \u2018ptm_getconfig\u2019
     PTM_GET_CONFIG         = _IOR('P', 14, ptm_getconfig),
                                            ^~~~~~~~~~~~~
hw/tpm/tpm_ioctl.h:237:44: error: expected expression before \u2018ptm_res\u2019
     PTM_SET_DATAFD         = _IOR('P', 15, ptm_res),
                                            ^~~~~~~
hw/tpm/tpm_ioctl.h:238:45: error: expected expression before \u2018ptm_setbuffersize\u2019
     PTM_SET_BUFFERSIZE     = _IOWR('P', 16, ptm_setbuffersize),
                                             ^~~~~~~~~~~~~~~~~
  CC      hw/usb/hcd-ohci-pci.o
gmake: *** [/export/home/denber/qemu-5.0.0/rules.mak:69: hw/tpm/tpm_emulator.o] Error 1


It appears that _IOR & friends are defined in /usr/include/sys/ioccom.h, but I can't figure out how to point gmake to that.  Do I need some sort of "-I" in the Makefile?


When I built QEMU 2.12, I ran into this too and ended up just commenting out all the references to _IOR, etc. in hw/tpm/tpm_ioctl.h but maybe we can do something more elegant this time.  Thanks.

            - Michele