2016-11-05 42 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

相關問題