Package: src:qemu
Version: 1:8.0.2+dfsg-3
Severity: normal
Tags: patch
X-Debbugs-Cc: none, Hilko Bengen <ben...@debian.org>

Dear Maintainer,

qemu fails to build from source against capstone 5 (now in experimental)
due to a duplicate symbol "tricore_feature" which is part of the
capstone headers now. The attached patch fixes this.

Cheers,
-Hilko
Subject: Fix Capstone5 FTBFS
From: Hilko Bengen <ben...@debian.org>
Forwarded: not-needed

Based on https://github.com/qemu/qemu/pull/240 by Rui Chen

diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
index d0a9272961..cc49513cde 100644
--- a/target/tricore/cpu.c
+++ b/target/tricore/cpu.c
@@ -103,14 +103,14 @@ static void tricore_cpu_realizefn(DeviceState *dev, Error **errp)
     }
 
     /* Some features automatically imply others */
-    if (tricore_feature(env, TRICORE_FEATURE_161)) {
+    if (is_tricore_feature_enabled(env, TRICORE_FEATURE_161)) {
         set_feature(env, TRICORE_FEATURE_16);
     }
 
-    if (tricore_feature(env, TRICORE_FEATURE_16)) {
+    if (is_tricore_feature_enabled(env, TRICORE_FEATURE_16)) {
         set_feature(env, TRICORE_FEATURE_131);
     }
-    if (tricore_feature(env, TRICORE_FEATURE_131)) {
+    if (is_tricore_feature_enabled(env, TRICORE_FEATURE_131)) {
         set_feature(env, TRICORE_FEATURE_13);
     }
     cpu_reset(cs);
diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h
index 47d0ffb745..995f1e92e6 100644
--- a/target/tricore/cpu.h
+++ b/target/tricore/cpu.h
@@ -258,7 +258,7 @@ enum tricore_features {
     TRICORE_FEATURE_161,
 };
 
-static inline int tricore_feature(CPUTriCoreState *env, int feature)
+static inline int is_tricore_feature_enabled(CPUTriCoreState *env, int feature)
 {
     return (env->features & (1ULL << feature)) != 0;
 }
diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c
index 532ae6b74c..cbc3d6c01e 100644
--- a/target/tricore/op_helper.c
+++ b/target/tricore/op_helper.c
@@ -2528,7 +2528,7 @@ void helper_ret(CPUTriCoreState *env)
     /* PCXI = new_PCXI; */
     env->PCXI = new_PCXI;
 
-    if (tricore_feature(env, TRICORE_FEATURE_13)) {
+    if (is_tricore_feature_enabled(env, TRICORE_FEATURE_13)) {
         /* PSW = new_PSW */
         psw_write(env, new_PSW);
     } else {
@@ -2639,7 +2639,7 @@ void helper_rfm(CPUTriCoreState *env)
     env->gpr_a[10] = cpu_ldl_data(env, env->DCX+8);
     env->gpr_a[11] = cpu_ldl_data(env, env->DCX+12);
 
-    if (tricore_feature(env, TRICORE_FEATURE_131)) {
+    if (is_tricore_feature_enabled(env, TRICORE_FEATURE_131)) {
         env->DBGTCR = 0;
     }
 }

Reply via email to