From: Sam Ravnborg <sam@ravnborg.org>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
LKML <linux-kernel@vger.kernel.org>,
jdike@addtoit.com
Subject: Re: asm-offsets.h is generated in the source tree
Date: Mon, 12 Sep 2005 00:03:28 +0200 [thread overview]
Message-ID: <20050911220328.GE2177@mars.ravnborg.org> (raw)
In-Reply-To: <20050911212942.GK25261@ZenIV.linux.org.uk>
> OK... Once that goes in, I'm doing s/prepare1/archprepare/ in there.
> Note that kern-offsets.c expects to find user_constants.h and symlinks
> already in place - it assumes that all kernel headers are usable.
> kern_constants.h is used only by userland glue, task.h and thread.h and
> these, in turn, are used only by userland glue.
Sent to Linus, assume it will be merged soon.
>
> So ordering constraints are
> symlinks and user_constants.h are needed to get kernel headers usable
> kern_constants.h needs kernel headers
> kernel code needs kernel headers
> parts of userland glue need kern_constants.h
>
> FWIW, we could rename user-offsets.c to asm-offsets.c and let the regular
> mechanism take care of them (renaming user_constants.h at the same time,
> obviously). Critical part here is "kernel-offsets.c expects kernel headers
> usable", everything else could be trivially dealt with...
No. For once the flags to gcc differs for userland and kernelland.
Of the two candidates only kern_constants.h could be dealt with by
the generic support.
> Note that kern_constants.h must *NOT* go into include/asm-um - we need it
> in userland glue which doesn't get include/ in its search path.
And this killed the idea of using the generic support - not a big deal
anyway.
> So reducing
> the number of symlinks won't be trivial. We could, in principle, move
> kern_constants.h to e.g. include/asm-um/user/, include that in userland
> glue search path and try to fight the rest, but that won't be fun.
>
> One particulary nasty bit: we have both per-subarch headers in asm-um _and_
> headers in there that do something and proceed to include corresponding
> header from asm-<subarch>. Currently we do that with
> include/asm-um/arch ----> include/asm-<subarch>
This just shows how horribly broken the symlink scheme is in the first
place.
If the kernel had used a scheme like the following everything could be
solved by a few -I statements:
include/i386/asm/<what we have in include/asm-i386 today>
include/ia64/asm/<what we have in include/asm-ia64 today>
etc.
Then to use ia64 we would just use:
-Iinclude/ia64
And in um land we could do exactly the same with no ugly symlinks.
> include/asm-um/foo.h ---> include/asm-um/foo-<subarch>.h for
> the first kind and
> #include <asm/arch/foo.h> in foo.h for the second one.
>
> We also have arch/um/include/sysdep -> sysdep-<subarch>, but that's easier
> to deal with...
Here we should do like this:
arch/um/include/<subarch>/sysdep/<files from sysdep-<subarch>>
Again no ugly symlinks needed.
Another benefir that is often overlooked.
With kbuild checking the compileflags everything 'just works' when we
change sub-arch. No need to make clean etc.
I know this is a lot of renaming and I have not seen a really good
argument to convince Linus to rename include/asm-<arch>.
But for um I see no big dela doing the renaming, especially since most
of currect code should work out-of-the-box even with the changes
introduced.
Sam
next prev parent reply other threads:[~2005-09-11 22:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-10 15:20 asm-offsets.h is generated in the source tree Stephen Rothwell
2005-09-10 16:19 ` Sam Ravnborg
2005-09-11 2:32 ` Al Viro
2005-09-11 8:31 ` Sam Ravnborg
2005-09-11 15:45 ` Al Viro
2005-09-11 17:04 ` Sam Ravnborg
2005-09-11 21:29 ` Al Viro
2005-09-11 22:03 ` Sam Ravnborg [this message]
2005-09-11 23:16 ` Al Viro
2005-09-12 19:15 ` Sam Ravnborg
2005-09-13 6:30 ` Al Viro
2005-09-13 6:48 ` Kyle Moffett
2005-09-13 6:53 ` Keith Owens
2005-09-13 6:58 ` Kyle Moffett
2005-09-13 21:55 ` Al Viro
2005-09-15 1:07 ` Al Viro
2005-09-10 19:08 ` Sam Ravnborg
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=20050911220328.GE2177@mars.ravnborg.org \
--to=sam@ravnborg.org \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=viro@ZenIV.linux.org.uk \
/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