kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Konstantin Andreev <andreev@swemel.ru>
Cc: "Frank A. Cancio Bello" <frank@generalsoftwareinc.com>,
	kernelnewbies@kernelnewbies.org
Subject: Re: How to get the preprocessor output as part of the compilation process?
Date: Mon, 09 Dec 2019 22:17:35 -0500	[thread overview]
Message-ID: <24456.1575947855@turing-police> (raw)
In-Reply-To: <5DEE1D83.2040704@swemel.ru>


[-- Attachment #1.1: Type: text/plain, Size: 1203 bytes --]

On Mon, 09 Dec 2019 13:10:11 +0300, Konstantin Andreev said:
> The universal approach that always works in this and many similar cases is just
> to replace the instrumented binary by your interception shell script.

> E.g. rename gcc to gcc.hide (generally, moving into another location may not
> work) and setup 'gcc' script that does what you want: replaces `-c' with the
> `-E', replaces `-o' argument, etc ..., calls gcc.hide to preprocess source then
> calls gcc.hide with original non-modified command line.

> This is cumbersome process, you can break some things,

And in fact, what you may want to do is have your script invoke gcc
*twice*, once with -E, and then a second time with -c, because otherwise
the build will die the first time it tries to link together two or more non-existent
.o files.

Using 'make -k' *might* also work, but will leave the build log output littered
with a *lot* of error messages.

Or explain why you're doing this - there may be a simpler way to achieve
your goal. For instance, if you're trying to build a cross-reference of what
.c files include what .h directly or indirectly, there's already specialized tools
for doing that sort of thing, such as 'cxref'.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2019-12-10  3:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-08 19:05 How to get the preprocessor output as part of the compilation process? Frank A. Cancio Bello
2019-12-08 21:53 ` Valdis Klētnieks
2019-12-09 10:10 ` Konstantin Andreev
2019-12-10  3:17   ` Valdis Klētnieks [this message]
2019-12-10 13:35     ` Konstantin Andreev
2019-12-12  3:14 ` Aruna Hewapathirane

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=24456.1575947855@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=andreev@swemel.ru \
    --cc=frank@generalsoftwareinc.com \
    --cc=kernelnewbies@kernelnewbies.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).