public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* temp preprocessed filename
@ 2010-02-27 11:31 Michael Morrell
  2010-02-28  4:10 ` Ian Lance Taylor
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Morrell @ 2010-02-27 11:31 UTC (permalink / raw)
  To: gcc-help

I'm tracking down some differences in the object files from ostensibly the same compilation flags of the same input.  I've got two .o files that should be the same, but when I run:

  readelf -wl <object file> | grep ii

to see the debug.line info, I see a difference.  The filename that is shown
is of the form <basename>.tmp,<hostname>.<number>.ii

and <number> is different.  I've looked through the source and can't find
where that filename is generated.  I want to know why <number> would change
and how to prevent it from doing so.

Can anyone point me in the right direction?

Thanks,

  Michael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: temp preprocessed filename
  2010-02-27 11:31 temp preprocessed filename Michael Morrell
@ 2010-02-28  4:10 ` Ian Lance Taylor
  2010-02-28 21:34   ` Michael Morrell
  0 siblings, 1 reply; 8+ messages in thread
From: Ian Lance Taylor @ 2010-02-28  4:10 UTC (permalink / raw)
  To: morrell; +Cc: gcc-help

Michael Morrell <morrell@alumni.ucsd.edu> writes:

> I'm tracking down some differences in the object files from ostensibly the same compilation flags of the same input.  I've got two .o files that should be the same, but when I run:
>
>   readelf -wl <object file> | grep ii
>
> to see the debug.line info, I see a difference.  The filename that is shown
> is of the form <basename>.tmp,<hostname>.<number>.ii
>
> and <number> is different.  I've looked through the source and can't find
> where that filename is generated.  I want to know why <number> would change
> and how to prevent it from doing so.
>
> Can anyone point me in the right direction?

I think you can get names of that sort when using distcc and/or
ccache.  Are you using either of those?  Check the exact path of the
compiler.

Ian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: temp preprocessed filename
  2010-02-28  4:10 ` Ian Lance Taylor
@ 2010-02-28 21:34   ` Michael Morrell
  2010-03-01 18:26     ` Ian Lance Taylor
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Morrell @ 2010-02-28 21:34 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

Thanks for the hint.  I am using ccache.  Perhaps that makes it a ccache issue and not appropriate for this list?

  Michael

--- On Sat, 2/27/10, Ian Lance Taylor <iant@google.com> wrote:

> From: Ian Lance Taylor <iant@google.com>
> Subject: Re: temp preprocessed filename
> To: morrell@alumni.ucsd.edu
> Cc: gcc-help@gcc.gnu.org
> Date: Saturday, February 27, 2010, 2:41 PM
> Michael Morrell <morrell@alumni.ucsd.edu>
> writes:
> 
> > I'm tracking down some differences in the object files
> from ostensibly the same compilation flags of the same
> input.  I've got two .o files that should be the same,
> but when I run:
> >
> >   readelf -wl <object file> |
> grep ii
> >
> > to see the debug.line info, I see a difference. 
> The filename that is shown
> > is of the form
> <basename>.tmp,<hostname>.<number>.ii
> >
> > and <number> is different.  I've looked
> through the source and can't find
> > where that filename is generated.  I want to know
> why <number> would change
> > and how to prevent it from doing so.
> >
> > Can anyone point me in the right direction?
> 
> I think you can get names of that sort when using distcc
> and/or
> ccache.  Are you using either of those?  Check
> the exact path of the
> compiler.
> 
> Ian
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: temp preprocessed filename
  2010-02-28 21:34   ` Michael Morrell
@ 2010-03-01 18:26     ` Ian Lance Taylor
  2010-03-02 21:13       ` Michael Morrell
  2010-03-02 22:05       ` Michael Morrell
  0 siblings, 2 replies; 8+ messages in thread
From: Ian Lance Taylor @ 2010-03-01 18:26 UTC (permalink / raw)
  To: morrell; +Cc: gcc-help

Michael Morrell <morrell@alumni.ucsd.edu> writes:

> Thanks for the hint.  I am using ccache.  Perhaps that makes it a
> ccache issue and not appropriate for this list?

Yes, I suspect that it is a ccache issue.  I don't know enough about
ccache to give any suggestions.

Ian

> --- On Sat, 2/27/10, Ian Lance Taylor <iant@google.com> wrote:
>
>> From: Ian Lance Taylor <iant@google.com>
>> Subject: Re: temp preprocessed filename
>> To: morrell@alumni.ucsd.edu
>> Cc: gcc-help@gcc.gnu.org
>> Date: Saturday, February 27, 2010, 2:41 PM
>> Michael Morrell <morrell@alumni.ucsd.edu>
>> writes:
>> 
>> > I'm tracking down some differences in the object files
>> >From ostensibly the same compilation flags of the same
>> input.  I've got two .o files that should be the same,
>> but when I run:
>> >
>> >   readelf -wl <object file> |
>> grep ii
>> >
>> > to see the debug.line info, I see a difference. 
>> The filename that is shown
>> > is of the form
>> <basename>.tmp,<hostname>.<number>.ii
>> >
>> > and <number> is different.  I've looked
>> through the source and can't find
>> > where that filename is generated.  I want to know
>> why <number> would change
>> > and how to prevent it from doing so.
>> >
>> > Can anyone point me in the right direction?
>> 
>> I think you can get names of that sort when using distcc
>> and/or
>> ccache.  Are you using either of those?  Check
>> the exact path of the
>> compiler.
>> 
>> Ian
>> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: temp preprocessed filename
  2010-03-01 18:26     ` Ian Lance Taylor
@ 2010-03-02 21:13       ` Michael Morrell
  2010-03-03  9:05         ` Cedric Roux
  2010-03-02 22:05       ` Michael Morrell
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Morrell @ 2010-03-02 21:13 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

Luckily(?), this isn't a ccache issue.  I was able to reproduce it with
g++.  We're using an ARM cross-compiler from CodeSourcery (Sourcery G++
4.3-234).

To reproduce what I'm seeing:

 % cat foo.cpp
 #include <cstdlib>

 void foo() {}
 % g++ -g -E foo.cpp > foo.ii
 % g++ -g -c foo.ii
 % readelf -wl foo.o | grep foo
   1	0	0	0	foo.cpp
   6	0	0	0	foo.ii

There is something in <cstdlib> that is triggering this behavior, but I
don't know if it is a cstdlib bug or a compiler bug.

I'll file a bug report with CodeSourcery, but was curious if anyone here
had any thoughts.  I will also try to dig into <cstdlib> and see if I
can isolate this further.

  Michael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: temp preprocessed filename
  2010-03-01 18:26     ` Ian Lance Taylor
  2010-03-02 21:13       ` Michael Morrell
@ 2010-03-02 22:05       ` Michael Morrell
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Morrell @ 2010-03-02 22:05 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

Here's a smaller testcase:

  typedef int ptrdiff_t;

  namespace std {
    using ::ptrdiff_t;
  }

  void foo() {}

when you run:

  g++ -g -E foo.cpp > foo.ii; g++ -g -c foo.ii

the foo.o produced contains a reference to foo.ii in .debug_line.

  Michael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: temp preprocessed filename
  2010-03-02 21:13       ` Michael Morrell
@ 2010-03-03  9:05         ` Cedric Roux
  2010-03-03  9:35           ` Cedric Roux
  0 siblings, 1 reply; 8+ messages in thread
From: Cedric Roux @ 2010-03-03  9:05 UTC (permalink / raw)
  To: morrell; +Cc: gcc-help

Michael Morrell wrote:
> Luckily(?), this isn't a ccache issue.  I was able to reproduce it with
> g++.  We're using an ARM cross-compiler from CodeSourcery (Sourcery G++
> 4.3-234).
> 
> To reproduce what I'm seeing:
> 
>  % cat foo.cpp
>  #include <cstdlib>
> 
>  void foo() {}
>  % g++ -g -E foo.cpp > foo.ii
>  % g++ -g -c foo.ii
>  % readelf -wl foo.o | grep foo
>    1	0	0	0	foo.cpp
>    6	0	0	0	foo.ii
> 
> There is something in <cstdlib> that is triggering this behavior, but I
> don't know if it is a cstdlib bug or a compiler bug.
> 
> I'll file a bug report with CodeSourcery, but was curious if anyone here
> had any thoughts.  I will also try to dig into <cstdlib> and see if I
> can isolate this further.
> 
>   Michael

doing:

% cat foo.cpp
using namespace bar;

does include foo.ii.

When you do readelf -wlLiaprmfFsoR foo.o
(let's be a bit barbarian)
in the .debug_info you see that std is seen
as being declared in foo.ii (DW_AT_decl_file   : 2)
(where 2 points to foo.ii) instead of foo.cpp.

Don't know if it's expected behavior but maybe
your problem is this one.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: temp preprocessed filename
  2010-03-03  9:05         ` Cedric Roux
@ 2010-03-03  9:35           ` Cedric Roux
  0 siblings, 0 replies; 8+ messages in thread
From: Cedric Roux @ 2010-03-03  9:35 UTC (permalink / raw)
  To: morrell; +Cc: gcc-help

> % cat foo.cpp
> using namespace bar;

by the way, if it may help, bypassing
the foo.ii steps and directly doing
a "g++ -g -c foo.cpp" declares this line
(or whatever) to be declared in "<built-in>"

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-03  9:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-27 11:31 temp preprocessed filename Michael Morrell
2010-02-28  4:10 ` Ian Lance Taylor
2010-02-28 21:34   ` Michael Morrell
2010-03-01 18:26     ` Ian Lance Taylor
2010-03-02 21:13       ` Michael Morrell
2010-03-03  9:05         ` Cedric Roux
2010-03-03  9:35           ` Cedric Roux
2010-03-02 22:05       ` Michael Morrell

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).