如何修复android交叉编译期间的节不匹配错误

如何修复android交叉编译期间的节不匹配错误,android,makefile,samsung-mobile,Android,Makefile,Samsung Mobile,我正在使用google ndk工具链交叉编译我的三星Note 3 SM-N900P型号的图像。我下载了Kitkat版本的三星源代码,并且相信我已经按照内核自述文件中的说明进行了操作。它声明使用4.7工具链,我在NDK版本8d中找到了它。但我得到了以下错误: ERROR: modpost: Found 2 section mismatch(es). To see full details build your kernel with: 'make CONFIG_DEBUG_SECTION_MISM

我正在使用google ndk工具链交叉编译我的三星Note 3 SM-N900P型号的图像。我下载了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
在网上搜索之后,我看到了两个不同的帖子。其中一个似乎暗示我无法解决这个问题,而另一个则表示相反。这是基于我对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)
我发布这篇文章是为了了解我是否可以修复这个错误,以及我应该如何处理它。有人能就这个问题涉及的程度提供建议吗?这是我能解决的问题吗

以下是启用“生成调试”选项时的错误:

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

使用4.7,或者如果使用4.8,请尝试使用以下命令启动make:

make -j$NUMBEROFCPUS CONFIG_NO_ERROR_ON_MISMATCH=y 
例如,在Nexus5上,我使用

make -j$NUMBEROFCPUS CONFIG_NO_ERROR_ON_MISMATCH=y zImage-dtb

这不是一个好答案。甚至Makefile也会说“(注意:不建议这样做)。@JL2210:当然,注意建议修复代码。由于代码属于3d party项目(Linux内核,不是asker编写的),因此帮助修复它不是堆栈溢出的“责任”——错误应该报告给相应的bug跟踪器。代码修复后,“最佳”方法是切换到包含修复的新版本。但在修复代码之前,给出的答案是我们所能得到的最好答案。所谓
不是堆栈溢出的“责任”
我的意思是,要求某人修复Linux内核代码将是堆栈溢出的话题。(我们可以帮助修复代码,但在这种情况下,询问者需要提供有关代码本身的附加信息)。