public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ccache and -MMD / *.d issue
@ 2002-06-09 16:04 Conrad Scott
  2002-06-11  1:09 ` Conrad Scott
  0 siblings, 1 reply; 4+ messages in thread
From: Conrad Scott @ 2002-06-09 16:04 UTC (permalink / raw)
  To: cygwin

This might be obvious to everyone else but it's taken me a couple of days to
realise what's been happening.

If you use the gcc -MMD flag to generate dependency information in *.d files
and combine this with ccache, you get caught out if you do a make clean
(i.e. delete all the *.o and *.d files) and then re-build.

What happens is that the *.o files are re-generated from the cache but the
*.d files are not. So: you re-compile, edit some header file and re-compile
again: nothing gets re-compiled, you've got no dependency information. At
that point you need to make clean *and* clear the cache (rm -rf ~/.ccache)
and *then* re-build. Again. From scratch. Sigh.

I've emailed the ccache bug list just to see if there's any easy way around
this but I thought I'd send this out here as a warning, particularly since
this is the dependency scheme used for the cygwin source itself --- exactly
where I got caught out. Presumably the "make clean" could only delete the
*.o files; the *.d files being removed by something like "make distclean"
but this isn't a complete solution.

It's a shame as otherwise ccache is a lovely tool.

Cheers,

// Conrad




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: ccache and -MMD / *.d issue
  2002-06-09 16:04 ccache and -MMD / *.d issue Conrad Scott
@ 2002-06-11  1:09 ` Conrad Scott
  2002-06-11  1:28   ` Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Conrad Scott @ 2002-06-11  1:09 UTC (permalink / raw)
  To: cygwin

I sent an email a couple of days ago about a (supposed) issue with ccache
and gcc's -MMD flag. Well, that email was nonsense, sorry about that.

What *is* an issue (if anyone's still listening to my witterings) is the
Makefile in the cygwin source directory. If you compile from the top level,
the -MMD flag gets lost, while if you compile in the cygwin directory
itself, it's fine. I'm unclear what's going on but I'll have a look and
report back.

Sigh. Sorry for the noise.

// Conrad




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: ccache and -MMD / *.d issue
  2002-06-11  1:09 ` Conrad Scott
@ 2002-06-11  1:28   ` Christopher Faylor
  2002-06-11  1:51     ` Conrad Scott
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Faylor @ 2002-06-11  1:28 UTC (permalink / raw)
  To: cygwin

On Tue, Jun 11, 2002 at 12:20:45AM +0100, Conrad Scott wrote:
>I sent an email a couple of days ago about a (supposed) issue with ccache
>and gcc's -MMD flag. Well, that email was nonsense, sorry about that.
>
>What *is* an issue (if anyone's still listening to my witterings) is the
>Makefile in the cygwin source directory. If you compile from the top level,
>the -MMD flag gets lost, while if you compile in the cygwin directory
>itself, it's fine.

I don't know what you mean by "top level" but if you compile from the
winsup directory, it doesn't happen that way here (obviously?).

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: ccache and -MMD / *.d issue
  2002-06-11  1:28   ` Christopher Faylor
@ 2002-06-11  1:51     ` Conrad Scott
  0 siblings, 0 replies; 4+ messages in thread
From: Conrad Scott @ 2002-06-11  1:51 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1962 bytes --]

"Christopher Faylor" <cgf@redhat.com> wrote:
> >What *is* an issue (if anyone's still listening to my witterings) is the
> >Makefile in the cygwin source directory. If you compile from the top
level,
> >the -MMD flag gets lost, while if you compile in the cygwin directory
> >itself, it's fine.
>
> I don't know what you mean by "top level" but if you compile from the
> winsup directory, it doesn't happen that way here (obviously?).

By top-level, I meant the `obj' directory, i.e. (ascii art time):

    .../src/
            newlib/
            winsup/
                cygwin/
                utils/
    .../obj/
            i686-pc-cygwin/
                newlib/
                winsup/
                    cygwin/
                    utils/

That is, if you compile in the .../obj/i686-pc-cygwin/winsup/cygwin
directory (or in the .../obj/i686-pc-cygwin/winsup directory, as you point
out), you get the .d files created; but if you compile from the obj
directory itself (i.e. to build newlib as well as cygwin), you don't get any
.d files (in the cygwin directory).

I assume (but I've assumed too much recently to be confident about anything
anymore) that this is because the top-level (.../obj) Makefile defines
CFLAGS (without including -MMD) and this interferes with the definition in
.../obj/i686-pc-cygwin/winsup/cygwin/Makefile. But I'm not awake enough
right now to figure out recursive makefile issues.

(The makefile in the bzip2 directory doesn't suffer this problem by the
way.)

Really strangely, the -fbuiltin from the CFLAGS gets picked up but not
the -MMD from the same CFLAGS+=... statement in .../cygwin/Makefile. I'm
totally confused is all I can say.

I've attached the result of running make in the .../obj directory with just
a single .o file removed in the .../obj/i686-pc-cygwin/winsup/cygwin
directory. The build command includes -fbuiltin but not -MMD. What gives?

I think it's time for bed is presumably what gives.

// Conrad


[-- Attachment #2: make.log.bz2 --]
[-- Type: application/octet-stream, Size: 3956 bytes --]

[-- Attachment #3: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

end of thread, other threads:[~2002-06-11  0:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-09 16:04 ccache and -MMD / *.d issue Conrad Scott
2002-06-11  1:09 ` Conrad Scott
2002-06-11  1:28   ` Christopher Faylor
2002-06-11  1:51     ` Conrad Scott

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