1

Used GCC: Linaro-GCC 4.7/4.8/4.9.3/6.4/7.3 but version seems to be meaningless

OS: updated Linux Mint 19 and 4.17.2-ext73-57.2 kernel.

I have tried to compile a few sources (e.g. official LineageOS source) and everytime I got that:

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

What should I do? I tried to search returned variables but I didn't find any tips. I couldn't compile properly ANY sources so I bet that something is wrong with my PC but I don't know how to debug that.

User9123
  • 11
  • 1

1 Answers1

0

I've had the same problem ! You can try first to add 'CONFIG_NO_ERROR_ON_MISMATCH=y' to your 'make' and see what happens, though, it didn't solve my issue. I had to make mismatches explicits by placing 'CONFIG_DEBUG_SECTION_MISMATCH=y' into 'make'.

Then those mismatches will get a more pleasant debug output (error log), next you copy some of it and put it on Google in the hopes someone crossed the same path. Mine turned out to be a success as I found this patch https://github.com/LIMYOONAOS/android_kernel_leeco_x2-msm8996/commit/736f808bfefde74fdc8f6294c44f5c77a8e1d741

Good Luck!

Marcelo Ruggeri
  • 1,939
  • 1
  • 17
  • 10