public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Damaged dependency files
@ 2010-11-29 17:21 Alex Peshkoff
  2010-11-29 21:06 ` Segher Boessenkool
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Peshkoff @ 2010-11-29 17:21 UTC (permalink / raw)
  To: gcc-help

 Hello, all!

When running "make" I get an error:
make[3]: *** No rule to make target
`/usr/home/firebird/firebird/trunk/src/yvalve/gds_proto.h)', needed by
`/usr/home/firebird/firebird/trunk/temp/Release/gpre/boot/gpre_meta_boot.o'. 
Stop.

Let me explain, why do I ask in this list. Error happens due to broken
structure of dependency files, created using -MMD switch of g++.
Normally that file has the following layout:

/usr/home/firebird/firebird/trunk/temp/Release/gpre/c_cxx.o: $(wildcard  \
 /usr/home/firebird/firebird/trunk/src/gpre/c_cxx.cpp \
  /usr/home/firebird/firebird/trunk/src/include/firebird.h \
  /usr/home/firebird/firebird/trunk/src/include/gen/autoconfig.h \
....................
  /usr/home/firebird/firebird/trunk/src/include/ProviderInterface.h \
  /usr/home/firebird/firebird/trunk/src/common/classes/Interface.h)

But for some files I get:

 \
 /usr/home/firebird/firebird/trunk/temp/Release/gpre/boot/gpre_meta_boot.o: 
\
 /usr/home/firebird/firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp \
  /usr/home/firebird/firebird/trunk/src/include/firebird.h \
........................
  /usr/home/firebird/firebird/trunk/src/yvalve/gds_proto.h)

I.e. extra line with single backslash in the beginning and missing
'$(wildcard' make's function after object file name.

My problem happens only for x86 builds with optimization, for x64 or
without optimization I've never seen it. I can reliably reproduce it for
the following versions:
gcc (Debian 4.3.2-1.1) 4.3.2
gcc (GCC) 4.3.3
gcc (GCC) 3.3.6
First one (where bug was noted initially) is Debian binary, two last
were built from clean sources, taken from official gcc repository (base
& g++ tar files were used). I've specially tried rather old gcc version
to check, does it help or not, but bug happens for all compilers.
What is specially surprising - for different gcc versions I get damaged
dependency files for different source files. On the other hand, for
particular compiler it happens always with particular source file and
does not depend upon 'make -j1' or 'make -j4' was used.

All this taken together makes me think, that this is gcc problem. But
may be I miss something obvious?

I can provide any additional information required, but do not want to
overload first letter with probably unneeded details. May be command
line options only:
g++ -ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -pipe -MMD -fPIC
-fmessage-length=0 -O3 -march=i586 -mcpu=i686 -fno-omit-frame-pointer
-I/usr/home/firebird/firebird/trunk/src/include/gen
-I/usr/home/firebird/firebird/trunk/src/include -pthread  -pthread -c
/usr/home/firebird/firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp -o
/usr/home/firebird/firebird/trunk/temp/Release/gpre/boot/gpre_meta_boot.o

And one thought - typically this happens for relatively long paths. May
be compiler tries to build better looking ddependency file but has some
old bug in this less tested branch of code?

Alex.


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

* Re: Damaged dependency files
  2010-11-29 17:21 Damaged dependency files Alex Peshkoff
@ 2010-11-29 21:06 ` Segher Boessenkool
  2010-11-30 12:53   ` Alex Peshkoff
  0 siblings, 1 reply; 3+ messages in thread
From: Segher Boessenkool @ 2010-11-29 21:06 UTC (permalink / raw)
  To: Alex Peshkoff; +Cc: gcc-help

> I.e. extra line with single backslash in the beginning and missing
> '$(wildcard' make's function after object file name.

This isn't caused by GCC, or not directly anyway.  Firebird's
make.rules has:

	$(OBJ)/%.o: $(SRC_ROOT)/%.c
	$(CC) $(WCFLAGS) -c $(firstword $<) -o $@
	@sed -i -e "1s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst
%.o,%.d,$@)

Something in that sed command does not work as expected; you should
look at the .d file before it is changed to see what's up (you can give
the -i flag an argument which it will use to make a backup of the original
file before it edits it; e.g.  -i.orig  will make a bla.d.orig).


Segher

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

* Re: Damaged dependency files
  2010-11-29 21:06 ` Segher Boessenkool
@ 2010-11-30 12:53   ` Alex Peshkoff
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Peshkoff @ 2010-11-30 12:53 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

 On 11/29/10 21:48, Segher Boessenkool wrote:
>> I.e. extra line with single backslash in the beginning and missing
>> '$(wildcard' make's function after object file name.
> This isn't caused by GCC, or not directly anyway.  Firebird's
> make.rules has:
>
> 	$(OBJ)/%.o: $(SRC_ROOT)/%.c
> 	$(CC) $(WCFLAGS) -c $(firstword $<) -o $@
> 	@sed -i -e "1s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst
> %.o,%.d,$@)
>
> Something in that sed command does not work as expected; you should
> look at the .d file before it is changed to see what's up (you can give
> the -i flag an argument which it will use to make a backup of the original
> file before it edits it; e.g.  -i.orig  will make a bla.d.orig).
>
Thank you, Segher!

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

end of thread, other threads:[~2010-11-30  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-29 17:21 Damaged dependency files Alex Peshkoff
2010-11-29 21:06 ` Segher Boessenkool
2010-11-30 12:53   ` Alex Peshkoff

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