public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [Bug binutils/30022] concurrent builds can fail
@ 2023-01-19 17:55 Vincent Smeets
  2023-01-19 17:55 ` [PATCH 1/7] bfd: build with mktemp Vincent Smeets
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Vincent Smeets @ 2023-01-19 17:55 UTC (permalink / raw)
  To: gdb-patches

I mentiond in Bug 30022 a fix for concurrent build. Here are the patches
for the different Makefiles. Please check and consider implementing
them.

Regards,
Vincent


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

* [PATCH 1/7] bfd: build with mktemp
  2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
@ 2023-01-19 17:55 ` Vincent Smeets
  2023-01-19 17:55 ` [PATCH 2/7] binutils: " Vincent Smeets
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Vincent Smeets @ 2023-01-19 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Vincent Smeets

---
 bfd/Makefile.am | 39 ++++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index c0a48dcf..b71be3f7 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -742,14 +742,16 @@ SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
 BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
 
 po/SRC-POTFILES.in: @MAINT@ Makefile
+	tmp=`mktemp --tmpdir=. SRC-POTFILES.XXXXXX.in`; \
 	for file in $(SRC_POTFILES); do echo $$file; done \
-	  | LC_ALL=C sort > tmp.src \
-	  && mv tmp.src $(srcdir)/po/SRC-POTFILES.in
+	  | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/SRC-POTFILES.in
 
 po/BLD-POTFILES.in: @MAINT@ Makefile
+	tmp=`mktemp --tmpdir=. BLD-POTFILES.XXXXXX.in`; \
 	for file in $(BLD_POTFILES); do echo $$file; done \
-	  | LC_ALL=C sort > tmp.bld \
-	  && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in
+	  | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/BLD-POTFILES.in
 
 all diststuff: info
 
@@ -796,9 +798,10 @@ libbfd_a_SOURCES =
 stamp-lib: libbfd.la
 	libtooldir=`$(LIBTOOL) --config | $(SED) -n -e 's/^objdir=//p'`; \
 	if [ -f $$libtooldir/libbfd.a ]; then \
-	  cp $$libtooldir/libbfd.a libbfd.tmp; \
-	  $(RANLIB) libbfd.tmp; \
-	  $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
+	  tmp=`mktemp --tmpdir=. libbfd.XXXXXX.a`; \
+	  cp $$libtooldir/libbfd.a $$tmp; \
+	  $(RANLIB) $$tmp; \
+	  $(SHELL) $(srcdir)/../move-if-change $$tmp libbfd.a; \
 	else true; fi
 	touch stamp-lib
 
@@ -921,10 +924,9 @@ gen-aout: $(srcdir)/gen-aout.c Makefile
 $(BFD_H): stmp-bfd-h ; @true
 
 stmp-bfd-h: bfd-in3.h
-	rm -f bfd-tmp.h
-	cp bfd-in3.h bfd-tmp.h
-	$(SHELL) $(srcdir)/../move-if-change bfd-tmp.h $(BFD_H)
-	rm -f bfd-tmp.h
+	tmp=`mktemp --tmpdir=. bfd.XXXXXX.h`; \
+	cp bfd-in3.h $$tmp; \
+	$(SHELL) $(srcdir)/../move-if-change $$tmp $(BFD_H)
 	touch stmp-bfd-h
 
 BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c \
@@ -962,20 +964,23 @@ REGEN_HEADER = \
 
 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
 stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES) $(MKDOC)
-	$(AM_V_GEN)H_FILES="$(BFD_H_FILES)" CHEW_FLAGS= ; $(REGEN_HEADER) > bfd-in2.h-new
-	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
+	$(AM_V_GEN) tmp=`mktemp --tmpdir=. bfd-in2.XXXXXX.h`; \
+	H_FILES="$(BFD_H_FILES)" CHEW_FLAGS= ; $(REGEN_HEADER) > $$tmp; \
+	$(SHELL) $(srcdir)/../move-if-change $$tmp $(srcdir)/bfd-in2.h
 	$(AM_V_at)touch stmp-bin2-h
 
 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
 stmp-lbfd-h: $(LIBBFD_H_FILES) $(MKDOC)
-	$(AM_V_GEN)H_FILES="$(LIBBFD_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libbfd.h-new
-	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
+	$(AM_V_GEN) tmp=`mktemp --tmpdir=. libbfd.XXXXXX.h`; \
+	H_FILES="$(LIBBFD_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > $$tmp; \
+	$(SHELL) $(srcdir)/../move-if-change $$tmp $(srcdir)/libbfd.h
 	$(AM_V_at)touch stmp-lbfd-h
 
 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
 stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC)
-	$(AM_V_GEN)H_FILES="$(LIBCOFF_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libcoff.h-new
-	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+	$(AM_V_GEN) tmp=`mktemp --tmpdir=. lobcoff.XXXXXX.h`; \
+	H_FILES="$(LIBCOFF_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > $$tmp; \
+	$(SHELL) $(srcdir)/../move-if-change $$tmp $(srcdir)/libcoff.h
 	$(AM_V_at)touch stmp-lcoff-h
 
 MOSTLYCLEANFILES += ofiles stamp-ofiles
-- 
2.39.0


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

* [PATCH 2/7] binutils: build with mktemp
  2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
  2023-01-19 17:55 ` [PATCH 1/7] bfd: build with mktemp Vincent Smeets
@ 2023-01-19 17:55 ` Vincent Smeets
  2023-01-19 17:55 ` [PATCH 3/7] gas: " Vincent Smeets
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Vincent Smeets @ 2023-01-19 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Vincent Smeets

---
 binutils/Makefile.am | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/binutils/Makefile.am b/binutils/Makefile.am
index 4ea343b1..b1ce8d4b 100644
--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -182,8 +182,9 @@ LIBIBERTY = ../libiberty/libiberty.a
 
 POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES)
 po/POTFILES.in: @MAINT@ Makefile
-	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
-	  && mv tmp $(srcdir)/po/POTFILES.in
+	tmp=`mktemp --tmpdir=. POTFILES.XXXXXX.in`; \
+	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/POTFILES.in
 
 EXPECT = expect
 RUNTEST = runtest
-- 
2.39.0


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

* [PATCH 3/7] gas: build with mktemp
  2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
  2023-01-19 17:55 ` [PATCH 1/7] bfd: build with mktemp Vincent Smeets
  2023-01-19 17:55 ` [PATCH 2/7] binutils: " Vincent Smeets
@ 2023-01-19 17:55 ` Vincent Smeets
  2023-01-19 17:55 ` [PATCH 4/7] gold: " Vincent Smeets
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Vincent Smeets @ 2023-01-19 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Vincent Smeets

---
 gas/Makefile.am | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gas/Makefile.am b/gas/Makefile.am
index ba289658..32c69ca0 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -368,8 +368,9 @@ POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) \
 	$(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
 	$(TARGET_EXTRA_FILES) $(HFILES) $(CFILES)
 po/POTFILES.in: @MAINT@ Makefile
-	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
-	  && mv tmp $(srcdir)/po/POTFILES.in
+	tmp=`mktemp --tmpdir=. POTFILES.XXXXXX.in`; \
+	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/POTFILES.in
 
 # Note: GASP is now deprecated and has been removed.  It is still
 # available in the CVS archive or older binutils releases if it is needed.
-- 
2.39.0


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

* [PATCH 4/7] gold: build with mktemp
  2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
                   ` (2 preceding siblings ...)
  2023-01-19 17:55 ` [PATCH 3/7] gas: " Vincent Smeets
@ 2023-01-19 17:55 ` Vincent Smeets
  2023-01-19 17:55 ` [PATCH 5/7] gprof: " Vincent Smeets
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Vincent Smeets @ 2023-01-19 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Vincent Smeets

---
 gold/Makefile.am | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gold/Makefile.am b/gold/Makefile.am
index 0999c5fc..ea0c1ede 100644
--- a/gold/Makefile.am
+++ b/gold/Makefile.am
@@ -247,8 +247,9 @@ install-exec-local: ld-new$(EXEEXT)
 POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES)
 
 po/POTFILES.in: @MAINT@ Makefile
-	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
-	  && mv tmp $(srcdir)/po/POTFILES.in
+	tmp=`mktemp --tmpdir=. POTFILES.XXXXXX.in`; \
+	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/POTFILES.in
 
 # Bootstrap test support.  We use ld-new to build ld1, then use ld1 to
 # build ld2.  ld1 and ld2 should be identical.  ld-new need not be
-- 
2.39.0


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

* [PATCH 5/7] gprof: build with mktemp
  2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
                   ` (3 preceding siblings ...)
  2023-01-19 17:55 ` [PATCH 4/7] gold: " Vincent Smeets
@ 2023-01-19 17:55 ` Vincent Smeets
  2023-01-19 17:55 ` [PATCH 6/7] ld: " Vincent Smeets
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Vincent Smeets @ 2023-01-19 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Vincent Smeets

---
 gprof/Makefile.am | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gprof/Makefile.am b/gprof/Makefile.am
index 790f8af5..11451d7e 100644
--- a/gprof/Makefile.am
+++ b/gprof/Makefile.am
@@ -71,8 +71,9 @@ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
 
 POTFILES = $(sources) $(noinst_HEADERS)
 po/POTFILES.in: @MAINT@ Makefile
-	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
-	  && mv tmp $(srcdir)/po/POTFILES.in
+	tmp=`mktemp --tmpdir=. POTFILES.XXXXXX.in`; \
+	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/POTFILES.in
 
 MANCONF  = -Dman
 
-- 
2.39.0


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

* [PATCH 6/7] ld: build with mktemp
  2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
                   ` (4 preceding siblings ...)
  2023-01-19 17:55 ` [PATCH 5/7] gprof: " Vincent Smeets
@ 2023-01-19 17:55 ` Vincent Smeets
  2023-01-19 17:55 ` [PATCH 7/7] opcodes: " Vincent Smeets
  2023-01-19 20:32 ` [Bug binutils/30022] concurrent builds can fail Tom Tromey
  7 siblings, 0 replies; 9+ messages in thread
From: Vincent Smeets @ 2023-01-19 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Vincent Smeets

---
 ld/Makefile.am | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/ld/Makefile.am b/ld/Makefile.am
index e74a7aba..8c71a653 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -543,12 +543,14 @@ SRC_POTFILES = $(CFILES) $(HFILES)
 BLD_POTFILES = $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES)
 
 po/SRC-POTFILES.in: @MAINT@ Makefile
-	for f in $(SRC_POTFILES); do echo $$f; done | LC_ALL=C sort > $@-tmp \
-	  && mv $@-tmp $(srcdir)/po/SRC-POTFILES.in
+	tmp=`mktemp --tmpdir=. SRC-POTFILES.XXXXXX.in`; \
+	for f in $(SRC_POTFILES); do echo $$f; done | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/SRC-POTFILES.in
 
 po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
-	for f in $(BLD_POTFILES); do echo $$f; done | LC_ALL=C sort > $@-tmp \
-	  && mv $@-tmp $(srcdir)/po/BLD-POTFILES.in
+	tmp=`mktemp --tmpdir=. BLD-POTFILES.XXXXXX.in`; \
+	for f in $(BLD_POTFILES); do echo $$f; done | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/BLD-POTFILES.in
 
 ldmain.@OBJEXT@: ldmain.c config.status
 if am__fastdepCC
@@ -600,6 +602,7 @@ endif
 endif
 
 ldemul-list.h: Makefile
+	tmp=`mktemp --tmpdir=. ldemul-list.XXXXXX.h`; \
 	(echo "/* This file is automatically generated.  DO NOT EDIT! */";\
 	for f in `echo " " ${EMULATION_OFILES} "" \
 	 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
@@ -611,8 +614,8 @@ ldemul-list.h: Makefile
 	 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
 	    echo "  &ld_$${f}_emulation, \\"; \
 	done;\
-	echo "  0") >ldemul-tmp.h
-	mv ldemul-tmp.h ldemul-list.h
+	echo "  0") >$$tmp; \
+	mv $$tmp ldemul-list.h
 
 stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
 	  $(AM_V_GEN)cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
-- 
2.39.0


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

* [PATCH 7/7] opcodes: build with mktemp
  2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
                   ` (5 preceding siblings ...)
  2023-01-19 17:55 ` [PATCH 6/7] ld: " Vincent Smeets
@ 2023-01-19 17:55 ` Vincent Smeets
  2023-01-19 20:32 ` [Bug binutils/30022] concurrent builds can fail Tom Tromey
  7 siblings, 0 replies; 9+ messages in thread
From: Vincent Smeets @ 2023-01-19 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Vincent Smeets

---
 opcodes/Makefile.am | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index 7aa4e53f..628e4ccd 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -333,9 +333,10 @@ libopcodes_a_SOURCES =
 stamp-lib: libopcodes.la
 	libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \
 	if [ -f $$libtooldir/libopcodes.a ]; then \
-	  cp $$libtooldir/libopcodes.a libopcodes.tmp; \
-	  $(RANLIB) libopcodes.tmp; \
-	  $(SHELL) $(srcdir)/../move-if-change libopcodes.tmp libopcodes.a; \
+	  tmp=`mktemp --tmpdir=. libopcodes.XXXXXX.a`; \
+	  cp $$libtooldir/libopcodes.a $$tmp; \
+	  $(RANLIB) $$tmp; \
+	  $(SHELL) $(srcdir)/../move-if-change $$tmp libopcodes.a; \
 	else true; fi
 	touch stamp-lib
 
@@ -343,8 +344,9 @@ libopcodes.a: stamp-lib ; @true
 
 POTFILES = $(HFILES) $(CFILES)
 po/POTFILES.in: @MAINT@ Makefile
-	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
-	  && mv tmp $(srcdir)/po/POTFILES.in
+	tmp=`mktemp --tmpdir=. POTFILES.XXXXXX.in`; \
+	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/POTFILES.in
 
 CLEANFILES = \
 	stamp-epiphany stamp-fr30 stamp-frv stamp-ip2k stamp-iq2000 stamp-lm32 \
-- 
2.39.0


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

* Re: [Bug binutils/30022] concurrent builds can fail
  2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
                   ` (6 preceding siblings ...)
  2023-01-19 17:55 ` [PATCH 7/7] opcodes: " Vincent Smeets
@ 2023-01-19 20:32 ` Tom Tromey
  7 siblings, 0 replies; 9+ messages in thread
From: Tom Tromey @ 2023-01-19 20:32 UTC (permalink / raw)
  To: Vincent Smeets via Gdb-patches; +Cc: Vincent Smeets

>>>>> "Vincent" == Vincent Smeets via Gdb-patches <gdb-patches@sourceware.org> writes:

Vincent> I mentiond in Bug 30022 a fix for concurrent build. Here are the patches
Vincent> for the different Makefiles. Please check and consider implementing
Vincent> them.

These patches should all go to the binutils list.

You may want to explain why they are needed, because it isn't really
clear to me.  Like, how can one of these rules be run more than once in
parallel?

Tom

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

end of thread, other threads:[~2023-01-19 20:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
2023-01-19 17:55 ` [PATCH 1/7] bfd: build with mktemp Vincent Smeets
2023-01-19 17:55 ` [PATCH 2/7] binutils: " Vincent Smeets
2023-01-19 17:55 ` [PATCH 3/7] gas: " Vincent Smeets
2023-01-19 17:55 ` [PATCH 4/7] gold: " Vincent Smeets
2023-01-19 17:55 ` [PATCH 5/7] gprof: " Vincent Smeets
2023-01-19 17:55 ` [PATCH 6/7] ld: " Vincent Smeets
2023-01-19 17:55 ` [PATCH 7/7] opcodes: " Vincent Smeets
2023-01-19 20:32 ` [Bug binutils/30022] concurrent builds can fail Tom Tromey

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