Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Using custom kernel headers instead toolchain headers
@ 2012-03-19 18:55 lexa
  2012-03-19 22:19 ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: lexa @ 2012-03-19 18:55 UTC (permalink / raw)
  To: buildroot

Hello.

I use buildroot-2012.02 with external toolchain named "Sourcery
CodeBench ARM 2011.03". 

This toolchain contain linux headers, but i dont want to use them. I
want to use header compiled from my kernel, is it possible ?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Using custom kernel headers instead toolchain headers
  2012-03-19 18:55 [Buildroot] Using custom kernel headers instead toolchain headers lexa
@ 2012-03-19 22:19 ` Arnout Vandecappelle
  2012-03-21  9:26   ` lexa
  0 siblings, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2012-03-19 22:19 UTC (permalink / raw)
  To: buildroot

On Monday 19 March 2012 19:55:52 lexa wrote:
> I use buildroot-2012.02 with external toolchain named "Sourcery
> CodeBench ARM 2011.03". 
> 
> This toolchain contain linux headers, but i dont want to use them. I
> want to use header compiled from my kernel, is it possible ?

 Short answer: no.

 The kernel headers are used to compile the C library, which needs to
know which system calls exist, how various things are defined, and
sometimes which features exist.  So using different kernel headers
for compiling other libraries or programs is a bad idea, because it
may lead to inconsistencies.

 However, the kernel you compile doesn't need to be the same as the
toolchain's kernel headers.  It just has to be newer.  This is
possible because Linus makes sure that every Linux release is
ABI compatible with previous releases.


 There is one reason why you may want to use different kernel headers
than the ones of the toolchain, and that's when you have a vendor
kernel that defines additional ioctl's used by device drivers that
are not (yet) upstreamed.  In this case, you need access to your
vendor kernel's headers.  AFAIK buildroot doesn't really support this
use case.

 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120319/e1ea533a/attachment-0001.html>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Using custom kernel headers instead toolchain headers
  2012-03-19 22:19 ` Arnout Vandecappelle
@ 2012-03-21  9:26   ` lexa
  2012-03-21 18:15     ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: lexa @ 2012-03-21  9:26 UTC (permalink / raw)
  To: buildroot

On Mon, 2012-03-19 at 23:19 +0100, Arnout Vandecappelle wrote:
> On Monday 19 March 2012 19:55:52 lexa wrote:
> 
> > I use buildroot-2012.02 with external toolchain named "Sourcery
> 
> > CodeBench ARM 2011.03". 
> 
> > 
> 
> > This toolchain contain linux headers, but i dont want to use them. I
> 
> > want to use header compiled from my kernel, is it possible ?
> 
>  
> 
> Short answer: no.
> 
>  
> 
> The kernel headers are used to compile the C library, which needs to
> 
> know which system calls exist, how various things are defined, and
> 
> sometimes which features exist. So using different kernel headers
> 
> for compiling other libraries or programs is a bad idea, because it
> 
> may lead to inconsistencies.
> 
>  
> 
> However, the kernel you compile doesn't need to be the same as the
> 
> toolchain's kernel headers. It just has to be newer. This is
> 
> possible because Linus makes sure that every Linux release is
> 
> ABI compatible with previous releases.
> 
>  
> 
>  
> 
> There is one reason why you may want to use different kernel headers
> 
> than the ones of the toolchain, and that's when you have a vendor
> 
> kernel that defines additional ioctl's used by device drivers that
> 
> are not (yet) upstreamed. In this case, you need access to your
> 
> vendor kernel's headers. AFAIK buildroot doesn't really support this
> 
> use case.
> 
>  
> 
> Regards,
> 
> Arnout
> 
>  

Thank you for this detailed explanation.

I use heavy patched kernel and i need use custom kernel headers. If i
choose using
buildroot toolchain, can buildroot create kernel-headers from my custom
kernel source and use this headers for build buildroot toolchain and
other binaries?

> 
> -- 
> 
> Arnout Vandecappelle arnout at mind be
> 
> Senior Embedded Software Architect +32-16-286540
> 
> Essensium/Mind http://www.mind.be
> 
> G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
> 
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> 
> GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
> 
>  
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Using custom kernel headers instead toolchain headers
  2012-03-21  9:26   ` lexa
@ 2012-03-21 18:15     ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2012-03-21 18:15 UTC (permalink / raw)
  To: buildroot

Le Wed, 21 Mar 2012 13:26:07 +0400,
lexa <lexa@cfotr.com> a ?crit :

> I use heavy patched kernel and i need use custom kernel headers. If i
> choose using
> buildroot toolchain, can buildroot create kernel-headers from my custom
> kernel source and use this headers for build buildroot toolchain and
> other binaries?

Yes, you can put your modified kernel sources named linux-2.6.tar.bz2
in the dl/ folder, and select the BR2_KERNEL_HEADERS_SNAP. The internal
Buildroot toolchain build procedure will then use this kernel version
for the kernel headers of the toolchain.

Note that this isn't used a lot, so it might be possible that things
are broken, I haven't tested it right now.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-21 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 18:55 [Buildroot] Using custom kernel headers instead toolchain headers lexa
2012-03-19 22:19 ` Arnout Vandecappelle
2012-03-21  9:26   ` lexa
2012-03-21 18:15     ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox