diff mbox series

disas: Fix build against Capstone v6

Message ID 20240715213943.1210355-1-gustavo.romero@linaro.org
State Accepted
Commit 9971cbac2f30a89ddb094dc9627d2d16dc6e5875
Headers show
Series disas: Fix build against Capstone v6 | expand

Commit Message

Gustavo Romero July 15, 2024, 9:39 p.m. UTC
Capstone v6 made major changes, such as renaming for AArch64, which
broke programs using the old headers, like QEMU. However, Capstone v6
provides the CAPSTONE_AARCH64_COMPAT_HEADER compatibility definition
allowing to build against v6 with the old definitions, so fix the QEMU
build using it.

We can lift that definition and switch to the new naming once our
supported distros have Capstone v6 in place.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
---
 include/disas/capstone.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Richard Henderson July 15, 2024, 10:53 p.m. UTC | #1
On 7/16/24 07:39, Gustavo Romero wrote:
> Capstone v6 made major changes, such as renaming for AArch64, which
> broke programs using the old headers, like QEMU. However, Capstone v6
> provides the CAPSTONE_AARCH64_COMPAT_HEADER compatibility definition
> allowing to build against v6 with the old definitions, so fix the QEMU
> build using it.
> 
> We can lift that definition and switch to the new naming once our
> supported distros have Capstone v6 in place.
> 
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   include/disas/capstone.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/include/disas/capstone.h b/include/disas/capstone.h
> index e29068dd97..a11985151d 100644
> --- a/include/disas/capstone.h
> +++ b/include/disas/capstone.h
> @@ -3,6 +3,7 @@
>   
>   #ifdef CONFIG_CAPSTONE
>   
> +#define CAPSTONE_AARCH64_COMPAT_HEADER
>   #include <capstone.h>
>   
>   #else

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Paolo Bonzini July 16, 2024, 8:48 a.m. UTC | #2
Queued, thanks.

Paolo
Peter Maydell July 16, 2024, 9:38 a.m. UTC | #3
On Tue, 16 Jul 2024 at 09:48, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Queued, thanks.

Could you add

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2438

to the commit message?

thanks
-- PMM
diff mbox series

Patch

diff --git a/include/disas/capstone.h b/include/disas/capstone.h
index e29068dd97..a11985151d 100644
--- a/include/disas/capstone.h
+++ b/include/disas/capstone.h
@@ -3,6 +3,7 @@ 
 
 #ifdef CONFIG_CAPSTONE
 
+#define CAPSTONE_AARCH64_COMPAT_HEADER
 #include <capstone.h>
 
 #else