Bug 48724

Summary: Lto build of mozilla dies at lto-wrapper: error trying to exec 'make -j1': execvp: No such file or directory
Product: gcc Reporter: Jan Hubicka <hubicka>
Component: ltoAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED WORKSFORME    
Severity: normal CC: Ralf.Wildenhues
Priority: P3    
Version: 4.6.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2012-05-08 00:00:00
Bug Depends on:    
Bug Blocks: 45375    

Description Jan Hubicka 2011-04-22 09:05:05 UTC
Hi,
It seems that environment vars set by mozilla build confuse lto-wrapper with:

lto-wrapper: error trying to exec 'make -j1': execvp: No such file or directory

cut&pasting the compilation command line and executing it by hand works well.

Honza
Comment 1 Richard Biener 2011-04-22 09:16:34 UTC
Does it set MAKE?  I suppose we need to split (and preserve?) arguments :/
Comment 2 Jan Hubicka 2011-04-22 09:24:59 UTC
Hmm,
grep didn't seem to find any interesting positives on this.  However I did not update my mozilla tree since last build that did not reproduce this and nothing seems to have changed on GCC side.  I think evans got updated, so perhaps it is feature of new GNU Make to prevent fork bombs?

Mozilla Makefiles do not use "+" clauses and I simply use hard wired -flto=24 setting.

Honza
Comment 3 Andrew Pinski 2011-12-15 23:39:37 UTC
Has this been fixed?
Comment 4 Richard Biener 2012-05-07 12:30:01 UTC
No response and unclear bug.
Comment 5 Jan Hubicka 2012-05-07 23:20:50 UTC
> No response and unclear bug.
It is still there.  In lto-wrapper.c we do 
         new_argv[0] = getenv ("MAKE");
and when MAKE is set to something like "make -j" we try to execute it...

Honza
Comment 6 Richard Biener 2012-05-08 10:15:26 UTC
Ok, you didn't state that Mozilla indeed sets MAKE to 'make -j'.  Yes, if that
happens there is a problem.
Comment 7 Richard Biener 2013-03-08 13:58:27 UTC
Caused by

2010-05-23  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

       * lto-wrapper.c (run_gcc): Unset MAKEFLAGS and MFLAGS
       before calling make; allow override through $MAKE.
       * doc/invoke.texi (Optimize Options): Document override.

simply checking with access (..., X_OK) of course doesn't work (that doesn't
search the path...).
Comment 8 Jan Hubicka 2015-01-20 02:30:01 UTC
This no longer happens with recent Firefox builds, but I think it was rather fixed at Firefox buildsystem...
Comment 9 Eric Gallager 2017-11-16 20:53:31 UTC
(In reply to Jan Hubicka from comment #8)
> This no longer happens with recent Firefox builds, but I think it was rather
> fixed at Firefox buildsystem...

That sounds like WORKSFORME then.