首页 > 解决方案 > 如何解决这些不匹配问题?

问题描述

使用的 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

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

标签: androidcompiler-errorscompiler-warningsandroid-kernel

解决方案


我有同样的 问题!您可以先尝试将“ 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

祝你好运!


推荐阅读