public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nickc at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/32998] -frecord-gcc-switches issues
Date: Tue, 07 Aug 2007 08:25:00 -0000	[thread overview]
Message-ID: <20070807082537.9989.qmail@sourceware.org> (raw)
In-Reply-To: <bug-32998-87@http.gcc.gnu.org/bugzilla/>



------- Comment #5 from nickc at redhat dot com  2007-08-07 08:25 -------
Subject: Re:  -frecord-gcc-switches issues

Hi Ben,

> Is there an easy way to separate out the include and link (-I, -L) bits from
> the macro defines and compiler option flags? Could the just the include bits be
> put into one string?

Sure.  We could add some intelligence to the recording function which looks for 
these switches and groups them all together.  There are quite a lot of them 
though: -B, -I, -J, -L, -iquote, -isystem, -include, -imacros, -idirafter, 
-iwithprefixbefore, -imultilib, -isysroot.

> When doing this does it make sense to define the base_dir and then use it as a
> substitution instead of putting in absolute addresses everywhere? This might
> cut down on size.

Well that sounds like a good idea to me.  But Roland was objecting to recording 
absolute paths of any kind, so he might not like this.

>>  I think that in order to fix this the .GCC.command.line section creation 
>> code will have to be made more complex and have access to the entire command 
>> line options table.

> However.... can you expand on your comment above? What do you mean by "have
> access to the entire command line options table?" Would you dump the entire
> table? 

Oh no.  What I meant was that in order for the recording code to be more 
intelligent it would need access to gcc's command line options structure, so 
that, for example, it can tell when a switch takes an argument (and hence 
correctly deduce whether an entry in the argv[] array should be included in the 
same string as the previous entry or if it is a new command line switch in its 
own right).  Access to this table would also make it possible to do things
like:

   * group all the optimization switches together in one part of the 
.GCC.command.line section.

   * locate switches which negate the effect of previous switches and then skip 
recording those previous switches.

My concern however is that adding this sort of thing complicates the code, and 
hence is more likely to introduce bugs.  Still if it makes the feature useful, 
then it is worth considering.

Cheers
   Nick


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32998


  parent reply	other threads:[~2007-08-07  8:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-05 21:17 [Bug other/32998] New: " jakub at gcc dot gnu dot org
2007-08-06  8:12 ` [Bug other/32998] " nickc at redhat dot com
2007-08-06 16:17 ` bkoz at gcc dot gnu dot org
2007-08-06 19:19 ` roland at redhat dot com
2007-08-07  8:11 ` nickc at redhat dot com
2007-08-07  8:25 ` nickc at redhat dot com [this message]
2010-06-20 21:03 ` jsm28 at gcc dot gnu dot org
2010-06-20 21:05 ` jsm28 at gcc dot gnu dot org
2010-06-20 21:20 ` manu at gcc dot gnu dot org
     [not found] <bug-32998-4@http.gcc.gnu.org/bugzilla/>
2010-10-02 16:06 ` jan.kratochvil at redhat dot com
2010-10-05  0:42 ` roland at redhat dot com
2010-10-05  9:48 ` jakub at gcc dot gnu.org
2010-10-05 19:54 ` roland at redhat dot com
2011-04-22 18:49 ` jan.kratochvil at redhat dot com
2011-07-12 16:26 ` jakub at gcc dot gnu.org
2011-07-22 20:04 ` jakub at gcc dot gnu.org
2012-06-14  9:22 ` philomath868 at gmail dot com

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=20070807082537.9989.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).