【问题标题】:C/C++ Cyanogenmod How to compile kernel using different version of toolchain?C/C++ Cyanogenmod 如何使用不同版本的工具链编译内核?
【发布时间】:2016-11-05 02:05:21
【问题描述】:

我正在尝试为 Cyanogenmod 13 编译内核。我收到错误

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 构建过程中如何选择工具链的版本??

【问题讨论】:

    标签: c++ c kernel cyanogenmod linux-toolchain


    【解决方案1】:

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

    更多信息herehere

    【讨论】:

    • 我正在尝试这篇文章的方法,感谢您的回复。我也会试试 urs。 forum.xda-developers.com/chef-central/android/…
    • 刚刚注意到,在您的帖子中,有一个手动描述工具链设置的链接:export PATH=$PATH:<NDK_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 这里PATH 环境变量是由工具链路径添加的。只需确保所需的工具链目录位于 PATH 目录列表的首位即可。
    【解决方案2】:

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

    所以我没有做进一步的研究,发现内核与arm-eabi tool chain 不兼容arm-linux-androideabi 工具链。所以这是我使用的命令

    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/system/build/core/combo/TARGET_linux-arm.mk 并设置版本

      $(combo_2nd_arch_prefix)TARGET_LEGACY_GCC_VERSION := 4.7
    

    【讨论】:

      猜你喜欢
      • 2010-09-24
      • 2016-05-08
      • 2013-12-09
      • 2021-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-07
      • 2014-05-29
      相关资源
      最近更新 更多