diff mbox

Define GENERATOR_FILE explicitly for the host gengtype objects

Message ID CABu31nPTuA7itR20xRVbmHbEGFWpnJxwh1GP3nTRHShgJq=02w@mail.gmail.com
State New
Headers show

Commit Message

Steven Bosscher July 7, 2012, 3:59 p.m. UTC
Hello,

Since r177358, a host executable gengtype is built so that plugins can
use the GTY markers.

Even for the host, gengtype is a GENERATOR_FILE, but since the build-%
rule doesn't apply to host objects, gengtype was being built without
it. So when I removed coretypes.h from double-int.h, my build failed.

Fixed by adding -DGENERATOR_FILE explicitly to the host gengtype*.o objects.

Bootstrapped on powerpc64-unknown-linux-gnu. OK for trunk?

Ciao!
Steven

	* Makefile.in (gengtype-lex.o, gengtype-parse.o, gengtype-state.o,
	gengtype.o): Add -DGENERATOR_FILE manually for host gengtype objects.

Comments

Richard Biener July 8, 2012, 8:35 a.m. UTC | #1
On Sat, Jul 7, 2012 at 5:59 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Hello,
>
> Since r177358, a host executable gengtype is built so that plugins can
> use the GTY markers.
>
> Even for the host, gengtype is a GENERATOR_FILE, but since the build-%
> rule doesn't apply to host objects, gengtype was being built without
> it. So when I removed coretypes.h from double-int.h, my build failed.
>
> Fixed by adding -DGENERATOR_FILE explicitly to the host gengtype*.o objects.
>
> Bootstrapped on powerpc64-unknown-linux-gnu. OK for trunk?

Ok!

I hope that with the C++ gengtype restructuring it will be no longer necessary
to build a host gengtype.

Richard.

> Ciao!
> Steven
>
>         * Makefile.in (gengtype-lex.o, gengtype-parse.o, gengtype-state.o,
>         gengtype.o): Add -DGENERATOR_FILE manually for host gengtype objects.
>
> Index: Makefile.in
> ===================================================================
> --- Makefile.in (revision 189348)
> +++ Makefile.in (working copy)
> @@ -3818,23 +3818,40 @@ build/genextract.o : genextract.c $(RTL_BASE_H) $(
>  build/genflags.o : genflags.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H)  \
>    $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
>  build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def
> +
> +# The gengtype generator program is special: Two versions are built.
> +# One is for the build machine, and one is for the host to allow
> +# plugins to define their types and generate the supporting GGC
> +# datastructures and routines with GTY markers.
> +# The host object files depend on CONFIG_H, and the build objects
> +# on BCONFIG_H.  For the build objects, add -DGENERATOR_FILE manually,
> +# the build-%: rule doesn't apply to them.
> +
>  gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
>  gengtype-lex.o: $(CONFIG_H)
> +CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
>  build/gengtype-lex.o: $(BCONFIG_H)
> +
>  gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
>    $(SYSTEM_H)
>  gengtype-parse.o: $(CONFIG_H)
> +CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
>  build/gengtype-parse.o: $(BCONFIG_H)
> +
>  gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
>    gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
>    $(XREGEX_H)
>  gengtype-state.o: $(CONFIG_H)
> +CFLAGS-gengtype-state.o += -DGENERATOR_FILE
>  build/gengtype-state.o: $(BCONFIG_H)
> +
>  gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h        \
>    rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
>    $(OBSTACK_H) $(XREGEX_H)
>  gengtype.o: $(CONFIG_H)
> +CFLAGS-gengtype.o += -DGENERATOR_FILE
>  build/gengtype.o: $(BCONFIG_H)
> +
>  build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h    \
>    errors.h $(READ_MD_H)
>  build/genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h                \
diff mbox

Patch

Index: Makefile.in
===================================================================
--- Makefile.in	(revision 189348)
+++ Makefile.in	(working copy)
@@ -3818,23 +3818,40 @@  build/genextract.o : genextract.c $(RTL_BASE_H) $(
 build/genflags.o : genflags.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H)	\
   $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
 build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def
+
+# The gengtype generator program is special: Two versions are built.
+# One is for the build machine, and one is for the host to allow
+# plugins to define their types and generate the supporting GGC
+# datastructures and routines with GTY markers.
+# The host object files depend on CONFIG_H, and the build objects
+# on BCONFIG_H.  For the build objects, add -DGENERATOR_FILE manually,
+# the build-%: rule doesn't apply to them.
+
 gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
 gengtype-lex.o: $(CONFIG_H)
+CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
 build/gengtype-lex.o: $(BCONFIG_H)
+
 gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
   $(SYSTEM_H)
 gengtype-parse.o: $(CONFIG_H)
+CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
 build/gengtype-parse.o: $(BCONFIG_H)
+
 gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
   gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
   $(XREGEX_H)
 gengtype-state.o: $(CONFIG_H)
+CFLAGS-gengtype-state.o += -DGENERATOR_FILE
 build/gengtype-state.o: $(BCONFIG_H)
+
 gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h 	\
   rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
   $(OBSTACK_H) $(XREGEX_H)
 gengtype.o: $(CONFIG_H)
+CFLAGS-gengtype.o += -DGENERATOR_FILE
 build/gengtype.o: $(BCONFIG_H)
+
 build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h	\
   errors.h $(READ_MD_H)
 build/genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h		\