Skip to content

Build error on Raspberry Pi 4 #1

@xuancong84

Description

@xuancong84

This is a very useful tool because it is not easy to rebuild the kernel without kernel config parameters. All you need to do is to apt install Linux kernel header then build this module.

However, on Raspberry Pi 4, the build process fails with the following error:

root@raspberrypi:~/kexec-mod/kernel# make KDIR=/usr/src/linux-headers-5.10.63-v8+/
make -C /usr/src/linux-headers-5.10.63-v8+/ M=/root/kexec-mod/kernel modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.63-v8+'
  CC [M]  /root/kexec-mod/kernel/arch/arm64/idmap.o
/root/kexec-mod/kernel/arch/arm64/idmap.c: In function ‘kexec_pa_symbol’:
/root/kexec-mod/kernel/arch/arm64/idmap.c:118:19: error: passing argument 1 of ‘pud_offset’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  pud = pud_offset(pgd , va);
                   ^~~
In file included from ./arch/arm64/include/asm/pgtable-types.h:50,
                 from ./arch/arm64/include/asm/page.h:16,
                 from ./arch/arm64/include/asm/proc-fns.h:14,
                 from ./arch/arm64/include/asm/pgtable.h:9,
                 from /root/kexec-mod/kernel/arch/arm64/idmap.c:15:
./include/asm-generic/pgtable-nopud.h:42:40: note: expected ‘p4d_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘pgd_t *’ {aka ‘struct <anonymous> *’}
 static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
                                 ~~~~~~~^~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:280: /root/kexec-mod/kernel/arch/arm64/idmap.o] Error 1
make[2]: *** [scripts/Makefile.build:497: /root/kexec-mod/kernel/arch/arm64] Error 2
make[1]: *** [Makefile:1825: /root/kexec-mod/kernel] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.63-v8+'
make: *** [Makefile:15: module] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions