Vim4 Android11 build kernel is faild

Which version of system do you use? Khadas official images, self built images, or others?

`vim4, Android11, self build images

Please describe your issue below:

Please see the log below. I have a question about why Android can compile through the kernel compilation error?

Post a console log of your issue below:

+ cd /home/jojo/work/sdk/amlogic/code1/out/android11-5.4/common
+ make O=/home/jojo/work/sdk/amlogic/code1/out/android11-5.4/common CC=clang HOSTCC=clang LD=ld.lld NM=llvm-nm OBJCOPY=llvm-objcopy
  GEN     Makefile
  WRAP    arch/arm64/include/generated/uapi/asm/kvm_para.h
  WRAP    arch/arm64/include/generated/uapi/asm/errno.h
  WRAP    arch/arm64/include/generated/uapi/asm/ioctls.h
  WRAP    arch/arm64/include/generated/uapi/asm/ioctl.h
  WRAP    arch/arm64/include/generated/uapi/asm/ipcbuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/mman.h
  WRAP    arch/arm64/include/generated/uapi/asm/msgbuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/poll.h
  WRAP    arch/arm64/include/generated/uapi/asm/resource.h
  WRAP    arch/arm64/include/generated/uapi/asm/sembuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/shmbuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/siginfo.h
  WRAP    arch/arm64/include/generated/uapi/asm/socket.h
  WRAP    arch/arm64/include/generated/uapi/asm/sockios.h
  WRAP    arch/arm64/include/generated/uapi/asm/stat.h
  WRAP    arch/arm64/include/generated/uapi/asm/swab.h
  WRAP    arch/arm64/include/generated/uapi/asm/termbits.h
  WRAP    arch/arm64/include/generated/uapi/asm/termios.h
  WRAP    arch/arm64/include/generated/uapi/asm/types.h
  UPD     include/generated/uapi/linux/version.h
  WRAP    arch/arm64/include/generated/asm/bugs.h
  WRAP    arch/arm64/include/generated/asm/delay.h
  HOSTCC  scripts/dtc/dtc.o
  WRAP    arch/arm64/include/generated/asm/div64.h
  WRAP    arch/arm64/include/generated/asm/dma.h
  WRAP    arch/arm64/include/generated/asm/dma-contiguous.h
  WRAP    arch/arm64/include/generated/asm/dma-mapping.h
  WRAP    arch/arm64/include/generated/asm/early_ioremap.h
  WRAP    arch/arm64/include/generated/asm/emergency-restart.h
  WRAP    arch/arm64/include/generated/asm/hw_irq.h
  WRAP    arch/arm64/include/generated/asm/irq_regs.h
  WRAP    arch/arm64/include/generated/asm/kdebug.h
  WRAP    arch/arm64/include/generated/asm/kmap_types.h
  WRAP    arch/arm64/include/generated/asm/local.h
  WRAP    arch/arm64/include/generated/asm/local64.h
  WRAP    arch/arm64/include/generated/asm/mcs_spinlock.h
  WRAP    arch/arm64/include/generated/asm/mm-arch-hooks.h
  WRAP    arch/arm64/include/generated/asm/mmiowb.h
  WRAP    arch/arm64/include/generated/asm/msi.h
  WRAP    arch/arm64/include/generated/asm/qrwlock.h
  WRAP    arch/arm64/include/generated/asm/qspinlock.h
  WRAP    arch/arm64/include/generated/asm/serial.h
  WRAP    arch/arm64/include/generated/asm/set_memory.h
  WRAP    arch/arm64/include/generated/asm/switch_to.h
  WRAP    arch/arm64/include/generated/asm/trace_clock.h
  WRAP    arch/arm64/include/generated/asm/unaligned.h
  WRAP    arch/arm64/include/generated/asm/user.h
  WRAP    arch/arm64/include/generated/asm/vga.h
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.[ch]
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/genksyms/genksyms.o
grep: /home/jojo/work/sdk/amlogic/code1/common/.config: No such file or directory
  HOSTCC  scripts/selinux/genheaders/genheaders
  HOSTCC  scripts/selinux/mdp/mdp
  YACC    scripts/genksyms/parse.tab.[ch]
  HOSTCC  scripts/kallsyms
  LEX     scripts/genksyms/lex.lex.c
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTCC  scripts/recordmcount
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/sortextable
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/extract-cert
  LDS     scripts/module-lto.lds
  UPD     include/config/kernel.release
  UPD     include/generated/utsrelease.h
  DTC     arch/arm64/boot/dts/amlogic/kvim4.dtb
  DTC     arch/arm64/boot/dts/amlogic/kvim4n.dtb
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/empty.o
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1634.5-15: Warning (reg_format): /csiphy0@0xfe3bec00/ports/port@0/endpoint:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1656.5-15: Warning (reg_format): /csiphy2@0xfe3bec00/ports/port@0/endpoint:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/amlogic/kvim4n.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/amlogic/kvim4n.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/amlogic/kvim4n.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1633.25-1639.6: Warning (avoid_default_addr_size): /csiphy0@0xfe3bec00/ports/port@0/endpoint: Relying on default #address-cells value
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1633.25-1639.6: Warning (avoid_default_addr_size): /csiphy0@0xfe3bec00/ports/port@0/endpoint: Relying on default #size-cells value
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1655.25-1661.6: Warning (avoid_default_addr_size): /csiphy2@0xfe3bec00/ports/port@0/endpoint: Relying on default #address-cells value
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1655.25-1661.6: Warning (avoid_default_addr_size): /csiphy2@0xfe3bec00/ports/port@0/endpoint: Relying on default #size-cells value
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1434.26-1438.6: Warning (graph_endpoint): /soc/apb4@fe000000/i2c@6a000/sensor2@36/port/ov08a10: graph endpoint node name should be 'endpoint'
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1633.25-1639.6: Warning (graph_endpoint): /csiphy0@0xfe3bec00/ports/port@0/endpoint: graph node unit address error, expected "0"
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1633.25-1639.6: Warning (graph_endpoint): /csiphy0@0xfe3bec00/ports/port@0/endpoint: graph node '#address-cells' is -1, must be 1
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1633.25-1639.6: Warning (graph_endpoint): /csiphy0@0xfe3bec00/ports/port@0/endpoint: graph node '#size-cells' is -1, must be 0
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1655.25-1661.6: Warning (graph_endpoint): /csiphy2@0xfe3bec00/ports/port@0/endpoint: graph node unit address error, expected "2"
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1655.25-1661.6: Warning (graph_endpoint): /csiphy2@0xfe3bec00/ports/port@0/endpoint: graph node '#address-cells' is -1, must be 1
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/boot/dts/amlogic/kvim4n.dts:1655.25-1661.6: Warning (graph_endpoint): /csiphy2@0xfe3bec00/ports/port@0/endpoint: graph node '#size-cells' is -1, must be 0
  CC      scripts/mod/devicetable-offsets.s
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTLD  scripts/mod/modpost
  CC      kernel/bounds.s
  CALL    /home/jojo/work/sdk/amlogic/code1/common/scripts/atomic/check-atomics.sh
  UPD     include/generated/timeconst.h
  UPD     include/generated/bounds.h
  CC      arch/arm64/kernel/asm-offsets.s
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/kernel/asm-offsets.c:10:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/arm_sdei.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/ghes.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/apei.h:9:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/acpi.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/irqdomain.h:35:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/of.h:17:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kobject.h:20:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/sysfs.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kernfs.h:12:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mutex.h:19:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/processor.h:33:
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/cpufeature.h:661:18: error: use of undeclared identifier 'CONFIG_ARM64_PA_BITS'
        default: return CONFIG_ARM64_PA_BITS;
                        ^
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/kernel/asm-offsets.c:10:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/arm_sdei.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/ghes.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/apei.h:9:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/acpi.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/irqdomain.h:35:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/of.h:17:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kobject.h:20:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/sysfs.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kernfs.h:12:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mutex.h:19:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/processor.h:36:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/pgtable-hwdef.h:8:
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:61:5: warning: 'CONFIG_ARM64_VA_BITS' is not defined, evaluates to 0 [-Wundef]
#if VA_BITS > 48
    ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:46:20: note: expanded from macro 'VA_BITS'
#define VA_BITS                 (CONFIG_ARM64_VA_BITS)
                                 ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:99:55: warning: 'CONFIG_ARM64_PAGE_SHIFT' is not defined, evaluates to 0 [-Wundef]
#if defined(CONFIG_VMAP_STACK) && (MIN_THREAD_SHIFT < PAGE_SHIFT)
                                                      ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page-def.h:15:21: note: expanded from macro 'PAGE_SHIFT'
#define PAGE_SHIFT              CONFIG_ARM64_PAGE_SHIFT
                                ^
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/kernel/asm-offsets.c:10:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/arm_sdei.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/ghes.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/apei.h:9:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/acpi.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/irqdomain.h:35:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/of.h:17:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kobject.h:20:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/sysfs.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kernfs.h:12:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mutex.h:19:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/processor.h:36:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/pgtable-hwdef.h:8:
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:105:21: warning: 'CONFIG_ARM64_PAGE_SHIFT' is not defined, evaluates to 0 [-Wundef]
#if THREAD_SHIFT >= PAGE_SHIFT
                    ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page-def.h:15:21: note: expanded from macro 'PAGE_SHIFT'
#define PAGE_SHIFT              CONFIG_ARM64_PAGE_SHIFT
                                ^
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/kernel/asm-offsets.c:10:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/arm_sdei.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/ghes.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/apei.h:9:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/acpi.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/irqdomain.h:35:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/of.h:17:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kobject.h:20:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/sysfs.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kernfs.h:12:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mutex.h:19:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/processor.h:36:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/pgtable-hwdef.h:8:
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:196:24: error: use of undeclared identifier 'CONFIG_ARM64_VA_BITS'
        return kimage_vaddr - KIMAGE_VADDR;
                              ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:49:24: note: expanded from macro 'KIMAGE_VADDR'
#define KIMAGE_VADDR            (MODULES_END)
                                 ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:53:23: note: expanded from macro 'MODULES_END'
#define MODULES_END             (MODULES_VADDR + MODULES_VSIZE)
                                 ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:54:25: note: expanded from macro 'MODULES_VADDR'
#define MODULES_VADDR           (BPF_JIT_REGION_END)
                                 ^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:90:37: note: expanded from macro 'KASAN_SHADOW_END'
#define KASAN_SHADOW_END        (_PAGE_END(VA_BITS_MIN))
                                           ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:64:23: note: expanded from macro 'VA_BITS_MIN'
#define VA_BITS_MIN             (VA_BITS)
                                 ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:46:20: note: expanded from macro 'VA_BITS'
#define VA_BITS                 (CONFIG_ARM64_VA_BITS)
                                 ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:294:9: error: use of undeclared identifier 'CONFIG_ARM64_VA_BITS'
        return __virt_to_phys((unsigned long)(x));
               ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:273:27: note: expanded from macro '__virt_to_phys'
#define __virt_to_phys(x)       __virt_to_phys_nodebug(x)
                                ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:264:2: note: expanded from macro '__virt_to_phys_nodebug'
        __is_lm_address(__x) ? __lm_to_phys(__x) : __kimg_to_phys(__x); \
        ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:257:47: note: expanded from macro '__is_lm_address'
#define __is_lm_address(addr)   (((u64)(addr) ^ PAGE_OFFSET) < (PAGE_END - PAGE_OFFSET))
                                                ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:48:36: note: expanded from macro 'PAGE_OFFSET'
#define PAGE_OFFSET             (_PAGE_OFFSET(VA_BITS))
                                              ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:46:20: note: expanded from macro 'VA_BITS'
#define VA_BITS                 (CONFIG_ARM64_VA_BITS)
                                 ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:294:9: error: use of undeclared identifier 'CONFIG_ARM64_VA_BITS'
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:273:27: note: expanded from macro '__virt_to_phys'
#define __virt_to_phys(x)       __virt_to_phys_nodebug(x)
                                ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:264:2: note: expanded from macro '__virt_to_phys_nodebug'
        __is_lm_address(__x) ? __lm_to_phys(__x) : __kimg_to_phys(__x); \
        ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:257:74: note: expanded from macro '__is_lm_address'
#define __is_lm_address(addr)   (((u64)(addr) ^ PAGE_OFFSET) < (PAGE_END - PAGE_OFFSET))
                                                                           ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:48:36: note: expanded from macro 'PAGE_OFFSET'
#define PAGE_OFFSET             (_PAGE_OFFSET(VA_BITS))
                                              ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:46:20: note: expanded from macro 'VA_BITS'
#define VA_BITS                 (CONFIG_ARM64_VA_BITS)
                                 ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:294:9: error: use of undeclared identifier 'CONFIG_ARM64_VA_BITS'
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:273:27: note: expanded from macro '__virt_to_phys'
#define __virt_to_phys(x)       __virt_to_phys_nodebug(x)
                                ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:264:25: note: expanded from macro '__virt_to_phys_nodebug'
        __is_lm_address(__x) ? __lm_to_phys(__x) : __kimg_to_phys(__x); \
                               ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:259:40: note: expanded from macro '__lm_to_phys'
#define __lm_to_phys(addr)      (((addr) & ~PAGE_OFFSET) + PHYS_OFFSET)
                                            ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:48:36: note: expanded from macro 'PAGE_OFFSET'
#define PAGE_OFFSET             (_PAGE_OFFSET(VA_BITS))
                                              ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:46:20: note: expanded from macro 'VA_BITS'
#define VA_BITS                 (CONFIG_ARM64_VA_BITS)
                                 ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:294:9: error: returning 'void' from a function with incompatible result type 'phys_addr_t' (aka 'unsigned long long')
        return __virt_to_phys((unsigned long)(x));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:273:27: note: expanded from macro '__virt_to_phys'
#define __virt_to_phys(x)       __virt_to_phys_nodebug(x)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:262:35: note: expanded from macro '__virt_to_phys_nodebug'
#define __virt_to_phys_nodebug(x) ({                                    \
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:300:18: error: use of undeclared identifier 'CONFIG_ARM64_VA_BITS'
        return (void *)(__phys_to_virt(x));
                        ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:277:65: note: expanded from macro '__phys_to_virt'
#define __phys_to_virt(x)       ((unsigned long)((x) - PHYS_OFFSET) | PAGE_OFFSET)
                                                                      ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:48:36: note: expanded from macro 'PAGE_OFFSET'
#define PAGE_OFFSET             (_PAGE_OFFSET(VA_BITS))
                                              ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/memory.h:46:20: note: expanded from macro 'VA_BITS'
#define VA_BITS                 (CONFIG_ARM64_VA_BITS)
                                 ^
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/kernel/asm-offsets.c:10:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/arm_sdei.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/ghes.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/apei.h:9:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/acpi.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/irqdomain.h:35:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/of.h:17:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kobject.h:20:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/sysfs.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kernfs.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/idr.h:15:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/radix-tree.h:18:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/xarray.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/gfp.h:6:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mmzone.h:21:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types_task.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page.h:43:
/home/jojo/work/sdk/amlogic/code1/common/include/asm-generic/getorder.h:33:27: error: use of undeclared identifier 'CONFIG_ARM64_PAGE_SHIFT'
                        return BITS_PER_LONG - PAGE_SHIFT;
                                               ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page-def.h:15:21: note: expanded from macro 'PAGE_SHIFT'
#define PAGE_SHIFT              CONFIG_ARM64_PAGE_SHIFT
                                ^
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/kernel/asm-offsets.c:10:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/arm_sdei.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/ghes.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/apei.h:9:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/acpi.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/irqdomain.h:35:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/of.h:17:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kobject.h:20:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/sysfs.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kernfs.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/idr.h:15:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/radix-tree.h:18:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/xarray.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/gfp.h:6:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mmzone.h:21:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types_task.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page.h:43:
/home/jojo/work/sdk/amlogic/code1/common/include/asm-generic/getorder.h:35:22: error: use of undeclared identifier 'CONFIG_ARM64_PAGE_SHIFT'
                if (size < (1UL << PAGE_SHIFT))
                                   ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page-def.h:15:21: note: expanded from macro 'PAGE_SHIFT'
#define PAGE_SHIFT              CONFIG_ARM64_PAGE_SHIFT
                                ^
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/kernel/asm-offsets.c:10:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/arm_sdei.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/ghes.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/apei.h:9:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/acpi.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/irqdomain.h:35:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/of.h:17:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kobject.h:20:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/sysfs.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kernfs.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/idr.h:15:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/radix-tree.h:18:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/xarray.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/gfp.h:6:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mmzone.h:21:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types_task.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page.h:43:
/home/jojo/work/sdk/amlogic/code1/common/include/asm-generic/getorder.h:38:30: error: use of undeclared identifier 'CONFIG_ARM64_PAGE_SHIFT'
                return ilog2((size) - 1) - PAGE_SHIFT + 1;
                                           ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page-def.h:15:21: note: expanded from macro 'PAGE_SHIFT'
#define PAGE_SHIFT              CONFIG_ARM64_PAGE_SHIFT
                                ^
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/kernel/asm-offsets.c:10:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/arm_sdei.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/ghes.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/apei.h:9:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/acpi.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/irqdomain.h:35:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/of.h:17:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kobject.h:20:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/sysfs.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kernfs.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/idr.h:15:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/radix-tree.h:18:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/xarray.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/gfp.h:6:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mmzone.h:21:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types_task.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page.h:43:
/home/jojo/work/sdk/amlogic/code1/common/include/asm-generic/getorder.h:42:11: error: use of undeclared identifier 'CONFIG_ARM64_PAGE_SHIFT'
        size >>= PAGE_SHIFT;
                 ^
/home/jojo/work/sdk/amlogic/code1/common/arch/arm64/include/asm/page-def.h:15:21: note: expanded from macro 'PAGE_SHIFT'
#define PAGE_SHIFT              CONFIG_ARM64_PAGE_SHIFT
                                ^
In file included from /home/jojo/work/sdk/amlogic/code1/common/arch/arm64/kernel/asm-offsets.c:10:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/arm_sdei.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/ghes.h:5:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/acpi/apei.h:9:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/acpi.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/irqdomain.h:35:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/of.h:17:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kobject.h:20:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/sysfs.h:16:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/kernfs.h:13:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/idr.h:15:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/radix-tree.h:18:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/xarray.h:14:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/gfp.h:6:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mmzone.h:21:
In file included from /home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types.h:5:
/home/jojo/work/sdk/amlogic/code1/common/include/linux/mm_types_task.h:19:10: fatal error: 'asm/tlbbatch.h' file not found
#include <asm/tlbbatch.h>
         ^~~~~~~~~~~~~~~~
3 warnings and 12 errors generated.
make[2]: *** [/home/jojo/work/sdk/amlogic/code1/common/scripts/Makefile.build:99: arch/arm64/kernel/asm-offsets.s] Error 1
make[1]: *** [/home/jojo/work/sdk/amlogic/code1/common/Makefile:1248: prepare0] Error 2
make: *** [/home/jojo/work/sdk/amlogic/code1/common/Makefile:179: sub-make] Error 2
build kernel error



@jojok

Hello, do you have any modifications or additions in the common directory, can you git diff for us to check

No change

jojo@jojo:~/work/sdk/amlogic/code1/common$ git diff
jojo@jojo:~/work/sdk/amlogic/code1/common$ git status
On branch khadas-vim4-r-64bit
Your branch is up to date with ‘github/khadas-vim4-r-64bit’.

Untracked files:
(use “git add …” to include in what will be committed)
arch/arm64/configs/meson64_gki_module_config.tmp

nothing added to commit but untracked files present (use “git add” to track)
jojo@jojo:~/work/sdk/amlogic/code1/common$ git branch
khadas-edge2-android12
khadas-vim3-pie
khadas-vim4-r

  • khadas-vim4-r-64bit
    khadas-vims-5.4.y

@xiong.zhang

@jojok

Did you compile Android according to the following official website?

https://docs.khadas.com/products/sbc/vim4/development/android/build-android
cat demo.sh
#!/bin/bash

#build U-Boot
if [ “$1” == ‘u’ ] || [ “$1” == ‘n’ ]; then
echo “build U-Boot”
cd bootloader/uboot
./mk kvim4 --avb2 --vab
cd -
fi

#build Kernel
if [ “$1” == ‘k’ ] || [ “$1” == ‘n’ ]; then
if [ “$2” == ‘n’ ] || [ “$1” == ‘n’ ]; then
make distclean
fi
./mk kvim4 -v 5.4 -j4
fi

#build Android
if [ “$1” == ‘a’ ] || [ “$1” == ‘n’ ]; then
echo “build Android”
if [ “$2” == ‘n’ ] || [ “$1” == ‘n’ ]; then
make clean
fi
. build/envsetup.sh
lunch kvim4-userdebug
make installclean
make -j8
fi
Yes, there is no problem with uboot and Android compilation, only the kernel compilation fails

@jojok
You try to use only the following command to compile the kernel try

@xiong.zhang
Unfortunately, the same compilation failed. I have no idea.

@jojok

After you execute the repo status command in the root directory, upload the content to me for viewing, thank you

vim4$ repo status

The kernel part needed to compile android will be directly fetched from the device/khadas/kvim4-kernel/ directory. Therefore, whether the kernel compilation is successful or not will not affect Android compilation. In addition, if the kernel is successfully compiled, the compiled items will be replaced in the device/khadas/kvim4-kernel/ directory.

vim4_new$ find common/arch -iname "tlbbatch.h"                           
common/arch/x86/include/asm/tlbbatch.h

First check whether the directory corresponding to your code has this file. If yes, please check the compilation environment again.
https://docs.khadas.com/products/sbc/vim4/development/android/install-toolchains



@xiong.zhang

@jojok

You follow my command below to see what is different from mine

It seems that your compilation environment is messed up


@xiong.zhang


@goenjoy

According to the error log you provided above, it indicates that the work/sdk/amlogic/code1 directory has a compilation error. The work/sdk/amlogic/vim4 you sent has changed its name.

Yes, I just changed the directory name. I don’t think it will affect compilation
@xiong.zhang

Your repo library looks a bit strange. You put the repo in the upper directory because you want to synchronize different branches.

I only use khadas-vim4-r-64bit branch. Do you have any suggestions?
@xiong.zhang

Our ./repo directory is under the compiled vim4 directory, because the repo library is not like git, it pulls the code by synchronizing the xml commit, I am not sure if you will have code confusion when synchronizing like this

@jojok

Or you can follow our official documents to check whether the steps of the source code you downloaded are consistent. It is recommended to follow our official documents to operate

The reference document links are as follows

@xiong.zhang
Okay, I’ll try again.
I have a guess. Is it related to the root operating system?
Do you have compiled examples in Ubuntu 20.04?