0

I am trying to compile kernel for Cyanogenmod 13. I am getting 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)

I read it here. That i need to compile my kernel using 4.7. How can i choose the version of toolchain during cyanogenmod build ??

DeepSidhu1313
  • 805
  • 15
  • 31

2 Answers2

1

I believe you need to setup gcc version 4.7 and use CC variable to set it as a compiler. E.g. make target CC=/bin/gcc4.7

More information here and here.

Community
  • 1
  • 1
nopasara
  • 538
  • 3
  • 10
  • im trying method from this post, thanks for ur reply. i will try urs too. http://forum.xda-developers.com/chef-central/android/guide-switching-to-custom-toolchain-t2927662 – DeepSidhu1313 Nov 05 '16 at 05:14
  • 1
    just noticed that in your post there is a link to manual describing toolchain setup: `export PATH=$PATH:/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/ export ARCH=arm export SUBARCH=arm export CROSS_COMPILE=arm-linux-androideabi- make hammerhead_defconfig make -j2` Here `PATH` environment variable is added by toolchain path. Just make sure that needed toolchain directory is first in PATH directory list. – nopasara Nov 05 '16 at 05:33
0

Thanks to @nopasara and his valuable comment.

So i did little research further and discovered that the kernel is compatiable with arm-eabi tool chain not arm-linux-androideabi toolchain. So here is the command i used

export PATH=$PATH:~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-eabi-4.7/bin/ && export ARCH=arm && export SUBARCH=arm && export CROSS_COMPILE=arm-linux-eabi- && make msm8226_defconfig O=~/android/system/out/target/product/E6790/obj/KERNEL_OBJ

and

 make   O=~/android/system/out/target/product/E6790/obj/KERNEL_OBJ zImage -j4

To do with this Cyanogenmod add following line to your BoardConfig.mk

  TARGET_KERNEL_CROSS_COMPILE_PREFIX := arm-eabi-

and either use

 export TARGET_LEGACY_GCC_VERSION=4.7 

Or edit ~/android/system/build/core/combo/TARGET_linux-arm.mk and set version in

  $(combo_2nd_arch_prefix)TARGET_LEGACY_GCC_VERSION := 4.7
DeepSidhu1313
  • 805
  • 15
  • 31