This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: automatic dependencies for gcc


Hello Tom,

Which revision is your patch against?  I ran into a build failure but it
may be due to me getting the merge wrong.  Also, a nit below:

* Tom Tromey wrote on Fri, Mar 07, 2008 at 09:22:58PM CET:
> --- gcc/Makefile.in	Tue Mar 04 11:24:08 2008 -0700
> +++ gcc/Makefile.in	Fri Mar 07 08:20:21 2008 -0700
> @@ -267,6 +267,12 @@ mkinstalldirs=$(SHELL) $(srcdir)/../mkin
>  # --------
>  # UNSORTED
>  # --------
> +
> +# Dependency tracking stuff.
> +DEPMODE = @CCDEPMODE@
> +DEPDIR = @DEPDIR@
> +depcomp = $(SHELL) $(srcdir)/../depcomp
> +BUILD_DEPMODE = @CC_FOR_BUILDDEPMODE@
[...]

> @@ -904,8 +848,16 @@ INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(s
>  	   -I$(srcdir)/../include @INCINTL@ \
>  	   $(CPPINC) $(GMPINC) $(DECNUMINC)
>  
> -.c.o:
> -	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
> +COMPILE.base = $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS)
> +ifeq ($(DEPMODE),depmode=gcc3)
> +COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Po
> +else
> +COMPILE = source='$<' object='$@' libtool=no \
> +    DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(COMPILE.base)
> +endif
> +
> +%.o: %.c
> +	$(COMPILE) $<

This looks like $(OUTPUT_OPTION) aka '-o $@' is missing for non-gcc3
which means objects from subdirs end up in gcc/, wrongly.  I haven't
tested this though.  Related, I see OUTPUT_OPTION is set in
gcc/configure.ac, depending on the result of AM_PROG_CC_C_O.  This
code looks bitrotted, as while it does cause CC to be set to "compile
$CC", it also drops the '-o $@' which again causes the same bug.

Is GCC supposed to be compilable at all by a compiler not understanding
"-c -o" (of which there aren't very many out there any more)?

Cheers,
Ralf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]