This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto][patch] fix "make -j K check"
- From: Rafael Espindola <espindola at google dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Diego Novillo <dnovillo at google dot com>
- Date: Mon, 24 Nov 2008 13:40:09 +0000
- Subject: [lto][patch] fix "make -j K check"
In a "make -j K check", the environment variables that make sets were
confusing the make invocations done by ltrans. This was resulting in
errors like
make[4]: *** read jobs pipe: No such file or directory. Stop.
make[4]: *** Waiting for unfinished jobs..
showing up in the test logs. This patch fixes it by clearing the make
variables in ltrans-driver.
2008-11-24 Rafael Espindola <espindola@google.com>
* ltrans-driver: Unset MAKEFLAGS, MAKEINFO and MAKELEVEL.
Cheers,
--
Rafael Avila de Espindola
Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/gcc/lto/ltrans-driver b/gcc/lto/ltrans-driver
index 47b295d..e3371cc 100755
--- a/gcc/lto/ltrans-driver
+++ b/gcc/lto/ltrans-driver
@@ -23,8 +23,7 @@
# This is the default ltrans_driver for LTO. It takes a list of files
# output during WPA mode and expects the CC and CFLAGS environment variables
# to be set. It generates a temporary Makefile, and uses it to convert .o
-# files to .ltrans.o files. Other environment variables (e.g. MAKE and
-# MAKEFLAGS) can be used to control the behavior of make.
+# files to .ltrans.o files.
# Create a temporary directory $tmp in $TMPDIR (default /tmp).
@@ -48,6 +47,12 @@ trap 'rm -rf $tmp' TERM INT EXIT
makefile=$tmp/Makefile
touch $makefile
+# We have to clear these to avoid problems with this make invocations getting
+# confused with variables set by (for example) "make -j 2 check".
+unset MAKEFLAGS
+unset MAKEINFO
+unset MAKELEVEL
+
inputlist="$@"
outputlist=
for input in $inputlist