简体   繁体   English

编译Android内核时执行格式错误

[英]Exec format error when compiling android kernel

I am trying to build a kernel for Xperia SP. 我正在尝试为Xperia SP构建内核。

First I have git-cloned the kernel source from here: 首先,我从这里git-closures内核源代码:

https://github.com/Tomoms/android_kernel_sony_msm8x60 https://github.com/Tomoms/android_kernel_sony_msm8x60

then git-cloned this toolchain: 然后git克隆这个工具链:

https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7 https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7

then I went to: 然后我去了:

KERNEL_FOLDER/arch/arm/configs KERNEL_FOLDER /弓/ ARM / CONFIGS

and copied msm8960_defconfig (as i think Xperia SP has msm8960) to root of KERNEL_FOLDER and renamed it to .config 并将msm8960_defconfig(因为我认为Xperia SP具有msm8960)复制到KERNEL_FOLDER的根目录,并将其重命名为.config

then I opened the terminal in the KERNEL_FOLDER directory and typed 然后我在KERNEL_FOLDER目录中打开终端并输入

make ARCH=arm CROSS_COMPILE=~/toolchains/arm-eabi-4.7/bin/arm-eabi-

and got this 并得到了

CHK     include/linux/version.h
    CHK     include/generated/utsrelease.h
      HOSTCC  scripts/basic/fixdep
    make[1]: `include/generated/mach-types.h' is up to date.
      CC      kernel/bounds.s
    /home/pc/toolchains/arm-eabi-4.7/bin/arm-eabi-gcc -Wp,-MD,kernel/.bounds.s.d -nostdinc -isystem /home/pc/toolchains/arm-eabi-4.7/bin/arm-eabi-gcc -print-file-name=include [Errno 8] Exec format error -I/home/pc/android/kernel/android_kernel_sony_msm8x60/arch/arm/include -Iarch/arm/include/generated -Iinclude -include /home/pc/android/kernel/android_kernel_sony_msm8x60/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -Os -fstack-protector -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fomit-frame-pointer -g -mtune=cortex-a7 -mfpu=neon-vfpv4 -fgraphite -floop-parallelize-all -ftree-loop-linear -floop-interchange -floop-strip-mine -floop-block -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(bounds) -DKBUILD_MODNAME=KBUILD_STR(bounds) -fverbose-asm -S -o kernel/bounds.s kernel/bounds.c [Errno 8] Exec format error
    make[1]: *** [kernel/bounds.s] Error 8
    make: *** [prepare0] Error 2

People used to get this error when building on 32bit systems. 人们过去在32位系统上构建该错误。 Ensure you are building on 64bit linux. 确保您在64位linux上构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM