Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tools Fix passing -j NNN to gmake



details:   https://anonhg.NetBSD.org/src/rev/c5d157cc391c
branches:  trunk
changeset: 375886:c5d157cc391c
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri May 19 10:42:34 2023 +0000

description:
Fix passing -j NNN to gmake

Use a more restrictive pattern to extract -j NNN from MAKEFLAGS
into GMAKE_J_ARGS, to avoid false positives when the source directory
has "-j" in the path (e.g "amd64-job-000012" or "src-j9999").
Previously this could pass either -"-j" or "-j BIGNUM" to gmake
and result in "vfork: Resource temporarily unavailable" failures.

PR misc/54456

diffstat:

 external/gpl3/gcc.old/usr.bin/host-libcpp/Makefile |  4 ++--
 external/gpl3/gcc/usr.bin/host-libcpp/Makefile     |  4 ++--
 tools/Makefile.gnuhost                             |  4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 99da3d4a8bd9 -r c5d157cc391c external/gpl3/gcc.old/usr.bin/host-libcpp/Makefile
--- a/external/gpl3/gcc.old/usr.bin/host-libcpp/Makefile        Fri May 19 07:05:26 2023 +0000
+++ b/external/gpl3/gcc.old/usr.bin/host-libcpp/Makefile        Fri May 19 10:42:34 2023 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.6 2023/02/20 02:12:35 mrg Exp $
+#      $NetBSD: Makefile,v 1.7 2023/05/19 10:42:34 lukem Exp $
 
 BUILD_ENV= \
                AR=${HOST_AR:Q} \
@@ -19,7 +19,7 @@ BUILD_ENV= \
                RANLIB=${HOST_RANLIB:Q} \
                YACC=${YACC:Q}
 
-GMAKE_J_ARGS?= ${MAKEFLAGS:[*]:M*-j*:C/.*(-j ?[0-9]*).*/\1/W}
+GMAKE_J_ARGS?= ${MAKEFLAGS:[*]:M*-j*:C/(^|.* )(-j ?[0-9][0-9]*).*/\2/W}
 BUILD_COMMAND= /usr/bin/env -i ${BUILD_ENV} ${TOOL_GMAKE} ${GMAKE_J_ARGS} -e
 
 libcpp/libcpp.a:
diff -r 99da3d4a8bd9 -r c5d157cc391c external/gpl3/gcc/usr.bin/host-libcpp/Makefile
--- a/external/gpl3/gcc/usr.bin/host-libcpp/Makefile    Fri May 19 07:05:26 2023 +0000
+++ b/external/gpl3/gcc/usr.bin/host-libcpp/Makefile    Fri May 19 10:42:34 2023 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.5 2020/06/24 05:06:08 rin Exp $
+#      $NetBSD: Makefile,v 1.6 2023/05/19 10:42:34 lukem Exp $
 
 BUILD_ENV= \
                AR=${HOST_AR:Q} \
@@ -19,7 +19,7 @@ BUILD_ENV= \
                RANLIB=${HOST_RANLIB:Q} \
                YACC=${YACC:Q}
 
-GMAKE_J_ARGS?= ${MAKEFLAGS:[*]:M*-j*:C/.*(-j ?[0-9]*).*/\1/W}
+GMAKE_J_ARGS?= ${MAKEFLAGS:[*]:M*-j*:C/(^|.* )(-j ?[0-9][0-9]*).*/\2/W}
 BUILD_COMMAND= /usr/bin/env -i ${BUILD_ENV} ${TOOL_GMAKE} ${GMAKE_J_ARGS} -e
 
 libcpp/libcpp.a:
diff -r 99da3d4a8bd9 -r c5d157cc391c tools/Makefile.gnuhost
--- a/tools/Makefile.gnuhost    Fri May 19 07:05:26 2023 +0000
+++ b/tools/Makefile.gnuhost    Fri May 19 10:42:34 2023 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.gnuhost,v 1.55 2023/05/15 21:24:56 lukem Exp $
+#      $NetBSD: Makefile.gnuhost,v 1.56 2023/05/19 10:42:34 lukem Exp $
 #
 # Rules used when building a GNU host package.  Expects MODULE to be set.
 #
@@ -100,7 +100,7 @@ BUILD_COMMAND=      ${BUILD_ENV} ${MAKE} ${MA
 # gmake version of this puts MAKE_ARGS in the environment to be sure that
 # sub-gmake's get them, otherwise tools/gcc tries to build libgcc and
 # fails.  it also uses "env -i" to entirely clear out MAKEFLAGS.
-GMAKE_J_ARGS?= ${MAKEFLAGS:[*]:M*-j*:C/.*(-j ?[0-9]*).*/\1/W}
+GMAKE_J_ARGS?= ${MAKEFLAGS:[*]:M*-j*:C/(^|.* )(-j ?[0-9][0-9]*).*/\2/W}
 BUILD_COMMAND= /usr/bin/env -i ${BUILD_ENV} ${MAKE_ARGS:N-*} ${TOOL_GMAKE} ${GMAKE_J_ARGS} -e ${MAKE_ARGS}
 
 .endif



Home | Main Index | Thread Index | Old Index