我正在使用 google ndk 工具链交叉编译我的 Samsung Note 3 SM-N900P 型号的图像。我下载了 Samsung 源代码的 Kitkat 版本,并相信我已按照内核自述文件中的说明进行操作。它说使用4.7工具链,我在NDK版本8d中找到了它。但我收到以下错误:
ERROR: modpost: Found 2 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
To build the kernel despite the mismatches, build with:
'make CONFIG_NO_ERROR_ON_MISMATCH=y'
(NOTE: This is not recommended)
/home/sansari/android/kernel/scripts/Makefile.modpost:98: recipe for target 'vmlinux.o' failed
make[1]: *** [vmlinux.o] Error 1
Makefile:935: recipe for target 'vmlinux.o' failed
make: *** [vmlinux.o] Error
在网上搜索后,我看到两个不同的帖子here https://stackoverflow.com/questions/6807766/linux-kernel-config-debug-section-mismatch-make-errorsand here https://stackoverflow.com/questions/8563978/what-is-kernel-section-mismatch。一个似乎暗示我无法解决这个问题,而另一个则恰恰相反。这是基于我对 make 文件的有限了解。我基本上已经阅读了用户指南的前三章。我知道什么是收据,以及它的基本结构是什么。我确实查看了 Makefile 的第 935 行,如下所示:
modpost-init := $(filter-out init/built-in.o, $(vmlinux-init))
vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE
$(call if_changed_rule,vmlinux-modpost)
我发布此内容是为了了解是否可以修复此错误,以及应该如何解决。任何人都可以就这个问题的复杂程度提供建议吗?这是我可以解决的问题吗?
这是打开 make debug 选项时的错误:
WARNING: vmlinux.o(.data+0x8434): Section mismatch in reference from the variable msm_mpm_debug_mask to the function .init.text:mpm_irq_domain_linear_size()
The variable msm_mpm_debug_mask references
the function __init mpm_irq_domain_linear_size()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: vmlinux.o(.data+0x844c): Section mismatch in reference from the variable msm_mpm_debug_mask to the function .init.text:mpm_irq_domain_legacy_size()
The variable msm_mpm_debug_mask references
the function __init mpm_irq_domain_legacy_size()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
To build the kernel despite the mismatches, build with:
'make CONFIG_NO_ERROR_ON_MISMATCH=y'
(NOTE: This is not recommended)
/home/sansari/android/kernel/scripts/Makefile.modpost:98: recipe for target 'vmlinux.o' failed
make[1]: *** [vmlinux.o] Error 1
Makefile:935: recipe for target 'vmlinux.o' failed
make: *** [vmlinux.o] Error 2