Scripts/basic/fixdep: Exec format error

Hi ,

We are trying to interface LCD display to 410c board so ,for which driver code has been written.When we tried doing make board facing following issues.

/bin/sh: 1: scripts/basic/fixdep: Exec format error
scripts/Makefile.build:299: recipe for target ‘/home/linaro/Downloads/exampl/lcd.o’ failed
make[2]: *** [/home/linaro/Downloads/exampl/lcd.o] Error 2
Makefile:1493: recipe for target ‘module/home/linaro/Downloads/exampl’ failed
make[1]: *** [module/home/linaro/Downloads/exampl] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.9.56-linaro-lt-qcom’
Makefile:6: recipe for target ‘all’ failed
make: *** [all] Error 2

$ file a.out
a.out: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=e92b44c961475163ae60c1af2589c8d6b00106e7, not stripped

the version of
$uname -r
4.9.56-linaro-lt-qcom
$uname -m
aarch64

Makefile

obj-m:=lcd.o
KDIR:=/lib/modules/$(shell uname -r)/build
PWD:=$(shell pwd)
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
@rm -f Module.symvers app

Can you apply file command on fixdep instead (in /usr/src/linux-headers-4.9…/scripts/basic/fixdep).

Yes it is x86-64, version

$file fixdep
fixdep: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=f84a747818133716eee8415ffdc5244f96ec7410, not stripped

This is an artefact of cross-compiling the kernel. Whilst it is possible for fix it, it can be fiddly and there isn’t any documentation.

An alternative approach is to follow the instruction to cross-compile the kernel found in the release notes (remembering to replace 18.01 with whichever release you are using):

http://releases.linaro.org/96boards/dragonboard410c/linaro/debian/18.01/

The resulting built kernel can be used to build out-of-tree modules if needed.