'ERROR: modpost: "mem_map" undefined! with minimal config, but error is gone with default config. Why?
Recently I tried to build a linux device driver for kernel 5.10.0-rc5, I met with compile error below.
ckim@ckim-ubuntu:~/Proj/QEMU/qemu_test/test_ldd_5100$ make
make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -C linux-5.10.0-rc5 M=/home/ckim/Proj/QEMU/qemu_test/test_ldd_5100 modules
make[1]: Entering directory '/home/ckim/Proj/QEMU/qemu_test/test_ldd_5100/linux-5.10.0-rc5'
MODPOST /home/ckim/Proj/QEMU/qemu_test/test_ldd_5100/Module.symvers
ERROR: modpost: "mem_map" [/home/ckim/Proj/QEMU/qemu_test/test_ldd_5100/axpu_ldd_kc.ko] undefined!
ERROR: modpost: "kmem_cache_alloc_trace" [/home/ckim/Proj/QEMU/qemu_test/test_ldd_5100/axpu_ldd_kc.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:111: /home/ckim/Proj/QEMU/qemu_test/test_ldd_5100/Module.symvers] Error 1
make[2]: *** Deleting file '/home/ckim/Proj/QEMU/qemu_test/test_ldd_5100/Module.symvers'
make[1]: *** [Makefile:1703: modules] Error 2
make[1]: Leaving directory '/home/ckim/Proj/QEMU/qemu_test/test_ldd_5100/linux-5.10.0-rc5'
make: *** [Makefile:19: all] Error 2
and I realized I've built the kernel previously using very minimal config for my board. So I switched to defconfig and built the kernel again and now the error is gone. When I used a minimal config, how are those kinds of errors coming? and How can I find what CONFIGs should I add to solve the compile error?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
