cross compiling kernel module throwing error "/bin/sh: 1: scripts/mod/modpost: not found"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

cross compiling kernel module throwing error "/bin/sh: 1: scripts/mod/modpost: not found"

1,179 Views
vsuneja63
Contributor III

Hi,

Thanks!

I am cross compiling kernel module using my own generated toolchain of yocto kirkston source but it's throwing error that "/bin/sh: 1: scripts/mod/modpost: not found". I could see modpost.c & modpost.h files in toolchain but couldn't find shell script for the same. Find the same source & header file in linux-libc-headers(inside build directory) also but modpost script is missing. Attaching the detailed logs below, any suggestion on this will be really helpful.

make ARCH=arm64 -I/opt/poky/4.0.5/sysroots/cortexa72-poky-linux/usr/include/asm -C /opt/poky/4.0.5/sysroots/cortexa72-poky-linux/lib/modules/5.15.72-yocto-standard/build M=/home/agl/Automotive/ADAS_Infotainment/project/Application/Xen modules
make[1]: Entering directory '/opt/poky/4.0.5/sysroots/cortexa72-poky-linux/lib/modules/5.15.72-yocto-standard/build'
arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
  You are using:           aarch64-poky-linux-gcc (GCC) 11.3.0
  MODPOST /home/agl/Automotive/ADAS_Infotainment/project/Application/Xen/Module.symvers
/bin/sh: 1: scripts/mod/modpost: not found
make[2]: *** [scripts/Makefile.modpost:133: /home/agl/Automotive/ADAS_Infotainment/project/Application/Xen/Module.symvers] Error 127
make[1]: *** [Makefile:1813: modules] Error 2
make[1]: Leaving directory '/opt/poky/4.0.5/sysroots/cortexa72-poky-linux/lib/modules/5.15.72-yocto-standard/build'
make: *** [Makefile:5: all] Error 2

I have included kernel-modules, kernel-devsrc & kernel-dev in local.conf file.

0 Kudos
1 Reply

1,142 Views
Harvey021
NXP TechSupport
NXP TechSupport

Hi @vsuneja63 

Suggestions for you as below.

Check if some steps missed before running make.

Not sure how you build the cross tool. You can try to refer to Yocto user guide for how to populate cross tool and source toolchain to use it and then compare the CC in our toolchain env.

 

Best regards

Harvey

0 Kudos