Hello,
I'm having trouble compiling a custom kernel module. I've fixed my makefile issues (I believe) to allow the makefile to start to compile the my module. However, the cross compilation fails with the error message "fatal error: stdio.h: No such file or directory".
I have compiled the file just as a standard C file and the program runs without difficulty. I'm trying to build it as a kernel module just to get myself more familiar with the environment.
From the error message that is in the shell, my guess is that it has something to do with my KERNELDIR. I've pasted the output of the shell below.
tim@mccubuntu1:~/LEDblink$ make make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/tim/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11 M=/home/tim/LEDblink modules make[1]: Entering directory `/home/tim/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11' CC [M] /home/tim/LEDblink/LEDblink.o /home/tim/LEDblink/LEDblink.c:1:19: fatal error: stdio.h: No such file or directory compilation terminated. make[2]: *** [/home/tim/LEDblink/LEDblink.o] Error 1 make[1]: *** [_module_/home/tim/LEDblink] Error 2 make[1]: Leaving directory `/home/tim/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11' make: *** [LEDblink.ko] Error 2
I have also tried replacing my CROSS_COMPILE variable with the absolute location of the compiler (/home/tim/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-) but gotten the same result.
This is confusing to me. I would have thought that including something like stdio.h would be fairly straightforward since its pretty much a standard in any C program.
Any thoughts on what I'm doing wrong are appreciated.
EDIT: I'm using an AM335x EVM starter kit