mirror of
https://gitee.com/openharmony/kernel_linux_build
synced 2024-11-27 01:11:43 +00:00
build for loongarch64 qemu target
Signed-off-by: Wu Xiaotian <wuxiaotian@loongson.cn>
This commit is contained in:
parent
3298bea772
commit
207806e149
2
BUILD.gn
2
BUILD.gn
@ -29,6 +29,8 @@ if (target_cpu == "arm") {
|
||||
kernel_image = "Image"
|
||||
} else if (target_cpu == "x86_64") {
|
||||
kernel_image = "bzImage"
|
||||
} else if (target_cpu == "loongarch64") {
|
||||
kernel_image = "vmlinuz.efi"
|
||||
}
|
||||
|
||||
if (os_level == "mini" || os_level == "small") {
|
||||
|
@ -41,6 +41,9 @@ elif [ "$5" == "arm64" ];then
|
||||
elif [ "$5" == "riscv64" ];then
|
||||
cp ${2}/kernel/OBJ/${8}/arch/riscv/boot/Image ${3}/Image
|
||||
|
||||
elif [ "$5" == "loongarch64" ];then
|
||||
cp ${2}/kernel/OBJ/${8}/vmlinuz.efi ${3}/vmlinuz.efi
|
||||
|
||||
elif [ "$5" == "x86_64" ];then
|
||||
cp ${2}/kernel/OBJ/${8}/arch/x86/boot/bzImage ${3}/bzImage
|
||||
fi
|
||||
|
@ -49,13 +49,19 @@ else ifeq ($(KERNEL_ARCH), riscv64)
|
||||
else ifeq ($(KERNEL_ARCH), x86_64)
|
||||
KERNEL_TARGET_TOOLCHAIN := gcc
|
||||
KERNEL_TARGET_TOOLCHAIN_PREFIX :=
|
||||
else ifeq ($(KERNEL_ARCH), loongarch64)
|
||||
KERNEL_TARGET_TOOLCHAIN := $(PREBUILTS_GCC_DIR)/linux-x86/loongarch64/gcc-loongarch64-linux-gnu/bin
|
||||
KERNEL_TARGET_TOOLCHAIN_PREFIX := $(KERNEL_TARGET_TOOLCHAIN)/loongarch64-unknown-linux-gnu-
|
||||
KERNEL_ARCH := loongarch
|
||||
endif
|
||||
|
||||
ifeq ($(DEVICE_NAME), hispark_phoenix)
|
||||
KERNEL_CROSS_COMPILE += CONFIG_MSP="y"
|
||||
endif
|
||||
|
||||
ifneq ($(KERNEL_ARCH), loongarch)
|
||||
KERNEL_CROSS_COMPILE += CC="$(CLANG_CC)"
|
||||
endif
|
||||
|
||||
ifneq ($(KERNEL_ARCH), x86_64)
|
||||
KERNEL_CROSS_COMPILE += CROSS_COMPILE="$(KERNEL_TARGET_TOOLCHAIN_PREFIX)"
|
||||
|
@ -38,11 +38,15 @@ elif [ "$KERNEL_ARCH" == "arm64" ];then
|
||||
kernel_image="Image"
|
||||
elif [ "$KERNEL_ARCH" == "x86_64" ];then
|
||||
kernel_image="bzImage"
|
||||
elif [ "$KERNEL_ARCH" == "loongarch64" ];then
|
||||
kernel_image="vmlinuz.efi"
|
||||
fi
|
||||
export KERNEL_IMAGE=${kernel_image}
|
||||
|
||||
if [ "$KERNEL_ARCH" == "riscv64" ];then
|
||||
LINUX_KERNEL_IMAGE_FILE=${LINUX_KERNEL_OBJ_OUT}/arch/riscv/boot/Image
|
||||
elif [ "$KERNEL_ARCH" == "loongarch64" ];then
|
||||
LINUX_KERNEL_IMAGE_FILE=${LINUX_KERNEL_OBJ_OUT}/${kernel_image}
|
||||
else
|
||||
LINUX_KERNEL_IMAGE_FILE=${LINUX_KERNEL_OBJ_OUT}/arch/${KERNEL_ARCH}/boot/${kernel_image}
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user