4

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

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

1 Answer 1

2

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

make -j$NUMBEROFCPUS CONFIG_NO_ERROR_ON_MISMATCH=y 

for example on Nexus 5 I build with

make -j$NUMBEROFCPUS CONFIG_NO_ERROR_ON_MISMATCH=y zImage-dtb
3
  • Not a good answer. Even the Makefile says "(NOTE: This is not recommended)".
    – S.S. Anne
    Commented Sep 3, 2019 at 11:05
  • @JL2210: Of course, the note recommends to fix the code. Since the code belongs to 3d-party project (Linux kernel, which isn't written by the asker), it is not a Stack Overflow "responsibility" to help in fixing it - the error should be reported into the appropriate bug tracker. After the code will be fixed, the "best" approach is to switch into the new version, which contains the fix. But until the code has being fixed, given answer is the best we have.
    – Tsyvarev
    Commented Sep 3, 2019 at 12:04
  • By not a Stack Overflow "responsibility" I meant asking someone to fix the Linux kernel code would be off-topic on Stack Overflow. (We could help in fixing the code, but in that case the asker needs to provide additional information about the code itself).
    – Tsyvarev
    Commented Sep 3, 2019 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.