[PATCH] tcg/loongarch64: Fix compile issue LoongArch host

Bibo Mao posted 1 patch 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260827081138.1448296-1-maobibo@loongson.cn
Maintainers: WANG Xuerui <git@xen0n.name>, Richard Henderson <richard.henderson@linaro.org>
tcg/loongarch64/tcg-target.c.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] tcg/loongarch64: Fix compile issue LoongArch host
Posted by Bibo Mao 1 month ago
On LoongArch host machine, qemu fails to compile. The error is something like
this:
In file included from ../tcg/tcg.c:1098:
tcg/loongarch64/tcg-target.c.inc:1896:27: error: expected ‘}’ before ‘;’ token
 1896 |     .out_rr = tgen_revbit8;
      |                           ^
tcg/loongarch64/tcg-target.c.inc:1894:44: note: to match this ‘{’
 1894 | static const TCGOutOpUnary outop_revbit8 = {

Here fix one small typo issue and pass to compile on LoongArch host.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 tcg/loongarch64/tcg-target.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index f65496a040..69e76807d6 100644
--- a/tcg/loongarch64/tcg-target.c.inc
+++ b/tcg/loongarch64/tcg-target.c.inc
@@ -1893,7 +1893,7 @@ static void tgen_revbit8(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1)
 
 static const TCGOutOpUnary outop_revbit8 = {
     .base.static_constraint = C_O1_I1(r, r),
-    .out_rr = tgen_revbit8;
+    .out_rr = tgen_revbit8,
 };
 
 static void tgen_revbit32(TCGContext *s, TCGType type,

base-commit: 324bb5ef83ad5e9026ea3242f99ba53191a7bf3f
-- 
2.54.0


Re: [PATCH] tcg/loongarch64: Fix compile issue LoongArch host
Posted by Richard Henderson 1 month ago
On 8/27/26 01:11, Bibo Mao wrote:
> On LoongArch host machine, qemu fails to compile. The error is something like
> this:
> In file included from ../tcg/tcg.c:1098:
> tcg/loongarch64/tcg-target.c.inc:1896:27: error: expected ‘}’ before ‘;’ token
>   1896 |     .out_rr = tgen_revbit8;
>        |                           ^
> tcg/loongarch64/tcg-target.c.inc:1894:44: note: to match this ‘{’
>   1894 | static const TCGOutOpUnary outop_revbit8 = {
> 
> Here fix one small typo issue and pass to compile on LoongArch host.
> 
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
>   tcg/loongarch64/tcg-target.c.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
> index f65496a040..69e76807d6 100644
> --- a/tcg/loongarch64/tcg-target.c.inc
> +++ b/tcg/loongarch64/tcg-target.c.inc
> @@ -1893,7 +1893,7 @@ static void tgen_revbit8(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1)
>   
>   static const TCGOutOpUnary outop_revbit8 = {
>       .base.static_constraint = C_O1_I1(r, r),
> -    .out_rr = tgen_revbit8;
> +    .out_rr = tgen_revbit8,
>   };
>   
>   static void tgen_revbit32(TCGContext *s, TCGType type,
> 
> base-commit: 324bb5ef83ad5e9026ea3242f99ba53191a7bf3f

Sorry about that.  I clearly did not correctly transfer my work between 
machines after testing.  I've applied this directly to master as a build 
fix.

We should add a cross-loongarch64 test to CI.


r~