android - 如何解决这些不匹配问题?

标签 android compiler-errors compiler-warnings android-kernel

二手GCC:Linaro-GCC 4.7/4.8/4.9.3/6.4/7.3,但版本似乎没有意义

操作系统:更新了Linux Mint 19和4.17.2-ext73-57.2内核。

我试图编译一些源代码(例如LineageOS官方源代码),每次我都知道的时候:

WARNING: vmlinux.o(.data+0x10f40): Section mismatch in reference from the 
variable gdsc_driver to the (unknown reference) .init.data:(unknown)
The variable gdsc_driver references
the (unknown reference) __initdata (unknown)
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+0x1c064): Section mismatch in reference from the variable msm_cpu_pm_snoc_client_driver to the (unknown reference) .init.data:(unknown)
The variable msm_cpu_pm_snoc_client_driver references
the (unknown reference) __initdata (unknown)
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+0x1c0b4): Section mismatch in reference from the variable msm_cpu_pm_driver to the (unknown reference) .init.data:(unknown)
The variable msm_cpu_pm_driver references
the (unknown reference) __initdata (unknown)
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+0x1c104): Section mismatch in reference from the variable msm_cpu_status_driver to the (unknown reference) .init.data:(unknown)
The variable msm_cpu_status_driver references
the (unknown reference) __initdata (unknown)
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+0x1c4e0): Section mismatch in reference from the variable msm_rpm_device_driver to the (unknown reference) .init.data:(unknown)
The variable msm_rpm_device_driver references
the (unknown reference) __initdata (unknown)
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+0x1c648): Section mismatch in reference from the variable cpu_modes_driver to the (unknown reference) .init.data:(unknown)
The variable cpu_modes_driver references
the (unknown reference) __initdata (unknown)
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+0x1c698): Section mismatch in reference from the variable system_modes_driver to the (unknown reference) .init.data:(unknown)
The variable system_modes_driver references
the (unknown reference) __initdata (unknown)
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+0x1c6e8): Section mismatch in reference from the variable lpm_levels_driver to the (unknown reference) .init.data:(unknown)
The variable lpm_levels_driver references
the (unknown reference) __initdata (unknown)
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/laptopfalcon/android_kernel_motorola_msm8226-oreo-turbo/scripts/Makefile.modpost:98: recipe for target 'vmlinux.o' failed
make[1]: *** [vmlinux.o] Error 1
Makefile:961: recipe for target 'vmlinux.o' failed
make: *** [vmlinux.o] Error 2

我该怎么办?我试图搜索返回的变量,但没有找到任何提示。我无法正确编译任何源代码,所以我敢打赌我的PC出了点问题,但我不知道如何调试它。

最佳答案

我遇到了相同的 问题!您可以先尝试将“CONFIG_NO_ERROR_ON_MISMATCH = y”添加到您的“make”中,然后看看会发生什么,但这并不能解决我的问题。我必须通过将'CONFIG_DEBUG_SECTION_MISMATCH = y'放入'make'中来明确显示不匹配项。

然后,这些不匹配项将获得更令人满意的调试输出(错误日志),接下来,您将其中的一些复制并放到Google上,以希望有人越过相同的路径。
我发现这个补丁https://github.com/LIMYOONAOS/android_kernel_leeco_x2-msm8996/commit/736f808bfefde74fdc8f6294c44f5c77a8e1d741证明我的成功

祝好运!

关于android - 如何解决这些不匹配问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51584715/

相关文章:

android - Android 是否支持任何 API 来记录电话?

c++ - 错误 LNK1104 无法打开文件 'libboost_filesystem-vc141-mt-gd-1_65_1.lib'

c# - 在与 KnownType 属性一起使用的类上使用 Obsolete 属性时如何忽略编译器警告

c++builder - c++ Builder xe5 检测到错误(LME288)

c++ - 在 Visual Studio 2019 MSVC 中编译时出现编译错误 C2048,但在 clang++ 中可以正常工作吗?

lisp - sbcl:defmacro 中的马弗风格警告

java - 第二个 AsyncTask 没有执行

android - FirebaseRecyclerAdapter 无法将第一个布局识别为位置

java - 如何通过最新的 Android 支持库正确使用向后兼容的 Vector Drawable?

c++ - C++编译器错误,从单词中删除字母