public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: David.Taylor@dell.com, "Martin Liška" <mliska@suse.cz>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: gcc: -ftest-coverage and -auxbase
Date: Tue, 18 Jun 2019 08:40:00 -0000	[thread overview]
Message-ID: <CAFiYyc16O0kXt1NL1JDi3W+B2mq7gxn77qKy_6ZJ2Gvfr=450A@mail.gmail.com> (raw)
In-Reply-To: <f6bb1eba70414ec19af35eae498c4ee2@x13pwdurdag1004.AMER.DELL.COM>

On Mon, Jun 17, 2019 at 5:02 PM <David.Taylor@dell.com> wrote:
>
> > From: Richard Biener <richard.guenther@gmail.com>
> > Sent: Monday, June 17, 2019 9:57 AM
> > To: taylor, david
> > Cc: GCC Development
> > Subject: Re: gcc: -ftest-coverage and -auxbase
>
> > On Mon, Jun 17, 2019 at 2:46 PM David Taylor <dtaylor@emc.com> wrote:
> > >
>
> > >     From: Richard Biener <richard dot guenther at gmail dot com>
> > >     Date: Thu, 13 Jun 2019 10:22:54 +0200
> > >
> > >     On Wed, Jun 12, 2019 at 10:17 PM <David.Taylor@dell.com> wrote:
> > >     >
> > >     > When doing a build, we use a pipe between GCC and GAS.
> > >     > And because we wish to do some analysis of the assembly code,
> > >     > we do not use -pipe but instead do '-S -c -'.  And this has worked
> > >     > fine for many years.
> > >
> > >     Can you please show us complete command-lines here?  -S -c -
> > >     will only assemble (and require source from standard input
> > >     and produce output in -.s).
> > >
> > > Actually, GCC recognzes '-c -' as meaning to write to stdout.  The *.c
> >
> > -o -
> >
> > you mean.  OK, so the issue is that with -o - auxbase is computed in a not so
>
> Right.  Sorry for the brain fart.
>
> > useful way from
> >
> > %{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase
> > %b}}}%{!c:%{!S:-auxbase %b}}
> >
> > which means we just pass '-auxbase-strip -', I guess in this case the !o choice
> > of using %b (substitute the basename of the input file) is a more sensible
> > choice.  That means having a new spec %<take-free-letter> expanding to %*
> > when it is not - and else expand to %b (which might be stdin, also not useful).
> > Note that the coverage utility might not be able to find the output file then.
>
> The build tree is laid out the same as the source tree...
>
> rel/a/tive/path.c is compiled into some-prefix/rel/a/tive/path.c
>
> But I was certainly hoping / expecting that setting auxbase would cause the proper information to be recorded in the assembly file so that everything would be found.
>
> I should have thought to check the spec strings.  Given that the common.opt file marks it as RejectDriver, it pretty much a given
> that when it needs to be set the driver is not going to check if it
> is already set...
>
> How about, instead of a new specs letter with a new meaning,
> instead just wrap {!auxbase ... } around the current setting?
>
> It seems that that combined with removing RejectDriver would
> solve the problem.
>
> > Using -pipe would also work so why not use that together with -Wa,... for the
> > assembler options you need?
>
> I'll have to see if the build can be twisted into doing that.
>
> Currently there are three scripts that optionally run between the compiler and the assembler.  When they run they collect information into a 'side file' for additional processing later.
>
> The .c to .o rule is already fairly complicated...  I am loathe to
> make it more complicated.

You could also supply alternate specs, -dumpspecs gets you the default contents
which you can put into a file, edit out the problematic part (just
always use %b)
and supply it via -specs ...

I don't think we want to expose -auxbase.  Iff then an alternate way to specify
a coverage output file name.

> > > file is given on the command line to GCC.  And the output of GAS is
> > > specified with -o.
> > >
> > > The compile & assemble part of the command line is approximately 2K
> > > bytes in length.  Mostly it's pretty boring.  It's roughly:
> > >
> > >     /full/path/to/version/controlled/gcc \
> > >     -MMD -MF bin/<product-name>/some/dir/path.o.d \
> > >     more than a dozen '-iquote <some-relative-directory>' combos \
> > >     some -D switches \
> > >     some -imacros switches \
> > >     -pipe \
> > >     more than a dozen -f switches \
> > >     -Wall -Werror and about two dozen additional -W switches \
> > >     some -m switches \
> > >     -gdwarf-4 -g3 \
> > >     -S -o - some/dir/path.c \
> > >     |
> > >     /full/path/to/version/controlled/as \
> > >     -warn-fatal-warnings -64
> > >     bin/<product-name>/some/dir/path.o_
> > >
> > > On success the *.o_ file will be renamed to *.o in the same directory.
>

  reply	other threads:[~2019-06-18  8:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 12:46 David Taylor
2019-06-17 13:56 ` Richard Biener
2019-06-17 15:02   ` David.Taylor
2019-06-18  8:40     ` Richard Biener [this message]
2019-06-18  8:56       ` Martin Liška
2019-06-18 13:31         ` David.Taylor
2019-06-18 15:19           ` Martin Liška
2019-06-18 21:51             ` David.Taylor
2019-06-19  7:19               ` Martin Liška
2019-06-19 17:11                 ` David.Taylor
2019-06-20  9:11                   ` Martin Liška
2019-06-20 13:00                     ` David.Taylor
2019-06-20 13:02                       ` Thomas Koenig
2019-06-20 13:11                         ` David.Taylor
2019-06-20 13:06                       ` Martin Liška
2019-06-20 13:31                         ` David.Taylor
2019-06-20 13:48                           ` Martin Liška
2019-06-20 16:06                             ` David.Taylor
2019-06-24 15:59                             ` David.Taylor
  -- strict thread matches above, loose matches on Subject: below --
2019-06-12 20:16 David.Taylor
2019-06-13  8:23 ` Richard Biener

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='CAFiYyc16O0kXt1NL1JDi3W+B2mq7gxn77qKy_6ZJ2Gvfr=450A@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=David.Taylor@dell.com \
    --cc=gcc@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /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).