LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Missing kernel headers (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/missing-kernel-headers-914031/)

s.joseph 11-17-2011 07:34 AM

Missing kernel headers
 
Hi,
I am trying to cross compile the kernel 2.6.29 to a mips platform. I was able to do that without any problem. I now want to cross compile an application also. The application include a lot of kernel headers like aio.h which in turn calls others like kmalloc.h These kernel headers are not part of my toolchain. I tried "make ARCH=mips install_headerss" to get them but still they are not part of the exported headers. I tried cross compiling with both uClibc as well as glibc. Can any one suggest how to resolve this issue.

Thanks

smallpond 11-17-2011 12:31 PM

Applications should not usually be including kernel headers. kernel headers are only for the kernel and kernel modules. If you are missing aio.h it most likely means that you have your includes done wrong in the make. There is both a user-space aio.h (/usr/include/aio.h) and a kernel aio.h (/usr/src/kernels/${KERNEL}/include/config/aio.h) which are different.

When you looking for a fix to an error, you are a lot more likely to get a helpful response if you copy and paste the exact command that failed and the error message that was printed.

s.joseph 11-17-2011 11:48 PM

Error log / Command
 
2 Attachment(s)
Commands used to compile:

root@ubuntu10:/mnt/acelinux# source Variables.sh
root@ubuntu10:/mnt/acelinux# cd acelinux
root@ubuntu10:/mnt/acelinux/acelinux# make > output.log 2>&1

Contents of Variables.sh

export ACE_ROOT=/mnt/acelinux
export MIPS=/home/ubuntu/sibin/new_timesys/wds3/toolchain/bin
export ESW_SOURCECODE_ROOT=/mnt/acelinux
export ESW_DEBUG_SYMBOLS=-g

The error log is attached.

I exported the headers using "make headers_install ARCH=mips"

The following directories were exported.
asm asm-generic drm linux mtd rdma sound video

I assume the kernel headers should be in "linux/". I am attaching the list of file in linux/

smallpond 11-18-2011 11:58 AM

Command that failed is:

home/ubuntu/sibin/new_timesys/wds3/toolchain/bin/mipsisa32r2-timesys-linux-uclibc-g++ -W -Wall -Wpointer-arith -pipe -O3 -g -Wno-uninitialized -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -D_REENTRANT -DACE_HAS_AIO_CALLS -I/mnt/acelinux -DACE_HAS_EXCEPTIONS -DACE_BUILD_DLL -DACE_OS_BUILD_DLL -c -fPIC -o .shobj/Basic_Types.o Basic_Types.cpp

and the failed include is:
/mnt/acelinux/acelinux/OS.h:3377:33: error: linux/aio.h: No such file or directory

No idea what ACE is all about, but the directory has the same files as /usr/include/linux on a normal install. There is no aio.h in that directory, which makes me think that this must be something special related to ACE.

s.joseph 11-19-2011 04:09 AM

Hi,
The aio.h file is not part of ACE (http://www.cs.wustl.edu/~schmidt/ACE.html). aio.h is a kernel header which is normally at usr/include/aio.h on your PC. I am able to compile ACE on the PC without any problem. Problem occurs when I am cross compiling for MIPS. The toolchain does not contain the header file. I am not able to get it even after exporting using headers_install. So my question was how do I get those missing headers.

smallpond 11-19-2011 11:41 AM

Quote:

Originally Posted by s.joseph (Post 4528163)
Hi,
The aio.h file is not part of ACE (http://www.cs.wustl.edu/~schmidt/ACE.html). aio.h is a kernel header which is normally at usr/include/aio.h on your PC. I am able to compile ACE on the PC without any problem. Problem occurs when I am cross compiling for MIPS. The toolchain does not contain the header file. I am not able to get it even after exporting using headers_install. So my question was how do I get those missing headers.

The files in /usr/include are not kernel headers; they are headers for user-space programs. The files in /usr/include/linux are kernel headers which most user space programs should not be including. If you want the one in /usr/include, then there is something wrong with your make.


All times are GMT -5. The time now is 06:35 AM.