[PATCH] configure: Add linux header compile support for LoongArch

Bibo Mao posted 1 patch 10 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240115073101.174113-1-maobibo@loongson.cn
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>
There is a newer version of this series
configure | 1 +
1 file changed, 1 insertion(+)
[PATCH] configure: Add linux header compile support for LoongArch
Posted by Bibo Mao 10 months, 2 weeks ago
When compiling qemu with system KVM mode for LoongArch, header files in
directory linux-headers/asm-loongarch should be used firstly. Otherwise it
fails to find kvm.h on system with old glibc, since latest kernel header
files are not installed.

This patch adds linux_arch definition for LoongArch system so that header
files in directory linux-headers/asm-loongarch can be included.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 21ab9a64e9..3d8e24ae01 100755
--- a/configure
+++ b/configure
@@ -445,6 +445,7 @@ case "$cpu" in
   loongarch*)
     cpu=loongarch64
     host_arch=loongarch64
+    linux_arch=loongarch
     ;;
 
   mips64*)
-- 
2.39.3
Re: [PATCH] configure: Add linux header compile support for LoongArch
Posted by Philippe Mathieu-Daudé 10 months, 2 weeks ago
On 15/1/24 08:31, Bibo Mao wrote:
> When compiling qemu with system KVM mode for LoongArch, header files in
> directory linux-headers/asm-loongarch should be used firstly. Otherwise it
> fails to find kvm.h on system with old glibc, since latest kernel header
> files are not installed.
> 
> This patch adds linux_arch definition for LoongArch system so that header
> files in directory linux-headers/asm-loongarch can be included.
> 

Fixes: 714b03c125 ("target/loongarch: Add loongarch kvm into meson build")

> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
>   configure | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>