public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Vegard Nossum <vegard.nossum@gmail.com>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jan Engelhardt <jengelh@computergmbh.de>
Subject: Re: [PATCH] Speed up "make headers_*"
Date: Sun, 8 Jun 2008 13:17:07 +0200	[thread overview]
Message-ID: <20080608111707.GB10545@uranus.ravnborg.org> (raw)
In-Reply-To: <1212922141.32207.495.camel@pmac.infradead.org>

On Sun, Jun 08, 2008 at 11:49:01AM +0100, David Woodhouse wrote:
> On Sun, 2008-06-08 at 12:41 +0200, Sam Ravnborg wrote:
> > headers_install.pl looks like this now.
> > I am not happy about the way I call unifdef - can it be
> > done better?
> 
> Possibly. unifdef only actually handles "#ifdef __KERNEL__" and
> "#ifndef __KERNEL__", doesn't it? It shouldn't be too hard to recreate
> at least that much functionality in perl, surely?

Correct. A quick grep shows that we have these different
uses of __KERNEL__:

#if defined(__ARM_EABI__) && !defined(__KERNEL__)
#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
#if defined(__KERNEL__)
#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
#if defined(__KERNEL__) && defined(CONFIG_PPC32)
#if defined(__KERNEL__) && defined(CONFIG_SMP) && !defined(__ASSEMBLY__)
#if !defined(__KERNEL__) || defined(CONFIG_X86)
#if defined(__KERNEL__) || defined(__DEFINE_BSD_TERMIOS)
#if !defined(__KERNEL__) && !defined(DIV_ROUND_UP)
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS) 
#if defined(__KERNEL__) || defined(__linux__)
# if (defined(__KERNEL__) || !defined(RELOC_DEBUG)) \
#if defined(__KERNEL__) || defined(__USE_ALL)
#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
#if defined(__KERNEL__) && defined(__x86_64__)
#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
#ifdef  __KERNEL__
#ifndef __KERNEL__

#else and #endif filtered away.

A script needs to take into account other preprocessor
uses too due to their nested nature.
But doable I'm sure.

And I rather have 100 lines perl than use the unifdef utility
because we then have it collected in one place and can do even
stricter validation.


> 
> Bonus points for making it handle more interesting constructs like
> "#if defined (KERNEL) || defined (FOO)", and for warning/erroring
> whenever any ifdefs on CONFIG_xxx would be visible in userspace.
> But those can come later; we don't have those yet anyway.

Agree.

	Sam

  reply	other threads:[~2008-06-08 11:16 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-08  9:47 [PATCH] Speed up "make headers_*" Sam Ravnborg
2008-06-08 10:12 ` Vegard Nossum
2008-06-08 10:41   ` Sam Ravnborg
2008-06-08 10:49     ` David Woodhouse
2008-06-08 11:17       ` Sam Ravnborg [this message]
2008-06-08 12:23         ` Oleg Verych
2008-06-08 13:17         ` David Woodhouse
2008-06-08 17:06           ` Segher Boessenkool
2008-06-08 17:34             ` Andreas Schwab
2008-06-08 19:45               ` Segher Boessenkool
2008-06-08 20:36           ` Geert Uytterhoeven
2008-06-08 11:01     ` WANG Cong
2008-06-08 11:18       ` Sam Ravnborg
2008-06-08 11:06     ` Vegard Nossum
2008-06-08 11:20       ` Sam Ravnborg
2008-06-08 11:20 ` David Woodhouse
2008-06-08 11:30   ` Sam Ravnborg
2008-06-08 11:47     ` David Woodhouse
2008-06-08 12:14       ` David Woodhouse
2008-06-08 12:29         ` David Woodhouse
2008-06-08 20:07 ` Sam Ravnborg
2008-06-08 20:58   ` David Woodhouse
2008-06-08 21:13     ` Sam Ravnborg
2008-06-09  6:23     ` Sam Ravnborg
2008-06-08 20:07 ` [PATCH 1/6] kbuild: refactor headers_* targets in Makefile Sam Ravnborg
2008-06-08 20:07 ` [PATCH 2/6] kbuild: always unifdef files in headers_install* Sam Ravnborg
2008-06-08 20:07 ` [PATCH 3/6] kbuild: drop support of ALTARCH for headers_* Sam Ravnborg
2008-06-08 20:07 ` [PATCH 4/6] kbuild: code refactoring in Makefile.headerinst Sam Ravnborg
2008-06-08 20:07 ` [PATCH 5/6] kbuild: error out early in make headers_install Sam Ravnborg
2008-06-09 10:19   ` David Woodhouse
2008-06-08 20:07 ` [PATCH 6/6] kbuild: optimize headers_* targets Sam Ravnborg
2008-06-08 20:37   ` Vegard Nossum
2008-06-08 21:15     ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2008-06-26  1:59 [PATCH] Speed up "make headers_*" Tim Schmielau
2008-06-26  7:11 ` Adrian Bunk

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=20080608111707.GB10545@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=dwmw2@infradead.org \
    --cc=jengelh@computergmbh.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vegard.nossum@gmail.com \
    /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