1
votes

I am trying to build a kernel for Xperia SP.

First I have git-cloned the kernel source from here:

https://github.com/Tomoms/android_kernel_sony_msm8x60

then git-cloned this toolchain:

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

then I went to:

KERNEL_FOLDER/arch/arm/configs

and copied msm8960_defconfig (as i think Xperia SP has msm8960) to root of KERNEL_FOLDER and renamed it to .config

then I opened the terminal in the KERNEL_FOLDER directory and typed

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

1

1 Answers

0
votes

People used to get this error when building on 32bit systems. Ensure you are building on 64bit linux.