xemu-project / xemu

Original Xbox Emulator for Windows, macOS, and Linux (Active Development)
https://xemu.app
Other
2.8k stars 279 forks source link

Building on 32bit OS broken since APU changes #159

Open GXTX opened 3 years ago

GXTX commented 3 years ago
In file included from /home/wutno/Projects/xemu/include/qemu/osdep.h:37,
                 from /home/wutno/Projects/xemu/hw/xbox/mcpx/apu.c:22:
/home/wutno/Projects/xemu/hw/xbox/mcpx/apu.c: In function 'is_voice_locked':
/home/wutno/Projects/xemu/include/qemu/compiler.h:96:36: error: static assertion failed: "not expecting: sizeof(*&d->vp.voice_locked[v / 64]) > ATOMIC_REG_SIZE"
   96 | #define QEMU_BUILD_BUG_MSG(x, msg) _Static_assert(!(x), msg)
      |                                    ^~~~~~~~~~~~~~
/home/wutno/Projects/xemu/include/qemu/compiler.h:105:30: note: in expansion of macro 'QEMU_BUILD_BUG_MSG'
  105 | #define QEMU_BUILD_BUG_ON(x) QEMU_BUILD_BUG_MSG(x, "not expecting: " #x)
      |                              ^~~~~~~~~~~~~~~~~~
/home/wutno/Projects/xemu/include/qemu/atomic.h:133:5: note: in expansion of macro 'QEMU_BUILD_BUG_ON'
  133 |     QEMU_BUILD_BUG_ON(sizeof(*ptr) > ATOMIC_REG_SIZE); \
      |     ^~~~~~~~~~~~~~~~~
/home/wutno/Projects/xemu/hw/xbox/mcpx/apu.c:451:13: note: in expansion of macro 'atomic_read'
  451 |     return (atomic_read(&d->vp.voice_locked[v / 64]) & mask) != 0;
      |             ^~~~~~~~~~~
make[1]: *** [/home/wutno/Projects/xemu/rules.mak:69: hw/xbox/mcpx/apu.o] Error 1
make: *** [Makefile:569: i386-softmmu/all] Error 2
GXTX commented 3 years ago

Offending line in apu.c, however atomic.h has some notes about ATOMIC_REG_SIZE here, that suggests i686 would support this but they put the limitation, just because?

I'm not sure it's worth 'fixing' at this point with the GL requirements having been pushed higher somewhat recently.

mborgerson commented 3 years ago

This can still be fixed it just hasn't been a priority. The patch should be trivial if you want to try

GXTX commented 3 years ago

As a test I just set it to be 8 size but unfortunately I don't have a card for this system which supports OpenGL 4.0, the card I have supports 3.3. There are PCI cards which can support higher but the price of them has been skyrocketing as of late (and are quite rare as they would deep into PCIe standard), so I'm going to consider this as something which wont be get fixed as anyone running a 32bit OS likely isn't running xemu with a card new enough for 4.0. Removing the check it seems xemu does indeed require 4.0 support.

mborgerson commented 3 years ago

This can and should still be fixed. I'll get to it. Re-opened for tracking.