kernel headers question.

Dave Johnson dave-gnhlug at davej.org
Sun Aug 20 13:51:01 EDT 2006


Steven W. Orr writes:
> So having said all that, is it safe to say that for all versions of
> 2.4 and 2.6 series kernels, it's ok to have one old version of
> glibc-kernheaders? Or is there some reason that I am constrained to
> having seperate kernel headers for each project thereby necessitating
> that each version of gcc, binutils, and UClibc is dependant on the
> version of linux that it will run against?


When building gcc/binutils you generally do not need the specific
version of the kernel headers (or more specifically
--with-headers=<something> from gcc's configure line).

The only really linux specific part in gcc/binutils is the crt*.o
.  Even libgcc.a, libiberty.a, libstdc++.a aren't very kernel
specific, but do require something in the lines of header files to
build.

I generally use something along the lines of:

construct sys include from a 'close-enough kernel'
build binutils cross
build gcc cross stage 1 (only c support)
build glibc cross
build gcc cross stage 2 (c & c++)
blow away this glibc results
install stage 2 gcc, binutils, and sys includes system wide.

(if you want c++ support you unfortunately need to build a cross
libc inbetween stage 1 and 2.)


The specific kernel headers are more important when building your
*libc as any change in the syscall area has a big effect on libc.

Note that this part has settled down a long time ago and you can
usually get away with a close-enough kernel here too.  If you're not
changing syscalls or other kernel headers then you can build your
*libc once and forget it.

workareas consist of:

build kernel
build *libc  (rebuilding isn't needed that often)
build everything else

If you're not changing your libc or major changes in your kernel (that
would effect *libc) you can build the libc and install it system wide
along with gcc/bintuils.

Also note, you need to make sure binutils and gcc dont look in
/usr/include or /usr/lib by default, but instead uses your sys includes
you build with and the libgcc.a, libiberty.a and libstdc++.a that you
built.


-- 
Dave




More information about the gnhlug-discuss mailing list