mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Timothy Miller <miller@techsource.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Quick way to get preprocessor output???
Date: Tue, 15 Apr 2003 17:25:46 +0200	[thread overview]
Message-ID: <20030415152546.GC7721@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <3E9C226E.6090102@techsource.com>

On Tue, 15 April 2003 11:17:02 -0400, Timothy Miller wrote:
> 
> This is in regard to the kernel message compression I'm working on.

Something tells me that fun patches are going to show up.

> I'm starting work on the code parser for the kernel, and I find that a 
> lot of the printk format strings have macros in them.  Is there a quick 
> and easy way to get preprocessor (.i) output from all kernel source files?
> 
> I'm sure I won't understand enough to hack all Makefiles, but in case I 
> have to, what would be the best way of going about it?  I know about 
> using -E, but I don't want to take an excessive amount of time on this.

Try the patch below or something similar. This was done by memory,
without testing, for 2.5. The equivalent for 2.4 would be even
simpler.

Actually, this should not work yet, the real trick would be to
generate the .o files from .c *and* the .i, so the linker stage will
find correct .o files and keep running.

In case you want to do allyesconfig, you will several hours fixing
compile problems. The resulting .config after doing all that is on my
system, you can have it if you want it.

> Of course, to actually implement the text compression, all Makefiles 
> will have to change anyhow to pipe preprocessor output through a program 
> whose output is then run through the compiler.

Not all Makefiles, just one. :)

Jörn

-- 
And spam is a useful source of entropy for /dev/random too!
-- Jasmine Strong

--- linux-2.5.67/scripts/Makefile.build~pp_output	2003-04-07 19:32:25.000000000 +0200
+++ linux-2.5.67/scripts/Makefile.build	2003-04-15 17:12:32.000000000 +0200
@@ -157,7 +157,7 @@
 	$(call if_changed_dep,cc_i_c)
 
 quiet_cmd_cc_o_c = CC $(quiet_modtag)  $@
-cmd_cc_o_c       = $(CC) $(c_flags) -c -o $@ $<
+cmd_cc_o_c       = $(CC) $(c_flags) -C -E $< > $<.i
 
 # Built-in and composite module parts
 

      reply	other threads:[~2003-04-15 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-15 15:17 Timothy Miller
2003-04-15 15:25 ` Jörn Engel [this message]

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=20030415152546.GC7721@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miller@techsource.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

all inboxes | Powered by JetHome®