2016-11-05 40 views
0

我试图编译的CyanogenMod 13.我收到错误C/C++ Cyanogenmod如何使用不同版本的工具链编译内核?

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) 

我读它here内核。我需要使用4.7编译我的内核。 如何在cyanogenmod构建过程中选择工具链的版本?

回答

0

感谢@nopasara和他的宝贵意见。

所以我没有做进一步的研究,发现内核与arm-eabi tool chain不兼容arm-linux-androideabi toolchain。因此,这里是我用

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 

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

当您的CyanogenMod做添加下面一行到你的BoardConfig.mk

TARGET_KERNEL_CROSS_COMPILE_PREFIX := arm-eabi- 

和使用命令

export TARGET_LEGACY_GCC_VERSION=4.7 

或编辑〜/ android /系统m/build/core/combo/TARGET_linux-arm.mk和设置版本

$(combo_2nd_arch_prefix)TARGET_LEGACY_GCC_VERSION := 4.7 
1

我相信你需要设置gcc版本4.7并使用CC变量将其设置为编译器。例如。 make target CC=/bin/gcc4.7

更多信息herehere

+0

im试图从这篇文章的方法,谢谢你的回复。我也会尝试一下。 http://forum.xda-developers.com/chef-central/android/guide-switching-to-custom-toolchain-t2927662 – DeepSidhu1313

+1

刚刚注意到,在你的文章中有一个手动描述工具链设置的链接:'export PATH = $ PATH: /toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/ 出口ARCH =手臂 出口子体系=手臂 出口CROSS_COMPILE = ARM-Linux的androideabi- 化妆hammerhead_defconfig 化妆-j2 '这里'PATH'环境变量由工具链路径添加。只要确保所需的工具链目录是第一个在PATH目录列表中。 – nopasara

相关问题