编译Android内核时出错'vmlinux'

时间:2017-06-26 14:14:10

标签: android linux linux-kernel

我想尝试Android设备的RAM提取(Nexus 5X with Android 6.0.1)。要创建正确的Lime和Volatility内核模块,我必须创建System.map文件。我必须编译自己的内核才能实现。 到目前为止我的步骤:

  • 下载Nexus 5X的存储库:

    git clone https://android.googlesource.com/kernel/msm/
    
  • 下载适当的工具链进行交叉编译:

    git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 
    
  • 重新检查版本:

    export PATH=/root/compile/msm/aarch64-linux-android-4.9/bin:$PATH
    aarch64-linux-android-gcc -v
    $: gcc version 4.9.x 20150123 (prerelease) (GCC) 
    
  • 检查正确的内核版本(在我的情况下为710c22a)

    cd msm
    git checkout 710c22a
    
  • 为内核构建准备环境变量

    export ARCH=arm64
    export SUBARCH=arm64
    export CROSS_COMPILE=aarch64-linux-android-
    make bullhead_defconfig
    make -j4
    

到目前为止,一切正常。 make过程完成了它的工作,直到出现这个错误:

aarch64-linux-android-ld: cannot find libgcc.a: No such file or directory
aarch64-linux-android-ld: cannot find libgcc.a: No such file or directory
Makefile:806: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
root@kali:~/:#

Makefile中806行的块是:

# Include targets which we want to
# execute if the rest of the kernel build went well.
vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
ifdef CONFIG_HEADERS_CHECK
    $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
endif
ifdef CONFIG_SAMPLES
    $(Q)$(MAKE) $(build)=samples
endif
ifdef CONFIG_BUILD_DOCSRC
    $(Q)$(MAKE) $(build)=Documentation
endif
    +$(call if_changed,link-vmlinux) # This is line 806 where error occurs

有人知道如何解决这个问题吗?或者我可以在哪里得到这个问题的帮助? 整个Makefile(1500行)在这里:

https://pastebin.com/ZHDWXjDB

0 个答案:

没有答案