Skip to content

QEMU needs compat tweak to build against upstream capstone 6

The upstream Capstone disassembly library made a major overhaul for their v6. The good news is that they're now much more up to date with new architecture extensions for Arm. The bad news is that they had to make some changes that mean that programs like QEMU that built against the older headers don't out-of-the-box compile against v6. The details are in https://github.com/capstone-engine/capstone/blob/404912f06846d3c3da5ee54f849017c8f69a5925/docs/cs_v6_release_guide.md but the brief summary is:

  • functions, enum values, etc that used to be "ARM64" are now "AArch64"
  • there's a backwards-compatibility layer that we can use while we still need to be able to compile against both pre-v6 and v6

If we ensure that we #define CAPSTONE_AARCH64_COMPAT_HEADER in our disas/capstone.h before we #include <capstone/capstone.h> this should let us continue to use the pre-v6 function naming. Eventually when all our supported distros have capstone v6 we should probably switch over to the new naming.

I don't know if any distros yet are packaging capstone 6, but we might as well get ahead of them and put the compat handling in now.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information