1

I'm trying to port postmarketOS to the Samsung Galaxy S3 Neo. During the compilation of the linux kernel i got an 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)
make[1]: *** [/home/pmos/build/src/android_kernel_samsung_s3ve3g/scripts/Makefile.modpost:98: vmlinux.o] Error 1
make: *** [Makefile:938: vmlinux.o] Error 2

The error seems related to vmlinux.o. Is there a way to fix it?

EDIT: DEBUG info:

WARNING: vmlinux.o(.data+0x10094): 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+0x100ac): 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
andrea56
  • 397
  • 3
  • 21
  • 2
    Possible duplicate of [How to fix section mismatch errors during cross compile of android](https://stackoverflow.com/questions/27698976/how-to-fix-section-mismatch-errors-during-cross-compile-of-android) – Tsyvarev Sep 03 '19 at 10:25
  • 1
    @Tsyvarev The answer on that question isn't the greatest. Could you find a better duplicate? – S.S. Anne Sep 03 '19 at 11:06

1 Answers1

0

The solution was inside mpm.c and mpm-of.c.

I changed static int msm_mpm_debug_mask = 1 with static int msm_mpm_debug_mask __initdata = 1inside both file.

More info on the issue here

andrea56
  • 397
  • 3
  • 21
  • 2
    The `__init` matker is for functions. Use `__initdata` for writable variables, or `__initconst` for `const` variables. – Ian Abbott Sep 04 '19 at 17:09