public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Implement a workaround for GNU mak jobserver
@ 2020-10-27 11:02 H.J. Lu
  2020-10-27 15:01 ` Martin Liška
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: H.J. Lu @ 2020-10-27 11:02 UTC (permalink / raw)
  To: binutils

Compiling binutils using -flto=jobserver with GCC 11 leads to

libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2 -fprofile-generate -flto=jobserver -o as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o config/obj-elf.o config/atof-ieee.o  ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a -L/tmp/binutils-gdb/objdir/zlib -lz ../libiberty/libiberty.a -ldl
lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not present in 'MAKEFLAGS'

since the '+' is missing on the recipe line in Makefiles generated by
automake.  Add the '+' to the recipe line by hand.

bfd/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

binutils/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

config/

	PR binutils/26792
	* jobserver.m4: New file.

gas/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

gprof/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

ld/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

libctf/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

opcodes/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.
---
 bfd/aclocal.m4        |  1 +
 bfd/configure         | 18 ++++++++++++++++++
 bfd/configure.ac      |  2 ++
 binutils/aclocal.m4   |  1 +
 binutils/configure    | 18 ++++++++++++++++++
 binutils/configure.ac |  2 ++
 config/jobserver.m4   | 24 ++++++++++++++++++++++++
 gas/aclocal.m4        |  1 +
 gas/configure         | 18 ++++++++++++++++++
 gas/configure.ac      |  2 ++
 gprof/aclocal.m4      |  1 +
 gprof/configure       | 18 ++++++++++++++++++
 gprof/configure.ac    |  2 ++
 ld/aclocal.m4         |  1 +
 ld/configure          | 18 ++++++++++++++++++
 ld/configure.ac       |  2 ++
 libctf/aclocal.m4     |  1 +
 libctf/configure      | 18 ++++++++++++++++++
 libctf/configure.ac   |  2 ++
 opcodes/aclocal.m4    |  1 +
 opcodes/configure     | 18 ++++++++++++++++++
 opcodes/configure.ac  |  2 ++
 22 files changed, 171 insertions(+)
 create mode 100644 config/jobserver.m4

diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4
index 4a6a47cab0..519325d4ae 100644
--- a/bfd/aclocal.m4
+++ b/bfd/aclocal.m4
@@ -1170,6 +1170,7 @@ AC_SUBST([am__untar])
 m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/nls.m4])
diff --git a/bfd/configure b/bfd/configure
index 12f4c88782..c518d9e5be 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -19354,3 +19354,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/bfd/configure.ac b/bfd/configure.ac
index 5ec4d4f0b4..b27b7fbec7 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -1144,3 +1144,5 @@ AC_SUBST(htmldir)
 AC_SUBST(pdfdir)
 
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/binutils/aclocal.m4 b/binutils/aclocal.m4
index 8bf2e9e242..8eca8cf94c 100644
--- a/binutils/aclocal.m4
+++ b/binutils/aclocal.m4
@@ -1192,6 +1192,7 @@ m4_include([../config/depstand.m4])
 m4_include([../config/enable.m4])
 m4_include([../config/gettext-sister.m4])
 m4_include([../config/iconv.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lcmessage.m4])
 m4_include([../config/lead-dot.m4])
diff --git a/binutils/configure b/binutils/configure
index ae396af657..c4d19e406e 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -18027,3 +18027,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/binutils/configure.ac b/binutils/configure.ac
index 883f3187e7..a72a46f478 100644
--- a/binutils/configure.ac
+++ b/binutils/configure.ac
@@ -479,3 +479,5 @@ AC_SUBST(pdfdir)
 
 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/config/jobserver.m4 b/config/jobserver.m4
new file mode 100644
index 0000000000..dc566b1a1d
--- /dev/null
+++ b/config/jobserver.m4
@@ -0,0 +1,24 @@
+dnl GNU_MAKE_JOBSERVER
+dnl
+dnl Implement a workaround for GNU mak jobserver by adding the '+' to the
+dnl recipe line in Makefiles generated by automake.
+dnl
+AC_DEFUN([GNU_MAKE_JOBSERVER],[dnl
+m4_pattern_allow(AM_V_CCLD)
+touch config.status.tmp
+dnl Must keep the same timestamps on config.status and Makefile.
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi])
diff --git a/gas/aclocal.m4 b/gas/aclocal.m4
index a9f9f5cc2d..70183124da 100644
--- a/gas/aclocal.m4
+++ b/gas/aclocal.m4
@@ -1190,6 +1190,7 @@ m4_include([../bfd/warning.m4])
 m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lcmessage.m4])
 m4_include([../config/lead-dot.m4])
diff --git a/gas/configure b/gas/configure
index ac64b617dc..6b87cc2401 100755
--- a/gas/configure
+++ b/gas/configure
@@ -17777,3 +17777,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/gas/configure.ac b/gas/configure.ac
index 8d968defb6..1b4c3dbd25 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -1076,3 +1076,5 @@ AC_CONFIG_COMMANDS([default],
  te_file=${te_file}])
 
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/gprof/aclocal.m4 b/gprof/aclocal.m4
index 957655a8f9..671b7317df 100644
--- a/gprof/aclocal.m4
+++ b/gprof/aclocal.m4
@@ -1170,6 +1170,7 @@ AC_SUBST([am__untar])
 m4_include([../bfd/warning.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/nls.m4])
diff --git a/gprof/configure b/gprof/configure
index 72ef1b2a37..4aaab18a42 100755
--- a/gprof/configure
+++ b/gprof/configure
@@ -15085,3 +15085,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/gprof/configure.ac b/gprof/configure.ac
index e9f3682293..9e9f1d34f3 100644
--- a/gprof/configure.ac
+++ b/gprof/configure.ac
@@ -74,3 +74,5 @@ AC_SUBST(pdfdir)
 
 AC_CONFIG_FILES([Makefile po/Makefile.in:po/Make-in])
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/ld/aclocal.m4 b/ld/aclocal.m4
index f6e87a228a..d1823c15d0 100644
--- a/ld/aclocal.m4
+++ b/ld/aclocal.m4
@@ -1191,6 +1191,7 @@ m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/enable.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lcmessage.m4])
 m4_include([../config/lead-dot.m4])
diff --git a/ld/configure b/ld/configure
index 78df64f56c..947de62357 100755
--- a/ld/configure
+++ b/ld/configure
@@ -20641,3 +20641,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/ld/configure.ac b/ld/configure.ac
index 7676009d91..073795f993 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -597,3 +597,5 @@ AC_SUBST(pdfdir)
 
 AC_CONFIG_FILES(Makefile po/Makefile.in:po/Make-in)
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/libctf/aclocal.m4 b/libctf/aclocal.m4
index df51584d83..4607d72856 100644
--- a/libctf/aclocal.m4
+++ b/libctf/aclocal.m4
@@ -1232,6 +1232,7 @@ m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/enable.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/override.m4])
 m4_include([../config/warnings.m4])
diff --git a/libctf/configure b/libctf/configure
index 699422151d..cd8d82e6f0 100755
--- a/libctf/configure
+++ b/libctf/configure
@@ -15791,3 +15791,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/libctf/configure.ac b/libctf/configure.ac
index 575da4677f..e741a0b236 100644
--- a/libctf/configure.ac
+++ b/libctf/configure.ac
@@ -229,3 +229,5 @@ AC_SUBST(VERSION_FLAGS)
 AC_CONFIG_FILES(Makefile)
 AC_CONFIG_HEADERS(config.h)
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/opcodes/aclocal.m4 b/opcodes/aclocal.m4
index 36b1327569..5ab3cf3ab6 100644
--- a/opcodes/aclocal.m4
+++ b/opcodes/aclocal.m4
@@ -1172,6 +1172,7 @@ m4_include([../bfd/warning.m4])
 m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/nls.m4])
 m4_include([../config/override.m4])
diff --git a/opcodes/configure b/opcodes/configure
index 5127b802a6..aa0f943568 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -15490,3 +15490,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/opcodes/configure.ac b/opcodes/configure.ac
index 00be9c88be..3a5e3c0c6f 100644
--- a/opcodes/configure.ac
+++ b/opcodes/configure.ac
@@ -382,3 +382,5 @@ AC_SUBST(BFD_MACHINES)
 
 AC_CONFIG_FILES([Makefile po/Makefile.in:po/Make-in])
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
-- 
2.26.2


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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 11:02 [PATCH] Implement a workaround for GNU mak jobserver H.J. Lu
@ 2020-10-27 15:01 ` Martin Liška
  2020-10-27 15:14 ` Andreas Schwab
  2021-01-09 15:23 ` H.J. Lu
  2 siblings, 0 replies; 18+ messages in thread
From: Martin Liška @ 2020-10-27 15:01 UTC (permalink / raw)
  To: H.J. Lu, binutils

On 10/27/20 12:02 PM, H.J. Lu via Binutils wrote:
> since the '+' is missing on the recipe line in Makefiles generated by
> automake.  Add the '+' to the recipe line by hand.

Hey.

Tested-by: Martin Liska  <mliska@suse.cz>

Thanks for the patch,
Martin

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 11:02 [PATCH] Implement a workaround for GNU mak jobserver H.J. Lu
  2020-10-27 15:01 ` Martin Liška
@ 2020-10-27 15:14 ` Andreas Schwab
  2020-10-27 15:25   ` H.J. Lu
  2021-01-09 15:23 ` H.J. Lu
  2 siblings, 1 reply; 18+ messages in thread
From: Andreas Schwab @ 2020-10-27 15:14 UTC (permalink / raw)
  To: H.J. Lu via Binutils

On Okt 27 2020, H.J. Lu via Binutils wrote:

> +touch --reference=Makefile Makefile.tmp \

This is not portable.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 15:14 ` Andreas Schwab
@ 2020-10-27 15:25   ` H.J. Lu
  2020-10-27 15:30     ` Andreas Schwab
  0 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2020-10-27 15:25 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: H.J. Lu via Binutils

On Tue, Oct 27, 2020 at 8:14 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Okt 27 2020, H.J. Lu via Binutils wrote:
>
> > +touch --reference=Makefile Makefile.tmp \
>
> This is not portable.
>

Since it must keep the same timestamps on config.status and Makefile, I used

if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
  sed '/as_fn_exit 0/i \
sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
touch --reference=Makefile Makefile.tmp \

If touch doesn't support --reference, the workaround isn't applied.

-- 
H.J.

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 15:25   ` H.J. Lu
@ 2020-10-27 15:30     ` Andreas Schwab
  2020-10-27 15:50       ` H.J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Andreas Schwab @ 2020-10-27 15:30 UTC (permalink / raw)
  To: H.J. Lu; +Cc: H.J. Lu via Binutils

On Okt 27 2020, H.J. Lu wrote:

> Since it must keep the same timestamps on config.status and Makefile,

Why is that needed?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 15:30     ` Andreas Schwab
@ 2020-10-27 15:50       ` H.J. Lu
  2020-10-27 16:04         ` Andreas Schwab
  0 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2020-10-27 15:50 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: H.J. Lu via Binutils

On Tue, Oct 27, 2020 at 8:30 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Okt 27 2020, H.J. Lu wrote:
>
> > Since it must keep the same timestamps on config.status and Makefile,
>
> Why is that needed?
>

ld/Makefile has

ldemul-list.h: Makefile
        (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 \
            echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
        done;\
        echo "";\
        echo "#define EMULATION_LIST \\";\
        for f in `echo " " ${EMULATION_OFILES} "" \
         | 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

"make check" training run in triggers both linker check and
ld-new rebuild in parallel because Makefile was edited by
config.status.  This is a simple change to avoid it.

-- 
H.J.

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 15:50       ` H.J. Lu
@ 2020-10-27 16:04         ` Andreas Schwab
  2020-10-27 16:44           ` H.J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Andreas Schwab @ 2020-10-27 16:04 UTC (permalink / raw)
  To: H.J. Lu; +Cc: H.J. Lu via Binutils

On Okt 27 2020, H.J. Lu wrote:

> "make check" training run in triggers both linker check and
> ld-new rebuild in parallel because Makefile was edited by
> config.status.  This is a simple change to avoid it.

Since the makefile was just created by config.status anyway, why is that
a problem?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 16:04         ` Andreas Schwab
@ 2020-10-27 16:44           ` H.J. Lu
  2020-10-27 18:19             ` Andreas Schwab
  0 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2020-10-27 16:44 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: H.J. Lu via Binutils

On Tue, Oct 27, 2020 at 9:04 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Okt 27 2020, H.J. Lu wrote:
>
> > "make check" training run in triggers both linker check and
> > ld-new rebuild in parallel because Makefile was edited by
> > config.status.  This is a simple change to avoid it.
>
> Since the makefile was just created by config.status anyway, why is that
> a problem?

After Makefile was recreated by the original part of config.status,
config.status
needs to re-edit Makefile to add the '+".

-- 
H.J.

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 16:44           ` H.J. Lu
@ 2020-10-27 18:19             ` Andreas Schwab
  2020-10-27 18:21               ` H.J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Andreas Schwab @ 2020-10-27 18:19 UTC (permalink / raw)
  To: H.J. Lu; +Cc: H.J. Lu via Binutils

On Okt 27 2020, H.J. Lu wrote:

> After Makefile was recreated by the original part of config.status,
> config.status
> needs to re-edit Makefile to add the '+".

So after making Makefile the newest file it is made slightly newer, but
still the newest file.  Why is that a problem?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 18:19             ` Andreas Schwab
@ 2020-10-27 18:21               ` H.J. Lu
  2020-10-27 18:58                 ` Andreas Schwab
  0 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2020-10-27 18:21 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: H.J. Lu via Binutils

On Tue, Oct 27, 2020 at 11:19 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Okt 27 2020, H.J. Lu wrote:
>
> > After Makefile was recreated by the original part of config.status,
> > config.status
> > needs to re-edit Makefile to add the '+".
>
> So after making Makefile the newest file it is made slightly newer, but
> still the newest file.  Why is that a problem?
>

The problem is that the new Makefile triggers regenerating ldemul-list.h.


-- 
H.J.

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 18:21               ` H.J. Lu
@ 2020-10-27 18:58                 ` Andreas Schwab
  2020-10-27 19:12                   ` H.J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Andreas Schwab @ 2020-10-27 18:58 UTC (permalink / raw)
  To: H.J. Lu; +Cc: H.J. Lu via Binutils

On Okt 27 2020, H.J. Lu wrote:

> The problem is that the new Makefile triggers regenerating ldemul-list.h.

Why is that a problem?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 18:58                 ` Andreas Schwab
@ 2020-10-27 19:12                   ` H.J. Lu
  2020-10-29  9:40                     ` Martin Liška
  0 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2020-10-27 19:12 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: H.J. Lu via Binutils

On Tue, Oct 27, 2020 at 11:58 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Okt 27 2020, H.J. Lu wrote:
>
> > The problem is that the new Makefile triggers regenerating ldemul-list.h.
>
> Why is that a problem?
>

You can try PGO+LTO build without touch -r.
Martin, can you help Andreas reproduce the issue?

-- 
H.J.

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 19:12                   ` H.J. Lu
@ 2020-10-29  9:40                     ` Martin Liška
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Liška @ 2020-10-29  9:40 UTC (permalink / raw)
  To: H.J. Lu, Andreas Schwab; +Cc: H.J. Lu via Binutils

On 10/27/20 8:12 PM, H.J. Lu via Binutils wrote:
> On Tue, Oct 27, 2020 at 11:58 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>>
>> On Okt 27 2020, H.J. Lu wrote:
>>
>>> The problem is that the new Makefile triggers regenerating ldemul-list.h.
>>
>> Why is that a problem?
>>
> 
> You can try PGO+LTO build without touch -r.
> Martin, can you help Andreas reproduce the issue?

I'm sorry but I don't understand the details of the discussion.

In general, LTO leverages jobserver and one needs to use '+' for sub-rules as
documented in the GCC manual:

"""
You can also specify -flto=jobserver to use GNU make’s job server mode to determine the number of parallel jobs. This is useful when the Makefile calling GCC is already executing in parallel. You must prepend a ‘+’ to the command recipe in the parent Makefile for this to work. This option likely only works if MAKE is GNU make. Even without the option value, GCC tries to automatically detect a running GNU make’s job server.
"""

Martin

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2020-10-27 11:02 [PATCH] Implement a workaround for GNU mak jobserver H.J. Lu
  2020-10-27 15:01 ` Martin Liška
  2020-10-27 15:14 ` Andreas Schwab
@ 2021-01-09 15:23 ` H.J. Lu
  2021-01-12 13:26   ` Nick Clifton
  2 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2021-01-09 15:23 UTC (permalink / raw)
  To: Binutils

[-- Attachment #1: Type: text/plain, Size: 2450 bytes --]

On Tue, Oct 27, 2020 at 4:02 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> Compiling binutils using -flto=jobserver with GCC 11 leads to
>
> libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2 -fprofile-generate -flto=jobserver -o as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o config/obj-elf.o config/atof-ieee.o  ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a -L/tmp/binutils-gdb/objdir/zlib -lz ../libiberty/libiberty.a -ldl
> lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not present in 'MAKEFLAGS'
>
> since the '+' is missing on the recipe line in Makefiles generated by
> automake.  Add the '+' to the recipe line by hand.
>
> bfd/
>
>         PR binutils/26792
>         * configure.ac: Use GNU_MAKE_JOBSERVER.
>         * aclocal.m4: Regenerated.
>         * configure: Likewise.
>
> binutils/
>
>         PR binutils/26792
>         * configure.ac: Use GNU_MAKE_JOBSERVER.
>         * aclocal.m4: Regenerated.
>         * configure: Likewise.
>
> config/
>
>         PR binutils/26792
>         * jobserver.m4: New file.
>
> gas/
>
>         PR binutils/26792
>         * configure.ac: Use GNU_MAKE_JOBSERVER.
>         * aclocal.m4: Regenerated.
>         * configure: Likewise.
>
> gprof/
>
>         PR binutils/26792
>         * configure.ac: Use GNU_MAKE_JOBSERVER.
>         * aclocal.m4: Regenerated.
>         * configure: Likewise.
>
> ld/
>
>         PR binutils/26792
>         * configure.ac: Use GNU_MAKE_JOBSERVER.
>         * aclocal.m4: Regenerated.
>         * configure: Likewise.
>
> libctf/
>
>         PR binutils/26792
>         * configure.ac: Use GNU_MAKE_JOBSERVER.
>         * aclocal.m4: Regenerated.
>         * configure: Likewise.
>
> opcodes/
>
>         PR binutils/26792
>         * configure.ac: Use GNU_MAKE_JOBSERVER.
>         * aclocal.m4: Regenerated.
>         * configure: Likewise.

I have checked the PGO/LTO build patches into master branch.   Here
is the updated patch to enable LTO jobserver with GCC 11.

OK for master?

H.J.

[-- Attachment #2: 0001-Implement-a-workaround-for-GNU-mak-jobserver.patch --]
[-- Type: text/x-patch, Size: 15480 bytes --]

From 3ad2b4ce4e1689e4339ad18a39eeef339901ea75 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 26 Oct 2020 15:08:31 -0700
Subject: [PATCH 1/3] Implement a workaround for GNU mak jobserver

Compiling binutils using -flto=jobserver with GCC 11 leads to

libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2 -fprofile-generate -flto=jobserver -o as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o config/obj-elf.o config/atof-ieee.o  ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a -L/tmp/binutils-gdb/objdir/zlib -lz ../libiberty/libiberty.a -ldl
lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not present in 'MAKEFLAGS'

since the '+' is missing on the recipe line in Makefiles generated by
automake.  Add the '+' to the recipe line by hand.

bfd/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

binutils/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

config/

	PR binutils/26792
	* jobserver.m4: New file.

gas/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

gprof/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

ld/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

libctf/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

opcodes/

	PR binutils/26792
	* configure.ac: Use GNU_MAKE_JOBSERVER.
	* aclocal.m4: Regenerated.
	* configure: Likewise.
---
 bfd/aclocal.m4        |  1 +
 bfd/configure         | 18 ++++++++++++++++++
 bfd/configure.ac      |  2 ++
 binutils/aclocal.m4   |  1 +
 binutils/configure    | 18 ++++++++++++++++++
 binutils/configure.ac |  2 ++
 config/jobserver.m4   | 24 ++++++++++++++++++++++++
 gas/aclocal.m4        |  1 +
 gas/configure         | 18 ++++++++++++++++++
 gas/configure.ac      |  2 ++
 gprof/aclocal.m4      |  1 +
 gprof/configure       | 18 ++++++++++++++++++
 gprof/configure.ac    |  2 ++
 ld/aclocal.m4         |  1 +
 ld/configure          | 18 ++++++++++++++++++
 ld/configure.ac       |  2 ++
 libctf/aclocal.m4     |  1 +
 libctf/configure      | 18 ++++++++++++++++++
 libctf/configure.ac   |  2 ++
 opcodes/aclocal.m4    |  1 +
 opcodes/configure     | 18 ++++++++++++++++++
 opcodes/configure.ac  |  2 ++
 22 files changed, 171 insertions(+)
 create mode 100644 config/jobserver.m4

diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4
index 4a6a47cab07..519325d4aef 100644
--- a/bfd/aclocal.m4
+++ b/bfd/aclocal.m4
@@ -1170,6 +1170,7 @@ AC_SUBST([am__untar])
 m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/nls.m4])
diff --git a/bfd/configure b/bfd/configure
index 4b8dede2150..9eb5006ea3c 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -19346,3 +19346,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/bfd/configure.ac b/bfd/configure.ac
index 0797a08ff37..102a22171f6 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -1146,3 +1146,5 @@ AC_SUBST(htmldir)
 AC_SUBST(pdfdir)
 
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/binutils/aclocal.m4 b/binutils/aclocal.m4
index 8bf2e9e2424..8eca8cf94c7 100644
--- a/binutils/aclocal.m4
+++ b/binutils/aclocal.m4
@@ -1192,6 +1192,7 @@ m4_include([../config/depstand.m4])
 m4_include([../config/enable.m4])
 m4_include([../config/gettext-sister.m4])
 m4_include([../config/iconv.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lcmessage.m4])
 m4_include([../config/lead-dot.m4])
diff --git a/binutils/configure b/binutils/configure
index f1b80648d3f..f6e66e5fe14 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -18043,3 +18043,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/binutils/configure.ac b/binutils/configure.ac
index 4cbe0e39f06..6ab85466370 100644
--- a/binutils/configure.ac
+++ b/binutils/configure.ac
@@ -494,3 +494,5 @@ AC_SUBST(pdfdir)
 
 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/config/jobserver.m4 b/config/jobserver.m4
new file mode 100644
index 00000000000..dc566b1a1d9
--- /dev/null
+++ b/config/jobserver.m4
@@ -0,0 +1,24 @@
+dnl GNU_MAKE_JOBSERVER
+dnl
+dnl Implement a workaround for GNU mak jobserver by adding the '+' to the
+dnl recipe line in Makefiles generated by automake.
+dnl
+AC_DEFUN([GNU_MAKE_JOBSERVER],[dnl
+m4_pattern_allow(AM_V_CCLD)
+touch config.status.tmp
+dnl Must keep the same timestamps on config.status and Makefile.
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi])
diff --git a/gas/aclocal.m4 b/gas/aclocal.m4
index a9f9f5cc2df..70183124da7 100644
--- a/gas/aclocal.m4
+++ b/gas/aclocal.m4
@@ -1190,6 +1190,7 @@ m4_include([../bfd/warning.m4])
 m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lcmessage.m4])
 m4_include([../config/lead-dot.m4])
diff --git a/gas/configure b/gas/configure
index 43ac48491db..b053d3e8d53 100755
--- a/gas/configure
+++ b/gas/configure
@@ -17767,3 +17767,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/gas/configure.ac b/gas/configure.ac
index 82706561886..3abba432314 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -1076,3 +1076,5 @@ AC_CONFIG_COMMANDS([default],
  te_file=${te_file}])
 
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/gprof/aclocal.m4 b/gprof/aclocal.m4
index 957655a8f9f..671b7317dfd 100644
--- a/gprof/aclocal.m4
+++ b/gprof/aclocal.m4
@@ -1170,6 +1170,7 @@ AC_SUBST([am__untar])
 m4_include([../bfd/warning.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/nls.m4])
diff --git a/gprof/configure b/gprof/configure
index ce3a1d5bd11..0ed48a3f744 100755
--- a/gprof/configure
+++ b/gprof/configure
@@ -15075,3 +15075,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/gprof/configure.ac b/gprof/configure.ac
index ef7f3b4bad7..36a40848097 100644
--- a/gprof/configure.ac
+++ b/gprof/configure.ac
@@ -74,3 +74,5 @@ AC_SUBST(pdfdir)
 
 AC_CONFIG_FILES([Makefile po/Makefile.in:po/Make-in])
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/ld/aclocal.m4 b/ld/aclocal.m4
index f6e87a228af..d1823c15d06 100644
--- a/ld/aclocal.m4
+++ b/ld/aclocal.m4
@@ -1191,6 +1191,7 @@ m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/enable.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/largefile.m4])
 m4_include([../config/lcmessage.m4])
 m4_include([../config/lead-dot.m4])
diff --git a/ld/configure b/ld/configure
index d7cd782957f..cfb5e4ecf64 100755
--- a/ld/configure
+++ b/ld/configure
@@ -20621,3 +20621,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/ld/configure.ac b/ld/configure.ac
index c9c69ab9245..767eda83413 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -597,3 +597,5 @@ AC_SUBST(pdfdir)
 
 AC_CONFIG_FILES(Makefile po/Makefile.in:po/Make-in)
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/libctf/aclocal.m4 b/libctf/aclocal.m4
index df51584d837..4607d728564 100644
--- a/libctf/aclocal.m4
+++ b/libctf/aclocal.m4
@@ -1232,6 +1232,7 @@ m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/enable.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/override.m4])
 m4_include([../config/warnings.m4])
diff --git a/libctf/configure b/libctf/configure
index 3d2f22528d3..40a5eb31532 100755
--- a/libctf/configure
+++ b/libctf/configure
@@ -15760,3 +15760,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/libctf/configure.ac b/libctf/configure.ac
index bbdfd63e7c9..c3fea731ea8 100644
--- a/libctf/configure.ac
+++ b/libctf/configure.ac
@@ -210,3 +210,5 @@ AC_SUBST(VERSION_FLAGS)
 AC_CONFIG_FILES(Makefile)
 AC_CONFIG_HEADERS(config.h)
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
diff --git a/opcodes/aclocal.m4 b/opcodes/aclocal.m4
index 36b1327569b..5ab3cf3ab6f 100644
--- a/opcodes/aclocal.m4
+++ b/opcodes/aclocal.m4
@@ -1172,6 +1172,7 @@ m4_include([../bfd/warning.m4])
 m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/gettext-sister.m4])
+m4_include([../config/jobserver.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/nls.m4])
 m4_include([../config/override.m4])
diff --git a/opcodes/configure b/opcodes/configure
index 92b4b2247d6..db5361d8668 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -15480,3 +15480,21 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+
+touch config.status.tmp
+if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
+  sed '/as_fn_exit 0/i \
+sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
+touch --reference=Makefile Makefile.tmp \
+mv Makefile.tmp Makefile \
+' config.status > config.status.tmp
+  touch --reference=config.status config.status.tmp
+  mv config.status.tmp config.status
+  chmod +x config.status
+  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
+  touch --reference=Makefile Makefile.tmp
+  mv Makefile.tmp Makefile
+else
+  rm -f config.status.tmp
+fi
diff --git a/opcodes/configure.ac b/opcodes/configure.ac
index 07e95f0ee31..21929796fef 100644
--- a/opcodes/configure.ac
+++ b/opcodes/configure.ac
@@ -382,3 +382,5 @@ AC_SUBST(BFD_MACHINES)
 
 AC_CONFIG_FILES([Makefile po/Makefile.in:po/Make-in])
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
-- 
2.29.2


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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2021-01-09 15:23 ` H.J. Lu
@ 2021-01-12 13:26   ` Nick Clifton
  2021-01-12 13:36     ` H.J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Clifton @ 2021-01-12 13:26 UTC (permalink / raw)
  To: H.J. Lu, Binutils

Hi H.J.

>> since the '+' is missing on the recipe line in Makefiles generated by
>> automake.  Add the '+' to the recipe line by hand.

Is this an automake bug that ought to be reported ?

>> bfd/
>>
>>          PR binutils/26792
>>          * configure.ac: Use GNU_MAKE_JOBSERVER.
>>          * aclocal.m4: Regenerated.
>>          * configure: Likewise.
>>
>> binutils/
>>
>>          PR binutils/26792
>>          * configure.ac: Use GNU_MAKE_JOBSERVER.
>>          * aclocal.m4: Regenerated.
>>          * configure: Likewise.
>>
>> config/
>>
>>          PR binutils/26792
>>          * jobserver.m4: New file.
>>
>> gas/
>>
>>          PR binutils/26792
>>          * configure.ac: Use GNU_MAKE_JOBSERVER.
>>          * aclocal.m4: Regenerated.
>>          * configure: Likewise.
>>
>> gprof/
>>
>>          PR binutils/26792
>>          * configure.ac: Use GNU_MAKE_JOBSERVER.
>>          * aclocal.m4: Regenerated.
>>          * configure: Likewise.
>>
>> ld/
>>
>>          PR binutils/26792
>>          * configure.ac: Use GNU_MAKE_JOBSERVER.
>>          * aclocal.m4: Regenerated.
>>          * configure: Likewise.
>>
>> libctf/
>>
>>          PR binutils/26792
>>          * configure.ac: Use GNU_MAKE_JOBSERVER.
>>          * aclocal.m4: Regenerated.
>>          * configure: Likewise.
>>
>> opcodes/
>>
>>          PR binutils/26792
>>          * configure.ac: Use GNU_MAKE_JOBSERVER.
>>          * aclocal.m4: Regenerated.
>>          * configure: Likewise.
> 
> I have checked the PGO/LTO build patches into master branch.   Here
> is the updated patch to enable LTO jobserver with GCC 11.
> 
> OK for master?

Approved - please apply.

Cheers
   Nick


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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2021-01-12 13:26   ` Nick Clifton
@ 2021-01-12 13:36     ` H.J. Lu
  2021-01-12 13:39       ` H.J. Lu
  2021-01-13 11:43       ` Regen Makefile.in for jobserver.m4 aclocal.m4 dependency Alan Modra
  0 siblings, 2 replies; 18+ messages in thread
From: H.J. Lu @ 2021-01-12 13:36 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Binutils

On Tue, Jan 12, 2021 at 5:26 AM Nick Clifton <nickc@redhat.com> wrote:
>
> Hi H.J.
>
> >> since the '+' is missing on the recipe line in Makefiles generated by
> >> automake.  Add the '+' to the recipe line by hand.
>
> Is this an automake bug that ought to be reported ?

Yes

https://lists.gnu.org/archive/html/automake/2020-02/msg00012.html

But my automake patch was rejected because automake developers
believe that the choice of adding '+" belongs to package builders, not
package developers.

> >> bfd/
> >>
> >>          PR binutils/26792
> >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> >>          * aclocal.m4: Regenerated.
> >>          * configure: Likewise.
> >>
> >> binutils/
> >>
> >>          PR binutils/26792
> >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> >>          * aclocal.m4: Regenerated.
> >>          * configure: Likewise.
> >>
> >> config/
> >>
> >>          PR binutils/26792
> >>          * jobserver.m4: New file.
> >>
> >> gas/
> >>
> >>          PR binutils/26792
> >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> >>          * aclocal.m4: Regenerated.
> >>          * configure: Likewise.
> >>
> >> gprof/
> >>
> >>          PR binutils/26792
> >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> >>          * aclocal.m4: Regenerated.
> >>          * configure: Likewise.
> >>
> >> ld/
> >>
> >>          PR binutils/26792
> >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> >>          * aclocal.m4: Regenerated.
> >>          * configure: Likewise.
> >>
> >> libctf/
> >>
> >>          PR binutils/26792
> >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> >>          * aclocal.m4: Regenerated.
> >>          * configure: Likewise.
> >>
> >> opcodes/
> >>
> >>          PR binutils/26792
> >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> >>          * aclocal.m4: Regenerated.
> >>          * configure: Likewise.
> >
> > I have checked the PGO/LTO build patches into master branch.   Here
> > is the updated patch to enable LTO jobserver with GCC 11.
> >
> > OK for master?
>
> Approved - please apply.
>

I will check it in shortly.

Thanks.

-- 
H.J.

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

* Re: [PATCH] Implement a workaround for GNU mak jobserver
  2021-01-12 13:36     ` H.J. Lu
@ 2021-01-12 13:39       ` H.J. Lu
  2021-01-13 11:43       ` Regen Makefile.in for jobserver.m4 aclocal.m4 dependency Alan Modra
  1 sibling, 0 replies; 18+ messages in thread
From: H.J. Lu @ 2021-01-12 13:39 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Binutils

On Tue, Jan 12, 2021 at 5:36 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Tue, Jan 12, 2021 at 5:26 AM Nick Clifton <nickc@redhat.com> wrote:
> >
> > Hi H.J.
> >
> > >> since the '+' is missing on the recipe line in Makefiles generated by
> > >> automake.  Add the '+' to the recipe line by hand.
> >
> > Is this an automake bug that ought to be reported ?
>
> Yes
>
> https://lists.gnu.org/archive/html/automake/2020-02/msg00012.html
>
> But my automake patch was rejected because automake developers
> believe that the choice of adding '+" belongs to package builders, not
> package developers.

FYI, here is my automake patch:

https://lists.gnu.org/archive/html/automake-patches/2020-10/msg00003.html

> > >> bfd/
> > >>
> > >>          PR binutils/26792
> > >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> > >>          * aclocal.m4: Regenerated.
> > >>          * configure: Likewise.
> > >>
> > >> binutils/
> > >>
> > >>          PR binutils/26792
> > >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> > >>          * aclocal.m4: Regenerated.
> > >>          * configure: Likewise.
> > >>
> > >> config/
> > >>
> > >>          PR binutils/26792
> > >>          * jobserver.m4: New file.
> > >>
> > >> gas/
> > >>
> > >>          PR binutils/26792
> > >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> > >>          * aclocal.m4: Regenerated.
> > >>          * configure: Likewise.
> > >>
> > >> gprof/
> > >>
> > >>          PR binutils/26792
> > >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> > >>          * aclocal.m4: Regenerated.
> > >>          * configure: Likewise.
> > >>
> > >> ld/
> > >>
> > >>          PR binutils/26792
> > >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> > >>          * aclocal.m4: Regenerated.
> > >>          * configure: Likewise.
> > >>
> > >> libctf/
> > >>
> > >>          PR binutils/26792
> > >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> > >>          * aclocal.m4: Regenerated.
> > >>          * configure: Likewise.
> > >>
> > >> opcodes/
> > >>
> > >>          PR binutils/26792
> > >>          * configure.ac: Use GNU_MAKE_JOBSERVER.
> > >>          * aclocal.m4: Regenerated.
> > >>          * configure: Likewise.
> > >
> > > I have checked the PGO/LTO build patches into master branch.   Here
> > > is the updated patch to enable LTO jobserver with GCC 11.
> > >
> > > OK for master?
> >
> > Approved - please apply.
> >
>
> I will check it in shortly.
>
> Thanks.
>
> --
> H.J.



-- 
H.J.

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

* Regen Makefile.in for jobserver.m4 aclocal.m4 dependency
  2021-01-12 13:36     ` H.J. Lu
  2021-01-12 13:39       ` H.J. Lu
@ 2021-01-13 11:43       ` Alan Modra
  1 sibling, 0 replies; 18+ messages in thread
From: Alan Modra @ 2021-01-13 11:43 UTC (permalink / raw)
  To: Binutils

bfd/
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
binutils/
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gas/
	* Makefile.in: Regenerate.
	* Makefile.in: Regenerate.
gprof/
	* Makefile.in: Regenerate.
ld/
	* Makefile.in: Regenerate.
libctf/
	* Makefile.in: Regenerate.
opcodes/
	* Makefile.in: Regenerate.

diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 60fe040af0..a5d1f8e882 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -116,6 +116,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/depstand.m4 \
 	$(top_srcdir)/../config/gettext-sister.m4 \
+	$(top_srcdir)/../config/jobserver.m4 \
 	$(top_srcdir)/../config/largefile.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/nls.m4 \

and more like the above.

-- 
Alan Modra
Australia Development Lab, IBM

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

end of thread, other threads:[~2021-01-13 11:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 11:02 [PATCH] Implement a workaround for GNU mak jobserver H.J. Lu
2020-10-27 15:01 ` Martin Liška
2020-10-27 15:14 ` Andreas Schwab
2020-10-27 15:25   ` H.J. Lu
2020-10-27 15:30     ` Andreas Schwab
2020-10-27 15:50       ` H.J. Lu
2020-10-27 16:04         ` Andreas Schwab
2020-10-27 16:44           ` H.J. Lu
2020-10-27 18:19             ` Andreas Schwab
2020-10-27 18:21               ` H.J. Lu
2020-10-27 18:58                 ` Andreas Schwab
2020-10-27 19:12                   ` H.J. Lu
2020-10-29  9:40                     ` Martin Liška
2021-01-09 15:23 ` H.J. Lu
2021-01-12 13:26   ` Nick Clifton
2021-01-12 13:36     ` H.J. Lu
2021-01-12 13:39       ` H.J. Lu
2021-01-13 11:43       ` Regen Makefile.in for jobserver.m4 aclocal.m4 dependency Alan Modra

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