From 40f33f0e308278548534260e3adf932a418238fa Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Wed, 30 Jun 2010 16:39:28 +0000 Subject: Fix a problem where multigcc.pl sometimes produces lines like "sh-elf-gcc: no input files", especially on systems with many cores and for builds with (relatively) few files. This happened because the slice size was rounded up, which meant that in some cases there werere leftover slices. Also remove the now unnecessary cores>files checking. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27196 a1c6a512-1295-4272-9138-f99709370657 --- tools/multigcc.pl | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/multigcc.pl b/tools/multigcc.pl index 5222f61b49..9be9978bd4 100755 --- a/tools/multigcc.pl +++ b/tools/multigcc.pl @@ -46,27 +46,25 @@ switch($^O) { } } -# don't run empty children -if (scalar @files <= $cores) -{ - $cores = 1; -} - # fork children my @pids; my $slice = int((scalar @files + $cores) / $cores); -for my $i (0 .. $cores-1) + +# reset $cores to 0 so we can count the number of actually used cores +$cores=0; + +for (my $i=0;$i $tempfile.$$"); -- cgit v1.2.3