Thanks Jakub!

I do need those includes and sorry I broke your bootstrap it didn't show up on my aarch64-unknown-linux-gnu bootstrap, I'm guessing the rules there were just run in a different order. Glad you were able to fix it :)

On 06/06/2023 22:28, Jakub Jelinek wrote:
Hi!

internal-fn.h since yesterday includes insn-opinit.h, which is a generated
header.
One of my bootstraps today failed because some m2 sources started compiling
before insn-opinit.h has been generated.

Normally, gcc/Makefile.in has
# In order for parallel make to really start compiling the expensive
# objects from $(OBJS) as early as possible, build all their
# prerequisites strictly before all objects.
$(ALL_HOST_OBJS) : | $(generated_files)

rule which ensures that all the generated files are generated before
any $(ALL_HOST_OBJS) objects start, but use order-only dependency for
this because we don't want to rebuild most of the objects whenever one
generated header is regenerated.  After the initial build in an empty
directory we'll have .deps/ files contain the detailed dependencies.

$(ALL_HOST_OBJS) includes even some FE files, I think in the m2 case
would be m2_OBJS, but m2/Make-lang.in doesn't define those.

The following patch just adds a similar rule to m2/Make-lang.in.
Another option would be to set m2_OBJS variable in m2/Make-lang.in to
something, but not really sure to which exactly and why it isn't
done.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2023-06-06  Jakub Jelinek  <ja...@redhat.com>

        * Make-lang.in: Build $(generated_files) before building
        all $(GM2_C_OBJS).

--- gcc/m2/Make-lang.in.jj      2023-05-04 09:31:27.289948109 +0200
+++ gcc/m2/Make-lang.in 2023-06-06 21:38:26.655336041 +0200
@@ -511,6 +511,8 @@ GM2_LIBS_BOOT     = m2/gm2-compiler-boot
                      m2/gm2-libs-boot/libgm2.a \
                      $(GM2-BOOT-O)
+$(GM2_C_OBJS) : | $(generated_files)
+
  cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) $(m2.prev)
        cp -p $< $@

        Jakub

Reply via email to