linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Josh Huber <huber@mclx.com>
To: linuxppc-dev@lists.linuxppc.org
Subject: Re: Kernel build headers [was: Re: problems about __cli()]
Date: Mon, 24 Jul 2000 08:42:26 -0400	[thread overview]
Message-ID: <20000724084226.C263@mclx.com> (raw)
In-Reply-To: <200007240811.JAA05417@hyperion.valhalla.net>; from iain@sandoe.co.uk on Mon, Jul 24, 2000 at 09:11:08AM +0100

[-- Attachment #1: Type: text/plain, Size: 3293 bytes --]

On Mon, Jul 24, 2000 at 09:11:08AM +0100, Iain Sandoe wrote:
> On 2.2.17pre10 (having done a make mrproper, menuconfig, dep):
> 
> [root@athena stable-dma-int]# make vmlinux
> gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o
> scripts/split-include scripts/split-include.c
> In file included from /usr/include/errno.h:36,
>                  from scripts/split-include.c:26:
> /usr/include/bits/errno.h:25: linux/errno.h: No such file or directory

The reason this is failing is split-include isn't part of the kernel,
it's part of the build process and is a regular user-space binary,
which should be including the header files that your libc was built
against.

> So, if you are (habitually) building different kernels what *is* the right
> solution?  Point to the source for the delivered kernel? (this won't work if
> you make new headers in asm-ppc BTW) Point to the current source? Maintain
> several parallel installations? (not sure how practical that is)...

Ok, in the case of redhat systems which use the symlinks, they should
point to /usr/src/linux/include/{linux,asm,etc}, and /usr/src/linux
should point to /usr/src/kernel_that_shipped_with_distro

IMHO, you should never have to change this setup, unless perhaps you
rebuild libc against a newer kernel.

Please read this:
http://www.debian.org/Lists-Archives/debian-policy-9907/msg00182.html

This is a good explanation as to why pointing the symlinks to the
newest kernels can be bad sometimes by Linus.  He makes some good
points, and can discribe the situation better than me :)  Also, he
explains why building a new kernel against it's own (newer) header
files does NOT break binary compatibility, but building user space
programs against new header files, without a new libc will (sometimes)
break things.

> Also, as I am doing, if you have a user-land program that accesses a
> kernel-maintained structure via a syscall - the layout of the kernel
> structure is (properly) defined in a header in linux/include/asm - but you
> also need to get at it when compiling the user-land program.

In this case you should ship the corresponding header files that your
user space program uses with that user-space utility.  This makes sure
that it gets things right and doesn't depend on having a kernel tree
around that you know the location of.  For example, for a program I'm
working with, which uses an ioctl interface on a /dev entry (used to
use system calls, but switched), I've set up a directory tree like:
src    all the code
include
    linux  header files copied from the kernel tree (just the ones I
           need)
    other header files

This way, when autoconf places a -Ibuild_root/include with each
compile, it uses the local header files.

Before I did this, building was hell -- it's SO much better being able
to build the user-space code on any box without having to untar kernel
source.

Again, just my opinion, but I've found that this works very well.

I believe in general, unless the program you're writing needs to track
the kernel very closely, it's bad practice to include kernel headers
in user-space code.

-- 
Josh
6B21489A | GnuPG ID/Fingerprint | huber@mclx.com |
61F0 6138 BE7B FEBF A223  E9D1 BFE1 2065 6B21 489A

[-- Attachment #2: Type: application/pgp-signature, Size: 0 bytes --]

  parent reply	other threads:[~2000-07-24 12:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-24  8:11 Kernel build headers [was: Re: problems about __cli()] Iain Sandoe
2000-07-24  9:52 ` Michel Dänzer
2000-07-24 12:42 ` Josh Huber [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-07-24 20:58 Iain Sandoe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000724084226.C263@mclx.com \
    --to=huber@mclx.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).