[lto] Minor fixes

Diego Novillo dnovillo@google.com
Fri Dec 19 14:10:00 GMT 2008


Found while debugging.  When lto1 cannot open an object file, it
was not showing which file it had tried to open.

The second fix helps when using -v to see what ltrans_driver
does, it inhibits the call to parallel make to prevent intermixed
output from the parallel execution.

Tested on x86_64.


Diego.


2008-12-19  Diego Novillo  <dnovillo@google.com>

	* lto-elf.c (lto_elf_file_open): When FILENAME cannot
	be opened, show its name.
	* ltrans-driver: If $verbose is set, do not use parallelism.

Index: lto/lto-elf.c
===================================================================
--- lto/lto-elf.c	(revision 142823)
+++ lto/lto-elf.c	(working copy)
@@ -536,7 +536,7 @@ lto_elf_file_open (const char *filename,
   elf_file->fd = open (filename, writable ? O_WRONLY|O_CREAT : O_RDONLY, 0666);
   if (elf_file->fd == -1)
     {
-      error ("could not open");
+      error ("could not open file %s", filename);
       goto fail;
     }
 
Index: lto/ltrans-driver
===================================================================
--- lto/ltrans-driver	(revision 142823)
+++ lto/ltrans-driver	(working copy)
@@ -92,7 +92,7 @@ awk=/usr/bin/awk
 uptime=/usr/bin/uptime
 getconf=/usr/bin/getconf
 par=1
-if [ -x $awk -a -x $uptime -a -x $getconf ] ; then
+if [ $verbose -ne 1 -a -x $awk -a -x $uptime -a -x $getconf ] ; then
   loadavg=$($uptime | $awk '{ l = $(NF - 2); print int (strtonum (l)); }')
   nprocs=$($getconf _NPROCESSORS_ONLN)
   if [ $loadavg -lt $nprocs ] ; then



More information about the Gcc-patches mailing list