如何在android交叉编译期间修复部分不匹配错误 [英] How to fix section mismatch errors during cross compile of android

查看:59
本文介绍了如何在android交叉编译期间修复部分不匹配错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 google ndk 工具链为我的 Samsung Note 3 SM-N900P 型号交叉编译图像.我下载了三星源代码的 Kitkat 版本,并且相信我已经按照内核自述文件中的说明进行操作.它声明使用 4.7 工具链,我在 NDK 8d 版中找到了它.但我收到以下错误:

I am using the google ndk toolchain to cross compile an image for my Samsung Note 3 SM-N900P model. I downloaded the Kitkat version of Samsung Source code, and believe I have followed the instructions in the Kernel Readme file. It stated to use 4.7 toolchain, and I found it in NDK version 8d. But I get the following error:

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 行,它是:

After doing some searching online, I see two different posts hereand here. One seems to imply that I can not fix the issue, while the other says somewhat the opposite. This is based on my limited knowledge of the make file. I have basically read the first three chapters of the user's guide. I know what recepies are, and what it's basic structure is. I did look at line 935 of my Makefile and Here it is:

modpost-init := $(filter-out init/built-in.o, $(vmlinux-init))
vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE
$(call if_changed_rule,vmlinux-modpost)

我发这个帖子是想看看我是否可以修复这个错误,以及我应该如何解决.任何人都可以就这个问题的复杂程度提供建议吗?有什么我可以解决的吗?

I am posting this to find out if I can fix this error, and how I should go about it. Can anyone provide advice on how involved this problem is? Is it something I can fix?

这是开启调试选项时的错误:

Here is the error when make debug option is turned on:

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:

Use 4.7, or if 4.8 try starting make with this:

make -j$NUMBEROFCPUS CONFIG_NO_ERROR_ON_MISMATCH=y 

例如在我构建的 Nexus 5 上

for example on Nexus 5 I build with

make -j$NUMBEROFCPUS CONFIG_NO_ERROR_ON_MISMATCH=y zImage-dtb

这篇关于如何在android交叉编译期间修复部分不匹配错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆