错误:modpost:'mem_map; quot;不明确的!使用最小的配置,但是默认配置的错误消失了。为什么?
最近,我尝试为内核5.10.0-RC5构建Linux设备驱动程序,下面遇到了编译错误。
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
而且我意识到我已经为板上使用非常最小的配置构建了内核。因此,我切换到Defconfig并再次构建了内核,现在错误已经消失了。当我使用最小配置时,这些错误是如何出现的?我该如何找到要添加的配置来解决编译错误?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论