PATCH: PR binutils/12283: bfd/doc doesn't support parallel build
Ralf Wildenhues
Ralf.Wildenhues@gmx.de
Fri Feb 4 06:34:00 GMT 2011
* Steve Ellcey wrote on Mon, Jan 31, 2011 at 07:33:01PM CET:
> On Sat, 2011-01-29 at 10:42 +0100, Ralf Wildenhues wrote:
> > * Steve Ellcey wrote on Sat, Jan 29, 2011 at 12:32:15AM CET:
> > > This patch is intended to be a secondary fix/workaround for the problem
> > > that can happen when building bfd/doc using a parallel make. Ralf
> > > Wildenhues has a fix to move-if-changed that should fix the problem for
> > > any target where compiling a file multiple times will always result in
> > > exactly the same binary, but I have at least one platform where this is
> > > not the case: hppa*-*-hpux*. So I would also like to have this fix as a
> > > backup to Ralf's patch (which I think should also go in).
> >
> > Note that with the changed move-if-change from gnulib, then instead of
> > your patch, you could just use
> > export CMPPROG=cmp --ignore-initial=16'
> > make -jN
> >
> > for a successful build.
> I tried that method but it did not work. When I use 'cmp
> --ignore-initial=16' on object files (.o's) it works fine, but when I
> use it to compare the chew binary I get a difference beyond the first 16
> bytes (at byte 111 or 112 depending on the binary).
Still, I don't like the idea of requiring a configure switch in order
for parallel builds to work; they should just work OOTB.
Maybe we can help things here by going through another indirection,
that should avoid multiple simultaneous compiles of chew.c.
Does the (little-tested) patch below work for you?
Are you using GNU make by the way, or HP-UX make? I can only warn
against using the latter:
http://thread.gmane.org/gmane.comp.sysutils.autoconf.patches/7535/focus=7548
Thanks,
Ralf
bfd/doc/ChangeLog:
2011-02-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR binutils/12283
* Makefile.am (stamp-chew): New target.
Use throughout as dependency for targets that need chew,
instead of depdending on chew.c or on chew directly.
* Makefile.in: Regenerate.
Index: bfd/doc/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/doc/Makefile.am,v
retrieving revision 1.28
diff -u -r1.28 Makefile.am
--- bfd/doc/Makefile.am 22 Aug 2009 19:02:56 -0000 1.28
+++ bfd/doc/Makefile.am 4 Feb 2011 06:27:26 -0000
@@ -64,6 +64,10 @@
$(H_CFLAGS) $(AM_CPPFLAGS) $(srcdir)/chew.c; \
$(SHELL) $(srcdir)/../../move-if-change chew.$$$$ $(MKDOC)
+stamp-chew: $(srcdir)/chew.c
+ $(MAKE) $(MKDOC)
+ echo stamp >$@
+
protos: libbfd.h libcoff.h bfd.h
# We can't replace these rules with an implicit rule, because
@@ -74,115 +78,93 @@
# program. If somebody tries to rebuild info, but none of the .texi files
# have changed, then nothing will be rebuilt.
-aoutx.texi: chew.c $(srcdir)/../aoutx.h $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+aoutx.texi: stamp-chew $(srcdir)/../aoutx.h $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp
$(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi
-archive.texi: chew.c $(srcdir)/../archive.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+archive.texi: stamp-chew $(srcdir)/../archive.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp
$(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi
-archures.texi: chew.c $(srcdir)/../archures.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+archures.texi: stamp-chew $(srcdir)/../archures.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
$(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi
# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
# bfd.texinfo on an 8.3 filesystem.
-bfdt.texi: chew.c $(srcdir)/../bfd.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+bfdt.texi: stamp-chew $(srcdir)/../bfd.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
$(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi
-cache.texi: chew.c $(srcdir)/../cache.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+cache.texi: stamp-chew $(srcdir)/../cache.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
$(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi
-coffcode.texi: chew.c $(srcdir)/../coffcode.h $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+coffcode.texi: stamp-chew $(srcdir)/../coffcode.h $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp
$(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi
-core.texi: chew.c $(srcdir)/../corefile.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+core.texi: stamp-chew $(srcdir)/../corefile.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp
$(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi
-elf.texi: chew.c $(srcdir)/../elf.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+elf.texi: stamp-chew $(srcdir)/../elf.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp
$(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi
-elfcode.texi: chew.c $(srcdir)/../elfcode.h $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+elfcode.texi: stamp-chew $(srcdir)/../elfcode.h $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp
$(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi
-mmo.texi: chew.c $(srcdir)/../mmo.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+mmo.texi: stamp-chew $(srcdir)/../mmo.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp
$(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi
-format.texi: chew.c $(srcdir)/../format.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+format.texi: stamp-chew $(srcdir)/../format.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
$(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi
-libbfd.texi: chew.c $(srcdir)/../libbfd.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+libbfd.texi: stamp-chew $(srcdir)/../libbfd.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
$(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi
-bfdio.texi: chew.c $(srcdir)/../bfdio.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+bfdio.texi: stamp-chew $(srcdir)/../bfdio.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp
$(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi
-bfdwin.texi: chew.c $(srcdir)/../bfdwin.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+bfdwin.texi: stamp-chew $(srcdir)/../bfdwin.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp
$(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi
-opncls.texi: chew.c $(srcdir)/../opncls.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+opncls.texi: stamp-chew $(srcdir)/../opncls.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp
$(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi
-reloc.texi: chew.c $(srcdir)/../reloc.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+reloc.texi: stamp-chew $(srcdir)/../reloc.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp
$(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi
-section.texi: chew.c $(srcdir)/../section.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+section.texi: stamp-chew $(srcdir)/../section.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp
$(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi
-syms.texi: chew.c $(srcdir)/../syms.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+syms.texi: stamp-chew $(srcdir)/../syms.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp
$(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi
-targets.texi: chew.c $(srcdir)/../targets.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+targets.texi: stamp-chew $(srcdir)/../targets.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp
$(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi
-init.texi: chew.c $(srcdir)/../init.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+init.texi: stamp-chew $(srcdir)/../init.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp
$(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi
-hash.texi: chew.c $(srcdir)/../hash.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+hash.texi: stamp-chew $(srcdir)/../hash.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp
$(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi
-linker.texi: chew.c $(srcdir)/../linker.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
+linker.texi: stamp-chew $(srcdir)/../linker.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp
$(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi
@@ -198,7 +180,7 @@
$(srcdir)/../elf.c \
$(srcdir)/header.sed \
$(srcdir)/proto.str \
- $(MKDOC)
+ stamp-chew
libbfd.h: $(LIBBFD_H_DEP)
echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
@@ -217,7 +199,7 @@
$(srcdir)/../coffcode.h \
$(srcdir)/header.sed \
$(srcdir)/proto.str \
- $(MKDOC)
+ stamp-chew
libcoff.h: $(LIBCOFF_H_DEP)
echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@
@@ -253,7 +235,7 @@
$(srcdir)/header.sed \
$(srcdir)/proto.str \
$(srcdir)/../version.h \
- $(MKDOC)
+ stamp-chew
bfd.h: $(BFD_H_DEP)
echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
More information about the Binutils
mailing list